CoreProtect

CoreProtect

1M Downloads

CommandHandler: parseAction inv actions 1 & 0 swapped?

bdotsamir opened this issue ยท 1 comments

commented

I mentioned this in my PR #457 but it looks like when you're parsing the actions given by the player, action 11 (player inventory transactions) appear to be swapped when adding a qualifier + / -.

The convention that I've seen thus far is when qualifiers are added, a 1 or 0 is added to the actionList. See container action 4 & session action 8.

However, the inventory action appears to have these swapped.
-inv adds action 1, general addition.

else if (argument.equals("-inv") || argument.equals("inv-") || argument.equals("-inventory") || argument.equals("inventory-") || argument.equals("-inventories")) {
result.add(4);
result.add(11);
result.add(1);

+inv adds action 0, general subtraction.

else if (argument.equals("+inv") || argument.equals("inv+") || argument.equals("+inventory") || argument.equals("inventory+") || argument.equals("+inventories")) {
result.add(4);
result.add(11);
result.add(0);

Is this intended?

commented

Yes, a:inventory is inverse as it's instead targeting the players inventory.