Jump to content

Enkey

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by Enkey

  1. well I tried it like that, but it said that I have to make setRenderType static, so I did, but than there was another error... But whatever it works when I reference it from the TESR And do you know why is it in hand rendering like ghost? (picture above)
  2. Thank you. That works. I just didnt know what I was supposed to do here: TheCorrespondingBlock(ModelOldWallLampRendererID); I tried to put there serveral things like the name of the block class or the variable of the block (and the method setRenderType), but it was still giving me an error. So I didnt put it there and at the getRenderType method I retruned the renderID form the renderer and it works. But now I have problem with the rendering: Its probably doing the GL_BLEND , but then the glass is not transparent renderer class: package morelights.renderers; import morelights.lib.Reference; import morelights.model.ModelOldWallLamp; import morelights.model.ModelOldWallLampFire; import morelights.model.ModelOldWallLampGlass; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class ModelOldWallLampRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{ private final ModelOldWallLamp model; private final ModelOldWallLampGlass modelGlass; private final ModelOldWallLampFire modelFire; public static int renderID; public ModelOldWallLampRenderer(int ID) { this.model = new ModelOldWallLamp(); this.modelGlass = new ModelOldWallLampGlass(); this.modelFire = new ModelOldWallLampFire(); this.renderID = ID; } @Override public int getRenderId() { return this.renderID; } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { //The PushMatrix tells the renderer to "start" doing something. GL11.glPushMatrix(); //This is setting the initial location. GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_CULL_FACE); //Use in 1.6.2 this ResourceLocation textures = (new ResourceLocation(Reference.modid + ":textures/models/ModelOldWallLamp.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again! GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); switch(te.getBlockMetadata()){ case 2: break; case 4: GL11.glRotatef(90F, 0F, 1F, 0F); break; case 5: GL11.glRotatef(270F, 0F, 1F, 0F); break; case 3: GL11.glRotatef(180F, 0F, 1F, 0F); break; default: break; } this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); this.modelFire.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.015625F); this.modelGlass.render((Entity)null, 0F, 0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPopMatrix(); } //Set the lighting stuff, so it changes it's brightness properly. private void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getBlockBrightness(world, i, j, k); int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); } @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { GL11.glPushMatrix(); GL11.glTranslatef(0F, 1.2F, 0F); GL11.glDisable(GL11.GL_CULL_FACE); ResourceLocation textures = (new ResourceLocation(Reference.modid + ":textures/models/ModelOldWallLamp.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glEnable(GL11.GL_BLEND); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); this.modelFire.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.015625F); this.modelGlass.render((Entity)null, 0F, 0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPopMatrix(); } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { return false; } @Override public boolean shouldRender3DInInventory() { return true; } }
  3. Oh thanks, now I know how to make rotation animation, but how do I make it animate in line (like the build craft engine)?
  4. I knew it will be totaly worng So how can I make the item to have the model?
  5. I tried it like this, but this dont work: renderer class: package morelights.renderers; import morelights.lib.Reference; import morelights.model.ModelOldWallLamp; import morelights.model.ModelOldWallLampFire; import morelights.model.ModelOldWallLampGlass; import morelights.proxy.ClientProxy; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class ModelOldWallLampRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{ private final ModelOldWallLamp model; private final ModelOldWallLampGlass modelGlass; private final ModelOldWallLampFire modelFire; public ModelOldWallLampRenderer() { this.model = new ModelOldWallLamp(); this.modelGlass = new ModelOldWallLampGlass(); this.modelFire = new ModelOldWallLampFire(); } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { //The PushMatrix tells the renderer to "start" doing something. GL11.glPushMatrix(); //This is setting the initial location. GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_CULL_FACE); //Use in 1.6.2 this ResourceLocation textures = (new ResourceLocation(Reference.modid + ":textures/models/ModelOldWallLamp.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again! GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); switch(te.getBlockMetadata()){ case 2: break; case 4: GL11.glRotatef(90F, 0F, 1F, 0F); break; case 5: GL11.glRotatef(270F, 0F, 1F, 0F); break; case 3: GL11.glRotatef(180F, 0F, 1F, 0F); break; default: break; } this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); this.modelFire.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.015625F); this.modelGlass.render((Entity)null, 0F, 0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPopMatrix(); } //Set the lighting stuff, so it changes it's brightness properly. private void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getBlockBrightness(world, i, j, k); int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); } @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); this.modelFire.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.015625F); this.modelGlass.render((Entity)null, 0F, 0F, -0.1F, 0.0F, 0.0F, 0.0625F); } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { return false; } @Override public boolean shouldRender3DInInventory() { return true; } @Override public int getRenderId() { return ClientProxy.oldWallLampRendererType; } } and I registered it in Client Proxy: oldWallLampRendererType = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(oldWallLampRendererType, (ISimpleBlockRenderingHandler)new ModelOldWallLampRenderer()); I am probably doing it totaly wrong, am I not?
  6. you can do this: Block block = this.getBlockType(); block.setBlockBounds(...);
  7. So I come up with this: I think its better than nothing , but it would be better if it would be animated but I dont how to do that And another question: How can I make item for this block render with the model?
  8. Is it possible to make it render through the glass?
  9. Thanks! That worked! It was on my TODO list But they don't render through the glass
  10. That did not do anything. And yea when I delete the glass I can see it:
  11. Thank you, but now I have this: I would like it to render the back side of the block and the candle inside... is it posible? How?
  12. So I made a lamp: And I would like to make the glass (the light blue thing) transparent (there is a candle behind it). Do you know how to do that? Code: Model class: package morelights.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; public class ModelOldWallLamp extends ModelBase { //fields ModelRenderer Glass1; ModelRenderer Glass2; ModelRenderer Glass3; ModelRenderer Glass4; ModelRenderer Candle; ModelRenderer Body4; ModelRenderer Body2; ModelRenderer Body3; ModelRenderer Body5; ModelRenderer Body6; ModelRenderer Body7; ModelRenderer Body8; ModelRenderer Body9; ModelRenderer Shape1; ModelRenderer Shape2; ModelRenderer Shape3; ModelRenderer Shape4; ModelRenderer Shape5; ModelRenderer Shape6; ModelRenderer Side1; ModelRenderer Side2; ModelRenderer Side3; ModelRenderer Side4; ModelRenderer Side5; ModelRenderer Side6; ModelRenderer Side7; public ModelOldWallLamp() { textureWidth = 64; textureHeight = 32; Glass1 = new ModelRenderer(this, 49, -3); Glass1.addBox(1.6F, 0F, -1.5F, 0, 6, 3); Glass1.setRotationPoint(0F, 13F, 0F); Glass1.setTextureSize(64, 32); Glass1.mirror = true; setRotation(Glass1, 0F, 0F, 0F); Glass2 = new ModelRenderer(this, 49, -3); Glass2.addBox(-1.6F, 0F, -1.5F, 0, 6, 3); Glass2.setRotationPoint(0F, 13F, 0F); Glass2.setTextureSize(64, 32); Glass2.mirror = true; setRotation(Glass2, 0F, 0F, 0F); Glass3 = new ModelRenderer(this, 49, 0); Glass3.addBox(-1.5F, 0F, -1.6F, 3, 6, 0); Glass3.setRotationPoint(0F, 13F, 0F); Glass3.setTextureSize(64, 32); Glass3.mirror = true; setRotation(Glass3, 0F, 0F, 0F); Glass4 = new ModelRenderer(this, 49, 0); Glass4.addBox(-1.5F, 0F, 1.6F, 3, 6, 0); Glass4.setRotationPoint(0F, 13F, 0F); Glass4.setTextureSize(64, 32); Glass4.mirror = true; setRotation(Glass4, 0F, 0F, 0F); Candle = new ModelRenderer(this, 45, 0); Candle.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); Candle.setRotationPoint(0F, 16F, 0F); Candle.setTextureSize(64, 32); Candle.mirror = true; setRotation(Candle, 0F, 0F, 0F); Body4 = new ModelRenderer(this, 0, 4); Body4.addBox(-2F, -1.5F, -2F, 4, 1, 4); Body4.setRotationPoint(0F, 21F, 0F); Body4.setTextureSize(64, 32); Body4.mirror = true; setRotation(Body4, 0F, 0F, 0F); Body2 = new ModelRenderer(this, 0, 0); Body2.addBox(-1F, 0.5F, -1F, 2, 1, 2); Body2.setRotationPoint(0F, 20F, 0F); Body2.setTextureSize(64, 32); Body2.mirror = true; setRotation(Body2, 0F, 0F, 0F); Body3 = new ModelRenderer(this, 8, 0); Body3.addBox(-1.5F, 0F, -1.5F, 3, 1, 3); Body3.setRotationPoint(0F, 20F, 0F); Body3.setTextureSize(64, 32); Body3.mirror = true; setRotation(Body3, 0F, 0F, 0F); Body5 = new ModelRenderer(this, 4, 9); Body5.addBox(-2.5F, 0F, -2.5F, 5, 1, 5); Body5.setRotationPoint(0F, 19F, 0F); Body5.setTextureSize(64, 32); Body5.mirror = true; setRotation(Body5, 0F, 0F, 0F); Body6 = new ModelRenderer(this, 16, 4); Body6.addBox(1.2F, 0F, -2.2F, 1, 6, 1); Body6.setRotationPoint(0F, 13F, 0F); Body6.setTextureSize(64, 32); Body6.mirror = true; setRotation(Body6, 0F, 0F, 0F); Body7 = new ModelRenderer(this, 16, 4); Body7.addBox(-2.2F, 0F, 1.2F, 1, 6, 1); Body7.setRotationPoint(0F, 13F, 0F); Body7.setTextureSize(64, 32); Body7.mirror = true; setRotation(Body7, 0F, 0F, 0F); Body8 = new ModelRenderer(this, 16, 4); Body8.addBox(-2.2F, 0F, -2.2F, 1, 6, 1); Body8.setRotationPoint(0F, 13F, 0F); Body8.setTextureSize(64, 32); Body8.mirror = true; setRotation(Body8, 0F, 0F, 0F); Body9 = new ModelRenderer(this, 16, 4); Body9.addBox(1.2F, 0F, 1.2F, 1, 6, 1); Body9.setRotationPoint(0F, 13F, 0F); Body9.setTextureSize(64, 32); Body9.mirror = true; setRotation(Body9, 0F, 0F, 0F); Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(-3F, 0.4666667F, -3F, 6, 1, 6); Shape1.setRotationPoint(0F, 12F, 0F); Shape1.setTextureSize(64, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 4, 9); Shape2.addBox(-2.5F, 0F, -2.5F, 5, 1, 5); Shape2.setRotationPoint(0F, 12F, 0F); Shape2.setTextureSize(64, 32); Shape2.mirror = true; setRotation(Shape2, 0F, 0F, 0F); Shape3 = new ModelRenderer(this, 0, 0); Shape3.addBox(-2F, 0.4F, -2F, 4, 1, 4); Shape3.setRotationPoint(0F, 11F, 0F); Shape3.setTextureSize(64, 32); Shape3.mirror = true; setRotation(Shape3, 0F, 0F, 0F); Shape4 = new ModelRenderer(this, 0, 5); Shape4.addBox(-1.5F, -0.3F, -1.5F, 3, 1, 3); Shape4.setRotationPoint(0F, 11F, 0F); Shape4.setTextureSize(64, 32); Shape4.mirror = true; setRotation(Shape4, 0F, 0F, 0F); Shape5 = new ModelRenderer(this, 0, 0); Shape5.addBox(-1F, -0.1F, -1F, 2, 1, 2); Shape5.setRotationPoint(0F, 10F, 0F); Shape5.setTextureSize(64, 32); Shape5.mirror = true; setRotation(Shape5, 0F, 0F, 0F); Shape6 = new ModelRenderer(this, 0, 0); Shape6.addBox(-0.5F, 0F, -0.5F, 1, 1, 1); Shape6.setRotationPoint(0F, 9F, 0F); Shape6.setTextureSize(64, 32); Shape6.mirror = true; setRotation(Shape6, 0F, 0F, 0F); Side1 = new ModelRenderer(this, 0, 9); Side1.addBox(-0.5F, 0F, 0.5F, 1, 1, 5); Side1.setRotationPoint(0F, 19F, 2F); Side1.setTextureSize(64, 32); Side1.mirror = true; setRotation(Side1, 0F, 0F, 0F); Side2 = new ModelRenderer(this, 12, 4); Side2.addBox(-1F, 0F, 0F, 2, 10, 1); Side2.setRotationPoint(0F, 13F, 7F); Side2.setTextureSize(64, 32); Side2.mirror = true; setRotation(Side2, 0F, 0F, 0F); Side3 = new ModelRenderer(this, 45, 5); Side3.addBox(-0.5F, 0F, -0.5F, 1, 1, 1); Side3.setRotationPoint(0F, 14F, 7F); Side3.setTextureSize(64, 32); Side3.mirror = true; setRotation(Side3, 0F, 0F, 0F); Side4 = new ModelRenderer(this, 20, 7); Side4.addBox(-0.5F, 0F, 0F, 1, 1, 1); Side4.setRotationPoint(0F, 20F, 5F); Side4.setTextureSize(64, 32); Side4.mirror = true; setRotation(Side4, 0F, 0F, 0F); Side5 = new ModelRenderer(this, 20, 10); Side5.addBox(-0.5F, 0.5F, 1F, 1, 2, 1); Side5.setRotationPoint(0F, 20F, 5F); Side5.setTextureSize(64, 32); Side5.mirror = true; setRotation(Side5, 0F, 0F, 0F); Side6 = new ModelRenderer(this, 18, 5); Side6.addBox(-0.5F, 2.5F, -1F, 1, 1, 2); Side6.setRotationPoint(0F, 20F, 5F); Side6.setTextureSize(64, 32); Side6.mirror = true; setRotation(Side6, 0F, 0F, 0F); Side7 = new ModelRenderer(this, 20, 2); Side7.addBox(-0.5F, 0.5F, 0F, 1, 1, 1); Side7.setRotationPoint(0F, 21F, 3.5F); Side7.setTextureSize(64, 32); Side7.mirror = true; setRotation(Side7, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, TileEntity tile) { Tessellator t = Tessellator.instance; t.setColorRGBA_F(1, 1, 1, 0.4F); super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Glass1.render(f5); Glass2.render(f5); Glass3.render(f5); Glass4.render(f5); Candle.render(f5); Body4.render(f5); Body2.render(f5); Body3.render(f5); Body5.render(f5); Body6.render(f5); Body7.render(f5); Body8.render(f5); Body9.render(f5); Shape1.render(f5); Shape2.render(f5); Shape3.render(f5); Shape4.render(f5); Shape5.render(f5); Shape6.render(f5); Side1.render(f5); Side2.render(f5); Side3.render(f5); Side4.render(f5); Side5.render(f5); Side6.render(f5); Side7.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, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } Model renderer class: package morelights.renderers; import morelights.lib.Reference; import morelights.model.ModelOldWallLamp; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; public class ModelOldWallLampRenderer extends TileEntitySpecialRenderer{ private final ModelOldWallLamp model; public ModelOldWallLampRenderer() { this.model = new ModelOldWallLamp(); } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { //The PushMatrix tells the renderer to "start" doing something. GL11.glPushMatrix(); //This is setting the initial location. GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); //Use in 1.6.2 this ResourceLocation textures = (new ResourceLocation(Reference.modid + ":textures/models/ModelOldWallLamp.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again! GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); //A reference to your Model file. Again, very important. this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te); //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); } //Set the lighting stuff, so it changes it's brightness properly. private void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getBlockBrightness(world, i, j, k); int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); } }
  13. I don't think you need public Icon getIcon(int par1, int par2) . You just have to put there: protected Icon getSideIcon(int i) and return the side icon in that (the parameter is metadata of subblock (if you have any)) and than you need this: protected Icon getEndIcon(int par1) where you return the top and bottom icon (the parameter is the same as before) and I think that should work
  14. Hello guys, I would like to make a block (with custom model) that will connect to itself (when they are side by side) and I tried to look for tutorials and in minecraft classes (e.g. fence), but I could not find out how do they make the model to change when connected. So if you now to which class I should look into or some good tutorials (I couldn't find any). Or you can tell me exactly how to do it if you want. Thanks for your help!
  15. Thanks, I didn't noticed that. Now it works. Additional off topic question: Sometimes Minecraft throws this error, but the game doesn't crash: 2013-11-07 20:28:23 [sEVERE] [ForgeModLoader] A TileEntity type testmod.TileEntityCustomModel has throw an exception trying to write state. It will not persist. Report this to the mod author java.lang.RuntimeException: class testmod.TileEntityCustomModel is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:108) at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:317) at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:127) at net.minecraft.world.gen.ChunkProviderServer.safeSaveChunk(ChunkProviderServer.java:232) at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:284) at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:899) at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:360) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:124) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Do I have to fix it? If so, how do I fix it?
  16. Ok so I changed the ClientProxy to extend CommonProxy and the error is a bit different: 2013-11-07 19:38:23 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue 2013-11-07 19:38:23 [sEVERE] [ForgeModLoader] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{6.4.20.916} [Forge Mod Loader] (bin) Unloaded->Constructed Forge{9.11.1.916} [Minecraft Forge] (bin) Unloaded->Constructed testmod{v0.1} [My testing mod] (bin) Unloaded->Errored 2013-11-07 19:38:23 [sEVERE] [ForgeModLoader] The following problems were captured during this phase 2013-11-07 19:38:23 [sEVERE] [ForgeModLoader] Caught exception from testmod java.lang.IllegalArgumentException: Can not set static testmod.CommonProxy field testmod.Main.proxy to testmod.Main at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) at java.lang.reflect.Field.set(Unknown Source) at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:449) at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:382) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:525) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105) at cpw.mods.fml.common.Loader.loadMods(Loader.java:509) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) at net.minecraft.client.Minecraft.startGame(Minecraft.java:472) at net.minecraft.client.Minecraft.run(Minecraft.java:807) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-11-07 19:38:23 [iNFO] [sTDOUT] ---- Minecraft Crash Report ---- 2013-11-07 19:38:23 [iNFO] [sTDOUT] // Daisy, daisy... 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] Time: 7.11.13 19:38 2013-11-07 19:38:23 [iNFO] [sTDOUT] Description: Initializing game 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] java.lang.IllegalArgumentException: Can not set static testmod.CommonProxy field testmod.Main.proxy to testmod.Main 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Field.set(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:449) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:382) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:525) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.Loader.loadMods(Loader.java:509) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.startGame(Minecraft.java:472) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:807) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows: 2013-11-07 19:38:23 [iNFO] [sTDOUT] --------------------------------------------------------------------------------------- 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] -- Head -- 2013-11-07 19:38:23 [iNFO] [sTDOUT] Stacktrace: 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Field.set(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:449) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:382) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:525) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.common.Loader.loadMods(Loader.java:509) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.startGame(Minecraft.java:472) 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] -- Initialization -- 2013-11-07 19:38:23 [iNFO] [sTDOUT] Details: 2013-11-07 19:38:23 [iNFO] [sTDOUT] Stacktrace: 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:807) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2013-11-07 19:38:23 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-11-07 19:38:23 [iNFO] [sTDOUT] 2013-11-07 19:38:23 [iNFO] [sTDOUT] -- System Details -- 2013-11-07 19:38:23 [iNFO] [sTDOUT] Details: 2013-11-07 19:38:23 [iNFO] [sTDOUT] Minecraft Version: 1.6.4 2013-11-07 19:38:23 [iNFO] [sTDOUT] Operating System: Windows 7 (amd64) version 6.1 2013-11-07 19:38:23 [iNFO] [sTDOUT] Java Version: 1.7.0_45, Oracle Corporation 2013-11-07 19:38:23 [iNFO] [sTDOUT] Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation 2013-11-07 19:38:23 [iNFO] [sTDOUT] Memory: 775128504 bytes (739 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) 2013-11-07 19:38:23 [iNFO] [sTDOUT] JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M 2013-11-07 19:38:23 [iNFO] [sTDOUT] AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used 2013-11-07 19:38:23 [iNFO] [sTDOUT] Suspicious classes: FML and Forge are installed 2013-11-07 19:38:23 [iNFO] [sTDOUT] IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 2013-11-07 19:38:23 [iNFO] [sTDOUT] FML: MCP v8.11 FML v6.4.20.916 Minecraft Forge 9.11.1.916 4 mods loaded, 4 mods active 2013-11-07 19:38:23 [iNFO] [sTDOUT] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed 2013-11-07 19:38:23 [iNFO] [sTDOUT] FML{6.4.20.916} [Forge Mod Loader] (bin) Unloaded->Constructed 2013-11-07 19:38:23 [iNFO] [sTDOUT] Forge{9.11.1.916} [Minecraft Forge] (bin) Unloaded->Constructed 2013-11-07 19:38:23 [iNFO] [sTDOUT] testmod{v0.1} [My testing mod] (bin) Unloaded->Errored 2013-11-07 19:38:23 [iNFO] [sTDOUT] Launched Version: 1.6 2013-11-07 19:38:23 [iNFO] [sTDOUT] LWJGL: 2.9.0 2013-11-07 19:38:23 [iNFO] [sTDOUT] OpenGL: AMD Radeon HD 5800 Series GL version 4.2.12422 Compatibility Profile Context 13.152.0.0, ATI Technologies Inc. 2013-11-07 19:38:23 [iNFO] [sTDOUT] Is Modded: Definitely; Client brand changed to 'fml,forge' 2013-11-07 19:38:23 [iNFO] [sTDOUT] Type: Client (map_client.txt) 2013-11-07 19:38:23 [iNFO] [sTDOUT] Resource Pack: Default 2013-11-07 19:38:23 [iNFO] [sTDOUT] Current Language: English (US) 2013-11-07 19:38:23 [iNFO] [sTDOUT] Profiler Position: N/A (disabled) 2013-11-07 19:38:23 [iNFO] [sTDOUT] Vec3 Pool Size: ~~ERROR~~ NullPointerException: null 2013-11-07 19:38:23 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Martin\Desktop\modding\forge\mcp\jars\.\crash-reports\crash-2013-11-07_19.38.23-client.txt And here is the Main class: package testmod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import testmod.client.ClientProxy; @Mod(modid = Main.modid, name = "My testing mod", version = "v0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Main { @Instance(value = Main.modid) @SidedProxy(clientSide = "testmod.client.ClientProxy", serverSide = "testmod.CommonProxy") public static CommonProxy proxy; public static final String modid = "testmod"; //BLOCKS public static Block testBlock; public static Block specialBlock; public static Block replaceableBlock; public static Block ladderBlock; public static Block dirBlock; public static Block blockTE; public static Block blockDirWTileEntity; public static Block blockCustomModel; //ITEMS public static Item testItem; @EventHandler public void load(FMLInitializationEvent event){ //CREATING BLOCKS testBlock = new ModBlock(600, Material.rock, "testBlock") .setUnlocalizedName("testBlock") .setCreativeTab(CreativeTabs.tabBlock) .setHardness(1.5F) .setResistance(5.0F) .setLightValue(1.0F) .setStepSound(Block.soundMetalFootstep); specialBlock = new SpecialBlock(601, Material.glass, "specialBlock") .setUnlocalizedName("specialBlock") .setCreativeTab(CreativeTabs.tabBlock) .setHardness(1.5F) .setResistance(5.0F) .setStepSound(Block.soundGlassFootstep); replaceableBlock = new RplcBlock(602, Material.rock, "testBlock1") .setUnlocalizedName("replaceableBlock") .setCreativeTab(CreativeTabs.tabBlock) .setHardness(1.5F) .setResistance(5.0F) .setStepSound(Block.soundStoneFootstep); ladderBlock = new LadderBlock(603, Material.wood, "testBlock1") .setUnlocalizedName("replaceableBlock") .setCreativeTab(CreativeTabs.tabBlock) .setHardness(1.5F) .setResistance(5.0F) .setStepSound(Block.soundStoneFootstep); dirBlock = new BlockDirTest(604, Material.wood) .setUnlocalizedName("dirBlock") .setCreativeTab(CreativeTabs.tabBlock) .setHardness(0.5F) .setResistance(3.0F) .setStepSound(Block.soundWoodFootstep); blockTE = new BlockTE(605) .setUnlocalizedName("blockTE") .setCreativeTab(CreativeTabs.tabDecorations) .setHardness(0.5F) .setResistance(3.0F) .setStepSound(Block.soundStoneFootstep); blockDirWTileEntity = new BlockDirWTileEntity(606) .setUnlocalizedName("blockWOTE") .setCreativeTab(CreativeTabs.tabDecorations) .setHardness(0.5F) .setResistance(3.0F) .setStepSound(Block.soundStoneFootstep); blockCustomModel = new BlockCustomModel(607) .setUnlocalizedName("blockCustomModel") .setCreativeTab(CreativeTabs.tabBlock); //CREATING ITEMS testItem = new ModItem(650,"testItem") .setUnlocalizedName("testItem") .setCreativeTab(CreativeTabs.tabMisc) .setMaxStackSize(32); //SHAPELESS CRAFTING RECIPES GameRegistry.addShapelessRecipe(new ItemStack(testBlock), new Object[]{ new ItemStack(Item.dyePowder,1,4), new ItemStack(Item.dyePowder,1,0), new ItemStack(Item.dyePowder,1,15) }); //SHAPED CRAFTING RECIPES GameRegistry.addShapedRecipe(new ItemStack(ladderBlock,, new Object[]{ "X X", "XXX", "X X", 'X',testBlock }); //SMELTING RECIPES FurnaceRecipes.smelting().addSmelting(testItem.itemID, new ItemStack(ladderBlock,4), 200.0F); //ENCHANTED CRAFTING (doesn´t work) ItemStack enchSign = new ItemStack(Item.sign); enchSign.addEnchantment(Enchantment.knockback, 127); GameRegistry.addShapelessRecipe(enchSign, new Object[]{ new ItemStack(Block.stone,2) }); //GAME REGISTERY GameRegistry.registerBlock(dirBlock, ItemBlockDirTest.class, modid + (dirBlock.getUnlocalizedName().substring(5))); GameRegistry.registerBlock(testBlock, ItemTestBlock.class, modid + (testBlock.getUnlocalizedName().substring(5))); GameRegistry.registerBlock(specialBlock); GameRegistry.registerBlock(replaceableBlock); GameRegistry.registerBlock(ladderBlock); GameRegistry.registerBlock(blockTE); GameRegistry.registerBlock(blockDirWTileEntity); GameRegistry.registerBlock(blockCustomModel); //LANGUAGE REGISTRY LanguageRegistry.addName(new ItemStack(testBlock,1,0), "Test Block"); LanguageRegistry.addName(new ItemStack(testBlock,1,1), "Test Block1"); LanguageRegistry.addName(new ItemStack(testBlock,1,2), "Test Block2"); LanguageRegistry.addName(new ItemStack(testBlock,1,3), "Test Block3"); LanguageRegistry.addName(specialBlock, "Special Block"); LanguageRegistry.addName(replaceableBlock, "Replaceable Block"); LanguageRegistry.addName(ladderBlock, "Ladder Block"); LanguageRegistry.addName(testItem, "Test Item"); LanguageRegistry.addName(new ItemStack(dirBlock,1,0), "Directional Testing Block 1"); LanguageRegistry.addName(new ItemStack(dirBlock,1,1), "Directional Testing Block 2"); LanguageRegistry.addName(blockTE, "Block with Tile Entity"); LanguageRegistry.addName(blockDirWTileEntity, "Directional Test With Bounds"); LanguageRegistry.addName(blockCustomModel, "Custom Model Block"); } @EventHandler public void PostInit(FMLPostInitializationEvent event){ proxy.registerRenderers(); } }
  17. Hello, I was implementing Client and Common proxies into my base files, but I am getting this error when I start the minecraft The full crash: 2013-11-07 18:10:51 [sEVERE] [ForgeModLoader] Attempted to load a proxy type testmod.client.ClientProxy into testmod.Main.proxy, but the types don't match 2013-11-07 18:10:51 [sEVERE] [ForgeModLoader] An error occured trying to load a proxy into {clientSide=testmod.client.ClientProxy, serverSide=testmod.CommonProxy}.testmod.Main cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:68) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:524) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105) at cpw.mods.fml.common.Loader.loadMods(Loader.java:509) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) at net.minecraft.client.Minecraft.startGame(Minecraft.java:472) at net.minecraft.client.Minecraft.run(Minecraft.java:807) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-11-07 18:10:51 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue 2013-11-07 18:10:51 [sEVERE] [ForgeModLoader] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{6.4.20.916} [Forge Mod Loader] (bin) Unloaded->Constructed Forge{9.11.1.916} [Minecraft Forge] (bin) Unloaded->Constructed testmod{v0.1} [My testing mod] (bin) Unloaded->Errored 2013-11-07 18:10:51 [sEVERE] [ForgeModLoader] The following problems were captured during this phase 2013-11-07 18:10:51 [sEVERE] [ForgeModLoader] Caught exception from testmod cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:75) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:524) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105) at cpw.mods.fml.common.Loader.loadMods(Loader.java:509) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) at net.minecraft.client.Minecraft.startGame(Minecraft.java:472) at net.minecraft.client.Minecraft.run(Minecraft.java:807) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:68) ... 33 more 2013-11-07 18:10:51 [iNFO] [sTDOUT] ---- Minecraft Crash Report ---- 2013-11-07 18:10:51 [iNFO] [sTDOUT] // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] 2013-11-07 18:10:51 [iNFO] [sTDOUT] 2013-11-07 18:10:51 [iNFO] [sTDOUT] Time: 7.11.13 18:10 2013-11-07 18:10:51 [iNFO] [sTDOUT] Description: There was a severe problem during mod loading that has caused the game to fail 2013-11-07 18:10:51 [iNFO] [sTDOUT] 2013-11-07 18:10:51 [iNFO] [sTDOUT] cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:75) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:524) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.Loader.loadMods(Loader.java:509) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.startGame(Minecraft.java:472) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:807) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2013-11-07 18:10:51 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-11-07 18:10:51 [iNFO] [sTDOUT] Caused by: cpw.mods.fml.common.LoaderException 2013-11-07 18:10:51 [iNFO] [sTDOUT] at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:68) 2013-11-07 18:10:51 [iNFO] [sTDOUT] ... 33 more 2013-11-07 18:10:51 [iNFO] [sTDOUT] 2013-11-07 18:10:51 [iNFO] [sTDOUT] 2013-11-07 18:10:51 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows: 2013-11-07 18:10:51 [iNFO] [sTDOUT] --------------------------------------------------------------------------------------- 2013-11-07 18:10:51 [iNFO] [sTDOUT] 2013-11-07 18:10:51 [iNFO] [sTDOUT] -- System Details -- 2013-11-07 18:10:51 [iNFO] [sTDOUT] Details: 2013-11-07 18:10:51 [iNFO] [sTDOUT] Minecraft Version: 1.6.4 2013-11-07 18:10:51 [iNFO] [sTDOUT] Operating System: Windows 7 (amd64) version 6.1 2013-11-07 18:10:51 [iNFO] [sTDOUT] Java Version: 1.7.0_45, Oracle Corporation 2013-11-07 18:10:51 [iNFO] [sTDOUT] Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation 2013-11-07 18:10:51 [iNFO] [sTDOUT] Memory: 774324816 bytes (738 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) 2013-11-07 18:10:51 [iNFO] [sTDOUT] JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M 2013-11-07 18:10:51 [iNFO] [sTDOUT] AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used 2013-11-07 18:10:51 [iNFO] [sTDOUT] Suspicious classes: FML and Forge are installed 2013-11-07 18:10:51 [iNFO] [sTDOUT] IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 2013-11-07 18:10:51 [iNFO] [sTDOUT] FML: MCP v8.11 FML v6.4.20.916 Minecraft Forge 9.11.1.916 4 mods loaded, 4 mods active 2013-11-07 18:10:51 [iNFO] [sTDOUT] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed 2013-11-07 18:10:51 [iNFO] [sTDOUT] FML{6.4.20.916} [Forge Mod Loader] (bin) Unloaded->Constructed 2013-11-07 18:10:51 [iNFO] [sTDOUT] Forge{9.11.1.916} [Minecraft Forge] (bin) Unloaded->Constructed 2013-11-07 18:10:51 [iNFO] [sTDOUT] testmod{v0.1} [My testing mod] (bin) Unloaded->Errored 2013-11-07 18:10:51 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Martin\Desktop\modding\forge\mcp\jars\.\crash-reports\crash-2013-11-07_18.10.51-client.txt My Common and Client classes are like this: testmod.CommonProxy testmod.client.ClientProxy And my annotation in my Main class is: @SidedProxy(clientSide = "testmod.client.ClientProxy", serverSide = "testmod.CommonProxy")
  18. Yay! It works! I just changed this string: "mods:testmod/textures/blocks/TestingModel.png" to this: "testmod:/textures/blocks/TestingModel.png" and added this: Minecraft.getMinecraft().renderEngine.bindTexture(textures); And why do I need the proxies? Cuz it works without them. And how do I make the model render as an item in inventory?
  19. Ok gonna take a look at it when I finish learning to school
  20. I probably deleted that by mistake when I was copiing the class. Oh... ok. Now it works... kinda... It just randomly switches random textures... EDIT: I have noticed that I haven't changed the path to the texture from roads to testmod(my modid) at : ResourceLocation forge = (new ResourceLocation("mods:roads/textures/blocks/TestingModel.png")); , but that doesn't fixed it.
  21. I wanted to make a custom model for block so I made it with this tutorial http://www.minecraftforge.net/wiki/Rendering_a_Techne_Model_as_a_Block, but it's not rendering Classes: Block class: package testmod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class BlockCustomModel extends BlockContainer{ protected BlockCustomModel(int par1) { super(par1, Material.rock); } @Override public TileEntity createNewTileEntity(World world) { return new TileEntityCustomModel(); } public int getRenderType(){ return -1; } public boolean isOpaqueCube(){ return false; } public boolean renderAsNormalBlock(){ return false; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister icon){ this.blockIcon = icon.registerIcon(Main.modid + ":" + this.getUnlocalizedName().substring(5)); } } Tile entity class: package testmod; import net.minecraft.tileentity.TileEntity; public class TileEntityCustomModel extends { } Tile Entity Renderer class: package testmod; import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TileEntityCustomModelRenderer extends TileEntitySpecialRenderer { private final TestingModel model; public TileEntityCustomModelRenderer() { this.model = new TestingModel(); } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { //The PushMatrix tells the renderer to "start" doing something. GL11.glPushMatrix(); //This is setting the initial location. GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); //Use in 1.6.2 this ResourceLocation forge = (new ResourceLocation("mods:roads/textures/blocks/TestingModel.png")); //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again! GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); //A reference to your Model file. Again, very important. this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); } //Set the lighting stuff, so it changes it's brightness properly. private void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getBlockBrightness(world, i, j, k); int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); } } Model class (exported from techne): package testmod; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class TestingModel extends ModelBase { //fields ModelRenderer Shape1; ModelRenderer Shape2; ModelRenderer Shape3; ModelRenderer Shape4; public TestingModel() { textureWidth = 64; textureHeight = 64; Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 4, 5, 4); Shape1.setRotationPoint(0F, 0F, 0F); Shape1.setTextureSize(64, 64); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 0, 0); Shape2.addBox(0F, 0F, -5F, 4, 5, 4); Shape2.setRotationPoint(0F, 0F, 0F); Shape2.setTextureSize(64, 64); Shape2.mirror = true; setRotation(Shape2, 0F, 0F, 0F); Shape3 = new ModelRenderer(this, 0, 0); Shape3.addBox(-5F, 0F, 0F, 4, 5, 4); Shape3.setRotationPoint(0F, 0F, 0F); Shape3.setTextureSize(64, 64); Shape3.mirror = true; setRotation(Shape3, 0F, 0F, 0F); Shape4 = new ModelRenderer(this, 0, 0); Shape4.addBox(-5F, 0F, -5F, 4, 5, 4); Shape4.setRotationPoint(0F, 0F, 0F); Shape4.setTextureSize(64, 64); Shape4.mirror = true; setRotation(Shape4, 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, entity); Shape1.render(f5); Shape2.render(f5); Shape3.render(f5); Shape4.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, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } Any help?
  22. Now... How do I change the block bounds for item (or the look of the item in inventory)? I have found public void setBlockBoundsForItemRender() {} , but I don't know how to use it.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.