Jump to content

Recommended Posts

Posted (edited)

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 by Riss_Crew
Posted

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 ?

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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