Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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 ?

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.