1.1.15: all enderchest piles get locked when enderchest is opened
MeeniMc opened this issue · 2 comments
Thank you for fixing the enderchest delete bug!
It however appears that the fix is a bit agressive in locking -all- enderchest piles when one pile is opened
Issue
It is not possible to move any enderchest pile (of the same size) while QuickShulker has an enderchest opened. This is annoying because it can make impossible putting 1 enderchest into another enderchest.
Replicate
- Creative mode, get 3 piles of 64 enderchests
- Survival mode, place one enderchest on the ground (1 pile will now show 63)
- aim in the air, right click one of the two 64 piles
- try to move the 'opened' 64-pile of enderchest in the enderchest (this is valid): it cannot move (arguably this is not ideal but acceptable: it should lock only 1 unit, but that may be more trouble to code for the edge case than is worth)
- try to move the 'other' 64-pile of enderchest in the enderchest: it also cannot move. This pile should not be locked and should be movable freely.
- try to move the 63-pile of enderchest in the enderchest: it can move (presumably because it recognizes that it is not the same pile, due to nbt being different).
Workaround
It remains possible to put an enderchest in an enderchest using the normal vanilla mechanic (place the enderchest on the ground, open it, put the second enderchest inside, pickaxe the placed enderchest).
Also impacted: shulkers of the same color
The same issue is also present for shulker boxes: if I open a red box, all red boxes are locked in place. It's not as annoying because in any case one cannot put a shulker in a shulker, but normally it remains possible to 'reorganize' ones inventory, moving the non-opened shulkers around in inventory slots. ATM, when a red box is opened with QS, a black box can be moved around freely, but another red box cannot.
Possible fix
use the slot-index to lock the pile, rather than the NBT signature of the item.
Ah dang I missed this.
I'm currently working on a fix but minecraft's slot index system is horrible imo(to be fair, it does what its's supposed to just fine). Minecraft just combines all of the available slots for the currently opened inventory into a list, including the player inv.
For example, say you have a double chest open, and you quick shulker open a shulker box in your player inv, the slot id is say 98(double chest is 54 slots, player inv starts at 54). Now when the shulker opens, since it is a smaller inv, the player inv starts at 36. Now slot 98 does not exist in the new opened inventory. There is no way to convert that slot index to the player inventory slot index. I'm just gonna have to try to implement a conversion between the two. But imo, this cannot be guaranteed to work and will likely break with mods doing funky stuff.