Posted June 5, 20187 yr Hello, I have a problem on my code : When i want to open the inventory of my machine, my game crash and here is what the crash report says : https://pastebin.com/LCm2HFEH It seems that the slots on my container is crashing my game. Here's my container code : https://pastebin.com/QVwF0Q74 In case of here are the slots i'm using : https://pastebin.com/h8uNH1gR https://pastebin.com/TNMZ5785 I'm using forge 1.12.2-14.23.4.2703 ~ Latest Thank you for reading, Have a nice day Edited June 5, 20187 yr by Riss_Crew
June 5, 20187 yr Author I replaced all my IInventory by IItemhandler But the error look like the same as before a null slot: https://pastebin.com/bdgUteFt But in my TileEntityClass, my inventory stack look like this : private NonNullList<ItemStack> machineItemStacks = NonNullList.withSize(4, ItemStack.EMPTY); And i have only 4 slots : this.addSlotToContainer(new SlotItemHandler(tileentity, 0, 14, 8)); this.addSlotToContainer(new SlotItemHandler(tileentity, 1, 51, 8)); this.addSlotToContainer(new SlotEnergyFuel(tileentity, 2, 14, 56)); this.addSlotToContainer(new SlotMachineOutput(player.player, tileentity, 3, 114, 7)); So all slots are fill with ItemStack.Empty and are not null no ?
June 5, 20187 yr Author I don't usually use debugger so did I did it correctly ? If yes so the problem is that tileentity is null but how can i fix that ? Here's my tile code in case : https://pastebin.com/w0YGn05K Edited June 5, 20187 yr by Riss_Crew
June 5, 20187 yr Author I finally found where the problem come from ! On my GUIHandler, (TileEntityMachineBase)world.getTileEntity(new BlockPos(x,y,z)) is null So i have to fix the creation of the TileEntity
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.