Jump to content

Choonster

Moderators
  • Posts

    5141
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. Block#createTileEntity is only called if Block#hasTileEntity returns true . Upload your latest FML log and Block , Container and GuiContainer classes to Gist with syntax highlighting and link them here.
  2. Can you use events or reflection to modify these values?
  3. I don't know. You may be able to subscribe to and cancel RenderPlayerEvent.Pre and handle the player rendering yourself, but that may conflict with other mods that do the same thing. You may also be able to use the Render Player API mod to handle your animations.
  4. The Item argument is the item to render the entity as and the RenderItem argument is Minecraft's RenderItem instance (coolAlias showed how to get this in post #4).
  5. Runtime patching with ASM (what coremods do) is different to (and a lot harder than) compiling your code with MCP and dropping the modified classes into the Minecraft JAR. You'll need to have a solid understand of the Java bytecode format and the ASM library to make a coremod, neither of which you're likely to learn here or in Forge tutorials. You'll need to find your own resources.
  6. coolAlias has a tutorial on a backpack-like item here. If you're using 1.8.9, you may want to check out the capability system and IItemHandler / CapabilityItemHandler . You should be able to use these to store an inventory in an item without having to read from and write to NBT every time you want to access it.
  7. The question doesn't make any sense, you can't cast between unrelated types. An Item is a type of item, an ItemStack is a stack of an item. A TileEntity is linked to a block in the world. A TileEntity can store ItemStack s in it, but these ItemStack s don't know anything about where they're being stored. What is it you're trying to achieve?
  8. The IInventory you passed to the Slot constructor is null . I suspect this is because you haven't overridden Block#hasTileEntity to return true , so your TileEntity isn't being created.
  9. Forge recently added an animation system for models. You can see an example of it here (assets).
  10. setupDecompWorkspace gives you the source, setupDevWorkspace doesn't.
  11. So it's definitely still throwing a NullPointerException on line 654 of NetHandlerPlayServer ? Does this happen directly after resuming from the breakpoint on this line when none of the values are null ?
  12. There are doc comments in the Forge/Minecraft code, but I don't think Forge actually compiles Javadoc pages. If you've set up your workspace properly, you should be able to view this code from your IDE.
  13. I don't understand what you mean, sorry. The only values that could cause this crash are this.playerEntity , this.playerEntity.openContainer , slot and this.playerEntity.inventory . Which of these is null ?
  14. I'm not familiar with Eclipse's debugger. Does it not show the values of all current variables somewhere? Does it tell you the value of a variable if you mouseover it? IntelliJ IDEA's debugger looks like this:
  15. I explained how to do this here.
  16. You installed a client-only mod (Resource Loader) on the server.
  17. World#spawnParticle calls IWorldAccess#spawnParticle for every registered IWorldAccess . RenderGlobal (the client-side IWorldAccess ) spawns a particle in its implementation of this method, WorldManager (the server-side IWorldAccess ) does nothing. WorldServer#func_147487_a(String particleName, double x, double y, double z, int numParticles, double displacementX, double displacementY, double displacementZ, double velocity) sends a packet from the server to the clients of the players within 256 blocks of the specified position telling them to spawn particles there. Look at RenderGlobal#doSpawnParticle to see which particle names you can use. Use your IDE to find usages of these methods to see how they're used.
  18. I can't help you much with models or animation myself, but Forge recently added an animation system for models. You can see an example of it here (assets).
  19. That's the crash report rather than the FML log, but it does reveal the issue. The EAQ has a bullet point for this crash, the solution is to lower your view distance.
  20. Like LexManos said, post the FML log. Even the EAQ (which you're supposed to read before posting) tells you to do this. The log will tell us what's actually happening, we can't do much more than guess without it.
  21. Put a breakpoint on the line that the exception is thrown from (line 654 of NetHandlerPlayServer ) and run Minecraft in debug mode. When the breakpoint is hit, look at what's null and having a method called on it or a field access from it.
  22. You need to AND the position index with 2 before you look it up in the values array.
  23. Override Item#onEntityItemUpdate . This is called once per tick by every EntityItem containing an ItemStack of your Item . In your override of this method, check that the entity is on the ground (its onGround field is true ), the block at the entity's position isn't fire and fire can be placed at the entity's position ( Block#canPlaceBlockAt returned true ). If this condition is met, set the block at the entity's position to fire. In 1.7.10, use World#getBlock and World#setBlock to get and set the Block at the specified position. Use the posX , posY and posZ fields of Entity to get an entity's position and MathHelper.floor_double to convert them to integers. In 1.8.x, use World#getBlockState and World#setBlockState to get and set the IBlockState at the specified position. Use IBlockState#getBlock to get the state's Block . Use the BlockPos(Entity) constructor to get an entity's position as a BlockPos .
  24. Call EntityPlayer#setItemInUse from Item#onItemRightClick like ItemBow does.
×
×
  • Create New...

Important Information

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