Posted April 19, 201411 yr I'm trying to create a block renders as a techne model but this is what i get ^^^ I have no idea why this happens. Here is my src code: Main Mod @Mod(modid = FactoryCraft.MODID, name = FactoryCraft.NAME, version = FactoryCraft.VERSION) public class FactoryCraft { @SidedProxy(clientSide = "me.FactoryCraft.FactoryCraft.ClientProxy", serverSide = "me.FactoryCraft.FactoryCraft.CommonProxy") public static CommonProxy proxy; public static final String MODID = "FactoryCraft"; public static final String VERSION = "0.0.1a"; public static final String NAME = "Factory Craft"; public static Block woodMachineFrame = new WoodMachineFrame(1234, Material.wood).setBlockName("WoodMachineFrame").setBlockTextureName(FactoryCraft.MODID + ":planks"); @Instance(FactoryCraft.MODID) public static FactoryCraft instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame"); Items.init(); Entities.init(); } ClientProxy public class ClientProxy extends CommonProxy { @Override public void initRenderes() { RenderingRegistry.registerEntityRenderingHandler(EntityChimney.class, new RenderChimney()); } } The Entity public class EntityChimney extends Entity { public EntityChimney(World world) { super(world); } public EntityChimney(World world, double x, double y, double z) { super(world); posX = x; posY = y; posZ = z; } @Override protected void entityInit() { } @Override protected void readEntityFromNBT(NBTTagCompound var1) { } @Override protected void writeEntityToNBT(NBTTagCompound var1) { } } The Model (The names are in danish... But it's made in techne) public class ModelChimney extends ModelBase { //fields ModelRenderer fladeF; ModelRenderer fladeR; ModelRenderer fladeL; ModelRenderer fladeB; ModelRenderer streg1; ModelRenderer streg2; ModelRenderer streg3; ModelRenderer streg4; ModelRenderer streg5; ModelRenderer streg6; ModelRenderer streg7; ModelRenderer streg8; ModelRenderer Shape9; ModelRenderer streg10; ModelRenderer streg11; ModelRenderer streg12; public ModelChimney() { textureWidth = 64; textureHeight = 32; fladeF = new ModelRenderer(this, 0, 0); fladeF.addBox(0F, 0F, 0F, 6, 16, 1); fladeF.setRotationPoint(-3F, 8F, -7F); fladeF.setTextureSize(64, 32); fladeF.mirror = true; setRotation(fladeF, 0F, 0F, 0F); fladeR = new ModelRenderer(this, 0, 0); fladeR.addBox(0F, 0F, 0F, 1, 16, 6); fladeR.setRotationPoint(-7F, 8F, -3F); fladeR.setTextureSize(64, 32); fladeR.mirror = true; setRotation(fladeR, 0F, 0F, 0F); fladeL = new ModelRenderer(this, 0, 0); fladeL.addBox(0F, 0F, 0F, 1, 16, 6); fladeL.setRotationPoint(6F, 8F, -3F); fladeL.setTextureSize(64, 32); fladeL.mirror = true; setRotation(fladeL, 0F, 0F, 0F); fladeB = new ModelRenderer(this, 0, 0); fladeB.addBox(0F, 0F, 0F, 6, 16, 1); fladeB.setRotationPoint(-3F, 8F, 6F); fladeB.setTextureSize(64, 32); fladeB.mirror = true; setRotation(fladeB, 0F, 0F, 0F); streg1 = new ModelRenderer(this, 0, 0); streg1.addBox(0F, 0F, 0F, 1, 16, 1); streg1.setRotationPoint(-6F, 8F, 3F); streg1.setTextureSize(64, 32); streg1.mirror = true; setRotation(streg1, 0F, 0F, 0F); streg2 = new ModelRenderer(this, 0, 0); streg2.addBox(0F, 0F, 0F, 1, 16, 1); streg2.setRotationPoint(-6F, 8F, -4F); streg2.setTextureSize(64, 32); streg2.mirror = true; setRotation(streg2, 0F, 0F, 0F); streg3 = new ModelRenderer(this, 0, 0); streg3.addBox(0F, 0F, 0F, 1, 16, 1); streg3.setRotationPoint(4F, 8F, -5F); streg3.setTextureSize(64, 32); streg3.mirror = true; setRotation(streg3, 0F, 0F, 0F); streg4 = new ModelRenderer(this, 0, 0); streg4.addBox(0F, 0F, 0F, 1, 16, 1); streg4.setRotationPoint(5F, 8F, -4F); streg4.setTextureSize(64, 32); streg4.mirror = true; setRotation(streg4, 0F, 0F, 0F); streg5 = new ModelRenderer(this, 0, 0); streg5.addBox(0F, 0F, 0F, 1, 16, 1); streg5.setRotationPoint(5F, 8F, 3F); streg5.setTextureSize(64, 32); streg5.mirror = true; setRotation(streg5, 0F, 0F, 0F); streg6 = new ModelRenderer(this, 0, 0); streg6.addBox(0F, 0F, 0F, 1, 16, 1); streg6.setRotationPoint(-5F, 8F, 4F); streg6.setTextureSize(64, 32); streg6.mirror = true; setRotation(streg6, 0F, 0F, 0F); streg7 = new ModelRenderer(this, 0, 0); streg7.addBox(0F, 0F, 0F, 1, 16, 1); streg7.setRotationPoint(3F, 8F, 5F); streg7.setTextureSize(64, 32); streg7.mirror = true; setRotation(streg7, 0F, 0F, 0F); streg8 = new ModelRenderer(this, 0, 0); streg8.addBox(0F, 0F, 0F, 1, 16, 1); streg8.setRotationPoint(-4F, 8F, 5F); streg8.setTextureSize(64, 32); streg8.mirror = true; setRotation(streg8, 0F, 0F, 0F); Shape9 = new ModelRenderer(this, 0, 0); Shape9.addBox(0F, 0F, 0F, 1, 16, 1); Shape9.setRotationPoint(4F, 8F, 4F); Shape9.setTextureSize(64, 32); Shape9.mirror = true; setRotation(Shape9, 0F, 0F, 0F); streg10 = new ModelRenderer(this, 0, 0); streg10.addBox(0F, 0F, 0F, 1, 16, 1); streg10.setRotationPoint(-5F, 8F, -5F); streg10.setTextureSize(64, 32); streg10.mirror = true; setRotation(streg10, 0F, 0F, 0F); streg11 = new ModelRenderer(this, 0, 0); streg11.addBox(0F, 0F, 0F, 1, 16, 1); streg11.setRotationPoint(3F, 8F, -6F); streg11.setTextureSize(64, 32); streg11.mirror = true; setRotation(streg11, 0F, 0F, 0F); streg12 = new ModelRenderer(this, 0, 0); streg12.addBox(0F, 0F, 0F, 1, 16, 1); streg12.setRotationPoint(-4F, 8F, -6F); streg12.setTextureSize(64, 32); streg12.mirror = true; setRotation(streg12, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5); fladeF.render(f5); fladeR.render(f5); fladeL.render(f5); fladeB.render(f5); streg1.render(f5); streg2.render(f5); streg3.render(f5); streg4.render(f5); streg5.render(f5); streg6.render(f5); streg7.render(f5); streg8.render(f5); Shape9.render(f5); streg10.render(f5); streg11.render(f5); streg12.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { //super.setRotationAngles(f, f1, f2, f3, f4, f5); } } Render public class RenderChimney extends Render { private ModelChimney model; private static final ResourceLocation texture = new ResourceLocation(FactoryCraft.MODID, ":Chimney.png"); public RenderChimney() { model = new ModelChimney(); shadowSize = 0.5F; } @Override public void doRender(Entity entity, double x, double y, double z, float yaw, float partialTickTime) { GL11.glPushMatrix(); GL11.glTranslatef((float) x, (float) y, (float) z); GL11.glScalef(-1F, -1F, -1F); bindEntityTexture(entity); model.render(entity, 0F, 0F, 0F, 0F, 0F, 0.0625F); GL11.glPopMatrix(); } @Override protected ResourceLocation getEntityTexture(Entity var1) { return texture; } } Author of the unreleased mod Factory Craft I'm usually known as MnomisC IGN MnomisC
April 20, 201411 yr Hi So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing. I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong. Hopefully someone else on this forum can be more specific... -TGG
April 20, 201411 yr Hi So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing. I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong. Hopefully someone else on this forum can be more specific... -TGG I don't think that's the model, because he has a couple of shapes in his model class. I had the same problem earlier and I left it alone, and after I touched some of my gui code my entity completely stopped rendering. Sorry. Kain
April 20, 201411 yr hey I am one of the two modder's in this mod i am not experienced with modding and java i am stil just learning but i can give you information Have you applied in your proxy - I don't think so :[ proxy.initRenderes() ClientProxy.java package me.FactoryCraft.FactoryCraft; import me.FactoryCraft.FactoryCraft.Entity.EntityChimney; import me.FactoryCraft.FactoryCraft.Renderer.RenderChimney; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { @Override public void initRenderes() { RenderingRegistry.registerEntityRenderingHandler(EntityChimney.class, new RenderChimney()); System.out.println("Test"); } } CommonProxy.java package me.FactoryCraft.FactoryCraft; public class CommonProxy { public void initRenderes() { } } Hi So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing. I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong. Hopefully someone else on this forum can be more specific... -TGG this is how it should look: without texture with texture
April 20, 201411 yr hey I am one of the two modder's in this mod i am not experienced with modding and java i am stil just learning but i can give you information Have you applied in your proxy - I don't think so :[ proxy.initRenderes() ClientProxy.java package me.FactoryCraft.FactoryCraft; import me.FactoryCraft.FactoryCraft.Entity.EntityChimney; import me.FactoryCraft.FactoryCraft.Renderer.RenderChimney; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { @Override public void initRenderes() { RenderingRegistry.registerEntityRenderingHandler(EntityChimney.class, new RenderChimney()); System.out.println("Test"); } } CommonProxy.java package me.FactoryCraft.FactoryCraft; public class CommonProxy { public void initRenderes() { } } Hi I think coolbody4531 is right - you have defined initRenderes(), but you never seem to call it? Something like @EventHandler public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame"); Items.init(); Entities.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.initRenderes(); } Some further background info here if you're interested http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
April 20, 201411 yr Hi I think coolbody4531 is right - you have defined initRenderes(), but you never seem to call it? Something like @EventHandler public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame"); Items.init(); Entities.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.initRenderes(); } Some further background info here if you're interested http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG Thank you it work's now we just have to make the texture work and have a hitbox..
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.