Posted June 11, 20178 yr Video demonstration of the problem: https://www.youtube.com/watch?time_continue=14&v=f7BUdXHRMqQ Github repo I've tried a bunch of stuff to resolve this issue, and check what getSlot and slotClick returns, and they seem fine (if i click on a dirt block in my container both of them return that the itemstack contains dirt) But after those functions get called it grabs from ContainerPlayers inventorySlots, and there the first 9 slots are for armor and crafting, and I'm clueless to the flow and why this is happening. Container class Proxy
June 11, 20178 yr What version of Forge are you using? (I looked at your main repo and I'm guessing 1.11.2) the inventory class used for players PlayerInventory has sub lists inside it "mainInventory", "offHandInventory", and "armorInventory". Try pulling from mainInventory. Now I haven't worked with the Slot class for a bit, so I'm not sure if the constructor would accept that, if that's the case you will have to create an offset of the index so it skips past the armor indexes Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
June 11, 20178 yr Author Yeah an offset was what I was thinking as well but I don't know where to apply it since I don't know which function uses the inventoryslots in ContainerPlayer. I've used breakpoints in most of the functions in the Container class but came up empty handed. Thank you for your input.
June 11, 20178 yr https://github.com/xt9/DeepMobLearner/blob/master/src/main/java/xt9/deepmoblearning/common/items/ItemDeepLearner.java#L24 No, you must open a container on both the server and the client. Opening it on the client only leads to all kinds of bugs including the one you are experiencing. How would a container be opened on client only if the server needs to know about inventory changes? Remove the isRemote check and everything will work fine. Edited June 11, 20178 yr by V0idWa1k3r
June 11, 20178 yr Author Wow, how did that get in there, I'm amazed I didn't catch that. Thanks a bunch.
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.