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

Hey everyone !
I can't find a way to create a container with an ItemStackHandler, the only thins I find are with Inventories.
Does someone know how to do it or is there a good tutorial/explaination somewhere ?
Thanks ^^

Edited by BastouP

16 hours ago, BastouP said:

Hey everyone !
I can't find a way to create a container with an ItemStackHandler, the only thins I find are with Inventories.
Does someone know how to do it or is there a good tutorial/explaination somewhere ?
Thanks ^^

Howdy

 

You could get some clues from the Botania mod, it uses ItemStackHandlers and Capabilities instead of IInventory eg ItemFlowerBag.

https://github.com/Vazkii/Botania/blob/master/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java

 

The only potential problem with SlotItemHandler and ItemStackhandler instead of IInventory is that IInventory is also used by vanilla to tell the source container (typically TileEntity) that the GUI has modified the slot contents (marked it as "dirty").  But SlotItemHandler and ItemStackhandler don't do that. 

 

There are some knowledgeable folks on this forum who think that it doesn't matter because the source container is marked as dirty in other ways; they might be right although I'm not convinced yet.  I haven't tested it empirically yet (on my to-do list).  Up until now I've played it safe and wrapped the ItemStackHandler in an IInventory.  If you decide to test it yourself, please let me know...

 

-TGG

 

Edited by TheGreyGhost

  • Author

Hey ! I managed to make it work !
There was just ( again ) an event problem which made my GUI not registering.
Now it seems to be working, I'll let you know if I encounter any problem.

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.