Sophisticated Storage

Sophisticated Storage

20M Downloads

Chest Variations Do Not Work in Create Moving Contraptions

Darkosto opened this issue ยท 3 comments

commented

Hello!

When using Sophisticated Storage blocks with Create Contraptions, many of the chest variants will not work both visibly and functionally.

I've been under the impression that they have all worked until a recent Sophisticated Storage and Core update but after further investigation some have never worked since the first release of Sophisticated Storage. We checked back to the first release for 1.18.2 and confirmed that all Netherite variants do not function while the remaining storage work correctly. The base storage chests have only recently stopped functioning which, I believe, happens after sophisticatedstorage-1.20.1-0.8.51.605 & sophisticatedcore-1.20.1-0.5.89.425

I can't find anything that separates the chests that work and the ones that do not so I can't offer any assistance on that end. But, if possible, I can help test versions with more logging to help pinpoint the issue. Let me know if you have any questions.

Darkosto

commented

So here's the rundown of some of the main rules that create uses to determine if a storage can be used or open while the contraption is running.

When the contraption is being formed it checks every storage for:

  • whether it has an implementation of ItemStackHandler a base class used for item handling. Sophisticated Storage used to have just a simple extension of this (and still does internally), but now there's a wrapper class on top of that for performance improvements when the storage is full and something is trying to push items into it.
  • the next main thing that is checked for Sophisticated Storage is whether the name of the block contains _chest or _barrel. Given that base level chest / barrel only use chest/barrel as a name these are rejected as "invalid" storages. That applies to all their colored variants as those are simply a bit of nbt stored in related block entity. So out of this only chests/barrels that are iron or higher tier will work

Now when contraption actually works there's another rule for whether gui can be shown - will only open for storages that have a multiple of 9 of inventory slots.

So out of this you get following:

  • Wood tier chest/barrel does not work at all
  • Iron/Gold/Diamond chest/barrel with default settings - works both as storage and can be open while contraption is running
  • Netherite chest/barrel with default settings - works as storage, but can't be open while contraption is running

Best solution would be create allowing anything that includes barrel / chest in name to be treated as such and allowing any number of slots to be shown in gui.

As an alternative you can fix netherite chest/barrel gui to be shown by setting the number of slots to be a multiple of 9.

And I will think about returning item handler that's not optimized for filled inventory if this is asked for without a side provided (all pipes / storage buses I can think of should be providing a side they are trying to insert from so that should likely handle that part). This would fix the wood tier chest/barrel.

commented

Also one more thing I realized when looking at my implementation there are other things that can affect if the inventory could be detected solely based on the type of item handler used - for example if filter upgrade is used that also uses a wrapper on top and Create in that case will again fall back to detecting whether it is inventory by _chest / _barrel in its name, but this one is likely less of a worry because upgrades anyway won't work in any way in contraptions and players are likely to just use storages without any upgrades at all.

commented

just released an update in which I am no longer trying to optimize item handler if it was asked for without a side so wooden tier barrels/chests now work in create contraptions. I will still leave this open as I would like to see if I can do something about proper compat being added to create to support cases like stack upgrades in storage