Inventory Tweaks [1.12 only]

Inventory Tweaks [1.12 only]

127M Downloads

TrashSlot Compatibility Problem

BlayTheNinth opened this issue ยท 6 comments

commented

Hey there,

my mod TrashSlot patches the player.inventoryContainer to add an additional trash slot to the survival inventory. Apparently that seems to mess with InventoryTweaks' (see TwelveIterationMods/TrashSlot#6) refill option (and maybe with other things too?), as it will place the item not in the InventoryPlayer.currentItem slot, but one next to it.

I've read through #108 and looked at ContainerSection, but it doesn't look like there's a suitable section for a slot like mine; and even if there was, we'd run into trouble both coremodding the section callback into the inventory container (and coremodding your VanillaSlotMaps sounds like a sin).

In the above mentioned issue you speak of a special handling you've done for the creative menu trash slot; I couldn't find any about that in the source code though. Is it possible for me to apply the same special handling to my trash slot or is that something you'd have to do on your side?

commented

Okay, but would it actually cause problems if those sections were defined? If so, what do you suggest to solve this issue?

commented

It probably wouldn't cause too many issues to define them, but it's more consistent with handling of added containers via the config XML (which can't define sections, so only have the autogen end-of-container inventory), and less things to manually check during updates. Not that doing that, at this point, would help you, since 1.7.10 is not getting further updates.

commented

Alright, then I'll see if I can somehow hack the issue away. My trash slot only exists in the inventory container by the way, other Vanilla/modded containers stay unmodified.

commented

I think the 'special handling' is just having the creative inventory explicitly map the inventory section so it doesn't use the automatic end-of-container one. See https://github.com/Kobata/inventory-tweaks/blob/develop/src/main/java/invtweaks/container/VanillaSlotMaps.java#L37-L46

Every other mod I know of that edits the player inventory uses a subclass of the player container and edits the creation of it, so they can just apply the API annotations to that subclass.

commented

Why is the INVENTORY, INVENTORY_HOTBAR and INVENTORY_NOT_HOTBAR section not set for the player inventory itself? Shouldn't that solve the issue?

Subclassing and overriding the player container seems overkill for adding a single slot and also causes incompatibility with any other mod that wants to alter the inventory in more 'extreme' ways.

commented

Everything else falls back on default behavior because it's always consistent within vanilla (and quite a few mod containers too, although some take the opposite approach...). Creative's trash slot is the only one in vanilla that comes after the inventory.