Jump to content

TheJavaNoob

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by TheJavaNoob

  1. I wanted to create a List in GuiScreen, but I've got problem captureing the event. The component class extends Gui.
  2. So, the last problem is solved, but I got a new problem. When I start the game, The sticks on the first block I placed down renders correctly, but when I placed down the second block, nothing showed up. According to the debugging, the tileentity argument passed to my renderTileEntity was not right.
  3. Thanks you guys, this finally worked. Really appreciates it!
  4. Generics, I know that. Maybe I got used to how they call them in Chinese. I'm working in 1.8, so I can't use it whatsoever. I finally found out where the problem is. There is nothing wrong with the rendering, when I removed the if statement, the Item renders properly(but not correctly) now.
  5. I am using Minecraft 1.8. And when I said the thing about language, I meant I don't actually speak English. Still, I don't know what "generics for TESR" is. Is it a method or a class or anything else?
  6. OK, I finally understood what this meant(English is not my first language, don't judge me). So you said I need to use generics for TESR, I don't know what that is. Also, whenever I click the block, the onBlockActivated method are called for multiple times, it(seems like) didn't happen when I does this earlier. This is my onBlockActivated method: Keeping track of my new rendering code: BTW, I registered the rendering code in the BlockRenderRegister which is called in the preInit in the ClientProxy(When I was typing this in, I suddenly discovered that I forgot to call the BlockRenderRegister.)
  7. public class TileEntityRenderTowerFrame extends TileEntitySpecialRenderer { @Override public void renderTileEntityAt(TileEntity tileentity, double posX, double posY, double posZ, float unknown, int destroyStage) { GlStateManager.pushMatrix(); if(((TileEntityTowerFrame)tileentity).south!=0){ Minecraft.getMinecraft().getRenderItem().renderItemModel(new ItemStack(ModItems.iron_stick)); if(((TileEntityTowerFrame)tileentity).south==2){ Minecraft.getMinecraft().getRenderItem().renderItemModel(new ItemStack(ModItems.iron_stick)); GlStateManager.rotate(270.0F, 0.0F, 0.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.translate((float)posX, (float)posY + 1.0F, (float)posZ + 1.0F); } } GlStateManager.popMatrix(); } } Here is my new code, I translated the item to where the block is. ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTowerFrame.class, new TileEntityRenderTowerFrame()); This is where I registered my TileEntitySpecialRenderer .And also, you said I need to use an iBakedModel, can you tell me how I can do that.
  8. Also, I am trying to render an Item onto the block, but it isn't showing up, this is my rendering code(Note: tileentity.south is the defines how many items there are on the south side of a block): public class TileEntityRenderTowerFrame extends TileEntitySpecialRenderer { @Override public void renderTileEntityAt(TileEntity tileentity, double posX, double posY, double posZ, float unknown, int blockBreakingProccess) { GlStateManager.pushMatrix(); if(((TileEntityTowerFrame)tileentity).south!=0){ Minecraft.getMinecraft().getRenderItem().renderItemModel(new ItemStack(ModItems.iron_stick)); if(((TileEntityTowerFrame)tileentity).south==2){ GlStateManager.rotate(270.0F, 0.0F, 0.0F, 1.0F); Minecraft.getMinecraft().getRenderItem().renderItemModel(new ItemStack(ModItems.iron_stick)); } } GlStateManager.popMatrix(); } }
  9. I tried to render Items onto a block, but when I start Minecraft, it shows these error message: [17:29:41] [Client thread/ERROR] [FML]: Model definition for location instanttransport:tower_frame#inventory not found [17:29:41] [Client thread/ERROR] [FML]: Model definition for location instanttransport:tower_frame#normal not found Do I need to do anything else to avoid this, or maybe something has just gone wrong
  10. So how exactly do I do this. Also, the item is rendering under my feet, I don't know how can I deal with that.
  11. public void doRender(TileEntityTestBlock entity,double posX, double posZ, double posY, float useless, int iDontKnowWhatsThis) { int facing; ModelTestBlock mdr=new ModelTestBlock(); if (!entity.hasWorldObj()) { facing = 0; } else { Block block = entity.getBlockType(); facing = entity.getBlockMetadata(); if (block instanceof TestBlock && facing == 0) { facing = entity.getBlockMetadata(); } } this.bindTexture(texture); GlStateManager.pushMatrix(); GlStateManager.enableRescaleNormal(); if (iDontKnowWhatsThis < 0) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); } GlStateManager.translate((float)posX, (float)posZ, (float)posY + 1.0F); GlStateManager.scale(1.0F, -1.0F, -1.0F); GlStateManager.translate(0.5F, 0.5F, 0.5F); short rotation = 0; if (facing == 2) { rotation = 180; } if (facing == 3) { rotation = 0; } if (facing == 4) { rotation = 90; } if (facing == 5) { rotation = -90; } GlStateManager.rotate((float)rotation, 0.0F, 1.0F, 0.0F); GlStateManager.translate(-0.5F, -0.5F, -0.5F); float f1 = entity.caseAngle*9.0F; // f1 = 1.0F - f1; // f1 = 1.0F - f1 * f1 * f1; mdr.rechargerCase.rotateAngleY = f1; mdr.renderAll(); GlStateManager.popMatrix(); // if (iDontKnowWhatsThis >= 0) // { // GlStateManager.matrixMode(5890); // GlStateManager.popMatrix(); // GlStateManager.matrixMode(5888); // } if(entity.getStackInSlot(0)!=null){ //Render the item GlStateManager.pushMatrix(); Minecraft.getMinecraft().getRenderItem().renderItemModel(entity.getStackInSlot(0)); GlStateManager.disableRescaleNormal(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.rotate(90.0F, 90.0F, 0.0F, 0.0F); GlStateManager.translate((float)posX, (float)posZ, (float)posY + 1.0F); GlStateManager.popMatrix(); } Mostly copied from chest renderer, no model files attached.
  12. The problem is that I am using a TESR to render but it still shows there error messages: [15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=north not found [15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=south not found [15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=west not found [15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=east not found
  13. I have been (of course) messing around with the chest code, tried to render it with TESR. Who can help me with the rendering part?
×
×
  • Create New...

Important Information

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