Skip to content

Commit

Permalink
Move the BEFORE COmmandItem actions to prevent it using consumables w…
Browse files Browse the repository at this point in the history
…hen it shouldn;'t.
  • Loading branch information
me4502 committed Jan 29, 2017
1 parent 9c0d14d commit c75fe9f
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -433,6 +433,11 @@ public void performCommandItems(ItemStack item, final Player player, final Event
}
}

for(CommandItemAction action : comdef.actions)
if(action.stage == ActionRunStage.BEFORE)
if(!action.runAction(comdef, event, player))
break current;

for(ItemStack stack : def.consumables) {

boolean found = false;
Expand Down Expand Up @@ -483,11 +488,6 @@ public void performCommandItems(ItemStack item, final Player player, final Event

player.updateInventory();

for(CommandItemAction action : comdef.actions)
if(action.stage == ActionRunStage.BEFORE)
if(!action.runAction(comdef, event, player))
break current;

for(String command : comdef.commands)
doCommand(command, event, comdef, player);

Expand Down

0 comments on commit c75fe9f

Please sign in to comment.