Posted March 10, 201312 yr I have a Custom block render model and I am wondering how I would Render the same model in the inventory rather than a "flat" texture I also have the ModelSmith/RenderSmith/TileEntitySmith if needed just ask BlockSmith package jordan30001.testMod.common.blocks.smith; import java.util.List; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.relauncher.*; import jordan30001.testMod.common.Main; import jordan30001.testMod.utils.Utils; public class BlockSmith extends BlockContainer { private Class thisClass; public BlockSmith(int ID, int texID, Material m, Class c) { super(ID, texID, m); thisClass = c; setBlockName("jordan30001BlockSmith"); setTextureFile("/testModGFX/Blocks.png"); //The texture file used this.blockIndexInTexture = texID; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return -1; } @Override public TileEntity createNewTileEntity(World var1) { return new TileEntitySmith(); } public TileEntity getBlockEntity() { try { return (TileEntity) TileEntitySmith.class.newInstance(); } catch (Exception exception) { throw new RuntimeException(exception); } } }
March 10, 201312 yr Author Found an answer after lots and lots of googling Here is the link if your also stuck on this and can't find an answer easily http://www.minecraftforum.net/topic/1154044-147forge19213-duckys-modding-tutorials-make-your-blocks-nice/
March 10, 201312 yr This is not an answer for custom BLOCK renderer, but for custom TILEENTITY renderer. You can't (or rather you shouldn't) use this approach for blocks that are naturally ocuring. Even for blocks that are not it's not the best solution. Yes, it works, but there's a performance cost - tile entity saves itself, ticks, synchronizes and so on. This should be done via ISimpleBlockRenderingHandler. sample code (not nicest, some things like dependency on TileEntityRenderer's mappings need refactoring, but it's functional): https://github.com/mnn/jaffas/blob/b05d038e7c30c3c3fc9ea0783c640bdd76129a09/src/minecraft/monnef/jaffas/power/client/BlockRenderingHandler.java (you can browse the repo to view other classes) mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
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.