MLG-Fortress / AutomaticInventory

Automatically sort, refill, and replace items in any inventory
https://dev.bukkit.org/projects/automatic-inventory
GNU General Public License v3.0
3 stars 14 forks source link

AutomaticInventory AutoSort Inventory loses items when using ShulkerPacks #33

Open MattAKAFred opened 4 years ago

MattAKAFred commented 4 years ago

Probably also affects other backpack plugins, but my experience is specific to https://www.spigotmc.org/resources/shulker-backpacks-1-13-1-15.67466/ - Basically, opening a shulker pack directly from inventory and placing items inside results in item loss thanks to autosorting happening immediately on close, overwriting shulker contents. A small delay for pack to close first then sort could probably solve.

Momshroom commented 4 years ago

I have a user who is able to (not consistently) either lose or dupe items in a way he thinks is related to this with automatic inventory and cmi’s shulker backpacks, only when those are used from the inventory rather than being shift-clicked to the ground. I was unable to replicate it myself so just have disabled that in CMI, but it’s clearly an issue when the items are moved by automatic inventory from his description, so I suspect it’s related to this issue

On Mon, Jun 29, 2020 at 11:06 PM MattAKAFred notifications@github.com wrote:

Probably also affects other backpack plugins, but my experience is specific to https://www.spigotmc.org/resources/shulker-backpacks-1-13-1-15.67466/ - Basically, opening a shulker pack directly from inventory and placing items inside results in item loss thanks to autosorting happening immediately on close, overwriting shulker contents. A small delay for pack to close first then sort could probably solve.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MLG-Fortress/AutomaticInventory/issues/33, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEATM2HKNV2E5ESR5C34Y3LRZFQDNANCNFSM4OL2J5HA .

RoboMWM commented 4 years ago

Interesting, autosort for inventories besides the player's should be happening on open not close. Wonder if a recently-pulled PR changed this behavior.

No idea what CMI does thanks to it being closed source so all I can go on there is the reputation of the developer, which isn't good given the other projects he maintains (or rather, maintained).

RoboMWM commented 3 years ago

Ok, I see now, you meant the player's inventory sorting. I'm not sure how that plugin is keeping track of where it is, but I'd assume it's holding onto a specific inventory slot ID, which I can now see why it'd be affected by player inventory sorting. I'd imagine a better design would be to tag the item itself (with NBT or similar, or at the very least hold the ItemStack reference, which I imagine only goes away if it's dropped from inventory) - that would be the proper way to fix it on the backpack side.

Regardless, in 1.16 it's no longer possible to tell when the player closes their own inventory.