Panilla icon indicating copy to clipboard operation
Panilla copied to clipboard

Inventories are broken with some plugins

Open Techirion opened this issue 1 year ago • 4 comments

We were running latest build from spigomc and we've noticed some of GUIs on our Creative server are broken, after building and printing windowID it seems that in some cases windowID is 0 even tho it's GUI inventory...

if (windowId != 0 && panilla.getPConfig().ignoreNonPlayerInventories)

would it make sense to remove windowId != 0 check?

Techirion avatar Apr 05 '24 20:04 Techirion

How are these GUIs created? I'm not sure what causes the window ID to be 0 if it's not a player inventory.

ds58 avatar Apr 05 '24 23:04 ds58

Not sure yet I'm looking into this rn, but just

if (panilla.getPConfig().ignoreNonPlayerInventories)

doesn't fix the issue, even tho check is skipped (so config value is properly read and set to true), however removing Panilla fixes the issue, we've only noticed cause GUI clicks are cancelled (in some cases, holding shift and clicking on GUI would still work for some reason).

Techirion avatar Apr 05 '24 23:04 Techirion

Looking at the code I think Inventory inventory = player.getOpenInventory().getTopInventory(); is used, then populated with GUI items etc.

Techirion avatar Apr 05 '24 23:04 Techirion

Actually, it seems that

    @Override
    public void checkPacketPlayInClickContainer(Object _packet) throws NbtNotPermittedException {
        if (_packet instanceof PacketPlayInWindowClick) {

            if (panilla.getPConfig().ignoreNonPlayerInventories) {
                return; // TODO test
            }

in public class PacketInspector implements IPacketInspector would fix the issue with GUIs, but I'm not sure about possible other implications...

Edit: That is provided that panilla.getPConfig().ignoreNonPlayerInventories is set to true

Techirion avatar Apr 07 '24 19:04 Techirion