Permalink
Browse files

Move the BEFORE COmmandItem actions to prevent it using consumables w…

…hen it shouldn;'t.
  • Loading branch information...
me4502 committed Jan 29, 2017
1 parent 9c0d14d commit c75fe9f2c29f0848505833a843b286abdf4b3059
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/main/java/com/sk89q/craftbook/mechanics/items/CommandItems.java
@@ -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;
@@ -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);

0 comments on commit c75fe9f

Please sign in to comment.