Posted February 27, 201510 yr Hi guys, I'm having problem rendering blocks on inventory. If I place the block, the rendering is good, it's only on my inventory. There is nothing suspect in logs. I'm overriding BlockOre and using a "setTexture" method to register the block : public BlockOre setTexture(String texture) { setUnlocalizedName(texture); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(this), 0, new ModelResourceLocation(MyMod.MODID + ":" + texture, "inventory")); GameRegistry.registerBlock(this, texture); return this; } on FMInitializationEvent I do : rubyOre = new IronBlockOre().setTexture("ruby_ore").setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston); and here are jsons files : src/main/resources/assets/my_modid/models/block/ruby_ore.json : { "parent": "block/cube_all", "textures": { "all": "my_modid:blocks/ruby_ore" } } src/main/resources/assets/my_modid/models/item/ruby_ore.json : { "parent": "my_modid:block/ruby_ore", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } src/main/resources/assets/my_modid/blockstates/ruby_ore.json : { "variants": { "normal": { "model": "my_modid:ruby_ore" } } } the texture is at src/main/resources/assets/my_modid/textures/blocks/ruby_ore.png What am i doing wrong ? Thanks you for your help.
February 27, 201510 yr Rendering registration should be done in load (init) in proxy. Also - why are you using GameRegistry in setTexture? To be more precise - move your rendering registration to Main#proxy#registerRenderers() and call it in init. GameRegistry and setting UN should stay in preInit, separately. Tip: Rename your setTexture method - it's confusing, also you can do that in constructor if you really want. 1.7.10 is no longer supported by forge, you are on your own.
February 27, 201510 yr Author Thanks for your response. I don't understand how it works, I need to declare blocks and GameRegistry.registerBlock on preInit and setting texture on init ? And yes I'll rename "setTexture", it's confusing. PS : Nevermind, I figured out by myself. It was a problem with preInit and init like you said, thanks you Ernio.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.