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

I'm creating a device with two inventory slots that needs a specific kind of item to be placed in each slot.

 

Currently I'm using ISidedInventory to allow items to be piped into particular slots, which works okay. But it would be better if I could accept an item from any side and automatically route it to the appropriate slot.

 

Some mods have devices that behave this way -- anyone know how they do it? IInventory and ISidedInventory don't seem to support this behaviour, since they require the caller to have already decided which slot the item goes in.

 

A related question is whether it's possible to reject items of the wrong kind. There doesn't seem to be any obvious way to do that either.

One way I saw is to have a set of like 9 invisible slots that are not actually on the GUI that all the sides interact with.  And when the block detects an item in there it automatically moves it to the proper spot, and if all spots are full then it usually 'unlinks' them.  There are a few ways though.

 

I have been itching to created an ISidedInventoryEx that extends ISidedInventory with such functions though, unless someone else wants to do it first?  Please?

 

The BC API for item handling is a good basis, just needs changes to become generic.

Well, I'd just use the six slots, then route it. But yeah, ISidedInventoryAwesomness (That's what it should be called) would be great!

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

  • Author

One way I saw is to have a set of like 9 invisible slots...  And when the block detects an item in there it automatically moves it to the proper spot

 

Hmmm... what happens if one of the slots is full, but the others aren't? It seems like items will end up in the invisible inventory with nowhere to go.

 

I was wondering whether I could just have setInventorySlotContents ignore the slot index passed in, and make its own determination of where to put the item. Or would that confuse callers too much?

 

I have been itching to created an ISidedInventoryEx that extends ISidedInventory with such functions though, unless someone else wants to do it first?  Please?

 

The BC API for item handling is a good basis, just needs changes to become generic.

 

I may have a look at that and see what I can come up with.

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.