Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. "Should not be" is not "is not"
  2. What is the code at that line? That's why I said "Look at the ItemStack constructor"
  3. 1) Check to make sure that the block / item is not null when you pass it to the itemstack constructor. 2) Look at the ItemStack constructor at the line the crash report indicates to figure out what object might be null.
  4. That is actually irrelevant.
  5. Make sure. Also take a look at ItemStack.java to see what's going on there.
  6. Is TMBlocks.essentiaContainer non-null?
  7. A friend of mine runs a server with over 230 mods.
  8. There are in fact, two functions. onBlockAddedToWorld and onBlockPlacedBy If I am remembering the full names correctly. The first one will fire any time any block "becomes" your block (pushed by a piston, placed by endermen, added in worldgen, etc) the other is only when the player directly places it from their inventory (and which player is passed).
  9. And which func would that be?
  10. Looks like you didn't run either gradel setupDevWorkspace (sp?) or gradel eclipse
  11. You should set defaults in your config, yes. Forge handles a lot of that for you with its Configuration class, as it requires a default value, but you don't have to worry about file IO yourself.
  12. http://ichun.us/mods/morph/ IIRC, it's open source. What you're trying to do, btw, is non-trivial.
  13. http://mcpold.ocean-labs.de/index.php/MCPBot
  14. Dude, that's not the problem. net.minecraftforge.client.model.ModelFormatException: IO Exception reading model format
  15. My entire post on it WAS a tutorial. It's that freaking simple. Or see below. Yes, that's right. And yes, you do.
  16. itemEnt.rotationYaw = 0; That value is randomized when item entities are instanciated.
  17. Did you set up your @NetworkMod annotation?
  18. I think your packet channel is too long. I think its limited to 16 characters.
  19. Client/server disparity probably.
  20. That was the rotation of the block itself. It's based on metadata. Also, you will need to set the entity's age to 0 every frame or it will self-rotate like any other dropped item.
  21. Here's how I do mine: TileEntitySpecialRenderer render = new PedestalRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayPedestal.class, render); MinecraftForgeClient.registerItemRenderer(BlockPedestal.instance.blockID, new ItemRenderPedestal(render, new TileEntityDisplayPedestal())); public class ItemRenderPedestal implements IItemRenderer { TileEntitySpecialRenderer render; private TileEntity dummytile; public ItemRenderPedestal(TileEntitySpecialRenderer render, TileEntity dummy) { this.render = render; this.dummytile = dummy; } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (type == IItemRenderer.ItemRenderType.ENTITY) GL11.glTranslatef(-0.5F, 0.0F, -0.5F); this.render.renderTileEntityAt(this.dummytile, 0.0D, 0.0D, 0.0D, 0.0F); } } }
  22. Make an EntityItem of the item you want to display and then render it. I put this in my model class, because of rendering order, but you can put it in the render class as well. if(es.itemEnt != null) { GL11.glPushMatrix(); double angle = Math.toRadians(es.rotation); float sin = (float)(Math.sin(angle)); float cos = (float)(Math.cos(angle)); sin = Math.round(sin*100)/100; cos = Math.round(cos*100)/100; GL11.glTranslatef((float)x + 0.5F + (float)(sin*0.25), (float)y + 0.76F, (float)z + 0.5F - (float)(cos*0.25)); GL11.glRotatef(-1*es.rotation, 0, 1, 0); GL11.glRotatef(90, 1, 0, 0); RenderManager.instance.renderEntityWithPosYaw(es.itemEnt, 0, 0, 0, 0, 0); GL11.glPopMatrix(); } The rotation math was because the (2D) item was laying flat on the top of the TE.
  23. Easier to maintain. You don't need to recompile to make changes.
  24. http://www.minecraftforge.net/wiki/Packet_Handling http://www.minecraftforge.net/wiki/Advanced_Packet_Handling
×
×
  • Create New...

Important Information

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