Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

- modifyworld.items.put.<id>.of.<container> have a bug #90

Open
RiflemanSD opened this issue Apr 8, 2014 · 1 comment · May be fixed by #102
Open

- modifyworld.items.put.<id>.of.<container> have a bug #90

RiflemanSD opened this issue Apr 8, 2014 · 1 comment · May be fixed by #102

Comments

@RiflemanSD
Copy link

in class PlayerListeners at method onPlayerInventoryClick(InventoryClickEvent event), u have made a mistake. the check if (event.getCurrentItem() == null) never will return null, because if there is not currentItem it will return a AIR item stack and not a null.
That's why the permission node modifyworld.items.put. don't work, but modifyworld.items.take. works.

U can edit the ur code , and change it like my code above perhaps, to check when some1 place a item into the inventory:

InventoryAction act = event.getAction();
InventoryAction act1 = InventoryAction.PLACE_ALL;
InventoryAction act2 = InventoryAction.PLACE_ONE;
InventoryAction act3 = InventoryAction.PLACE_SOME;

    if (act.compareTo(act1) == 0 || act.compareTo(act2) == 0 || act.compareTo(act3) == 0) {
        action = "put";
        item = event.getCursor();
    } else {
        action = "take";
        item = take;
    }
@PikachuEXE
Copy link

See #102

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants