Posted November 28, 201410 yr I am attempting to add an inventory (and Gui) to an entity of mine. The Gui works wonderfully except, I can't put any items into it. The items just disappear. Any help is appreciated! Entity: https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src%2Fmain%2Fjava%2Fcom%2Faustinv11%2Fperipheralsplusplus%2Fentities%2FEntityRocket.java Gui: https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src%2Fmain%2Fjava%2Fcom%2Faustinv11%2Fperipheralsplusplus%2Fclient%2Fgui%2FGuiRocket.java Container: https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src%2Fmain%2Fjava%2Fcom%2Faustinv11%2Fperipheralsplusplus%2Ftiles%2Fcontainers%2FContainerRocket.java
December 1, 201410 yr Author EntityRocket inherits it from EntityInventory: https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src%2Fmain%2Fjava%2Fcom%2Faustinv11%2Fperipheralsplusplus%2Fentities%2FEntityInventory.java
December 3, 201410 yr Where do you open your inventory? make sure to do that on server (!world.isRemote)
December 3, 201410 yr Author I open it here https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src%2Fmain%2Fjava%2Fcom%2Faustinv11%2Fperipheralsplusplus%2Fentities%2FEntityRocket.java#L68
December 5, 201410 yr the parameter where u have this.getEntityId() is supposed to be the x coord, isnt it?
December 6, 201410 yr Author Yes but it's a completely arbitrary parameter, so I used it as the entity id instead.
December 6, 201410 yr I aint sure about that, but I think the code works like it opens the GUI and the container and connects a TileEntity or inventory or something at the given location to it. So use x,y,z and dont use Math.ceil but Math.floor
December 6, 201410 yr Ok, thanks to Intellij IDEA's awesome static code analysis I found this: https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src/main/java/com/austinv11/peripheralsplusplus/entities/EntityInventory.java#L58 Look very closely. That line is very much broken. HAHAHA! That's a great line. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 6, 201410 yr Author Unbelievable. Thanks so much! I honestly don't understand how I messed that up.
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.