Duplicate item in my own inventory #182

Closed
opened 2021-03-01 04:20:50 -05:00 by Fakhri1999 · 4 comments
Fakhri1999 commented 2021-03-01 04:20:50 -05:00 (Migrated from github.com)

Description:
I can duplicate item in my own inventory using this plugin

How to reproduce:
Put 1 stackable item (with an amount less than the max amount of stackable, for example, "30 iron ingot") in your inventory and make sure there is no other item in your inventory. Then run the command "/openinv <your_own_name>" and do "Shift + right click" or "Shift + left click" to the item (you can click to the opened GUI or to the inventory GUI)

Server version:

  • git-Paper-505(1.16.5, latest build)
  • latest plugin version (4.1.5)
  • playing as OP
  • the plugin only OpenInv, I deleted all others plugin to make sure other plugin doesn't make the error
Description: I can duplicate item in my own inventory using this plugin How to reproduce: Put 1 stackable item (with an amount less than the max amount of stackable, for example, "30 iron ingot") in your inventory and make sure there is no other item in your inventory. Then run the command "/openinv <your_own_name>" and do "Shift + right click" or "Shift + left click" to the item (you can click to the opened GUI or to the inventory GUI) Server version: - git-Paper-505(1.16.5, latest build) - latest plugin version (4.1.5) - playing as OP - the plugin only OpenInv, I deleted all others plugin to make sure other plugin doesn't make the error
Jikoo commented 2021-03-02 18:32:17 -05:00 (Migrated from github.com)

Interesting. I'm reasonably confident that that didn't happen on older versions, pretty much all "duplication" bugs ended up being either conflicts outside of OI's control or creative desync.

Interesting. I'm reasonably confident that that didn't happen on older versions, pretty much all "duplication" bugs ended up being either conflicts outside of OI's control or creative desync.
Jikoo commented 2021-03-02 18:37:56 -05:00 (Migrated from github.com)

This will unfortunately not be an easy fix - OI doesn't reroute logic in a chest inventory, it piggybacks Minecraft's internals to create a container backed by another container's content list (the player inventory, in this case). Because of that, the issue here is caused by sections of code that OI generally has no business messing with.

As a bandaid, deny your untrustworthy players OpenInv.openself.

This will unfortunately not be an easy fix - OI doesn't reroute logic in a chest inventory, it piggybacks Minecraft's internals to create a container backed by another container's content list (the player inventory, in this case). Because of that, the issue here is caused by sections of code that OI generally has no business messing with. As a bandaid, deny your untrustworthy players `OpenInv.openself`.
Fakhri1999 commented 2021-03-08 16:15:33 -05:00 (Migrated from github.com)

can't you add a new if inside your code so when the user shift click, it will suddenly cancel the event? so people can only click without shift

can't you add a new if inside your code so when the user shift click, it will suddenly cancel the event? so people can only click without shift
Jikoo commented 2021-03-08 22:25:56 -05:00 (Migrated from github.com)

Yes, but that's pretty poor in terms of QoL, the only reason you wouldn't shift-click everything is if you're trying to put something in a specific slot. Since there's a separate permission for opening your own inventory that can very easily be denied, that's an unnecessary and incomplete bandaid that hampers responsible users.

Yes, but that's pretty poor in terms of QoL, the only reason you wouldn't shift-click everything is if you're trying to put something in a specific slot. Since there's a separate permission for opening your own inventory that can very easily be denied, that's an unnecessary and incomplete bandaid that hampers responsible users.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: minster586/OpenInv#182
No description provided.