From f3cd88bf471f4c87ff36f62e2f22e533bba04fe2 Mon Sep 17 00:00:00 2001 From: mcmonkey4eva Date: Thu, 16 Apr 2015 21:06:20 -0700 Subject: [PATCH] Add hotbar_button to inv event, fixes #1014 --- .../scripts/containers/core/BukkitWorldScriptHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/aufdemrand/denizen/scripts/containers/core/BukkitWorldScriptHelper.java b/src/main/java/net/aufdemrand/denizen/scripts/containers/core/BukkitWorldScriptHelper.java index 49688606f2..736b9c2549 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/containers/core/BukkitWorldScriptHelper.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/containers/core/BukkitWorldScriptHelper.java @@ -2507,6 +2507,7 @@ else if (Argument.valueOf(determination).matchesPrimitive(aH.PrimitiveType.Integ // returns an Element with the raw number of the slot that was clicked. // returns true if 'shift' was used while clicking. // returns the inventory_action. See <@link language Inventory Actions>. + // returns an Element of the button pressed as a number, or -1 if no number button was pressed. // // @Determine // "CANCELLED" to stop the player from clicking. @@ -2515,7 +2516,7 @@ else if (Argument.valueOf(determination).matchesPrimitive(aH.PrimitiveType.Integ @EventHandler public void inventoryClickEvent(InventoryClickEvent event) { - // TODO: make this a smart event... + // TODO: make this a script event... Map context = new HashMap(); dItem item = null; @@ -2621,6 +2622,7 @@ public void inventoryClickEvent(InventoryClickEvent event) { context.put("raw_slot", new Element(event.getRawSlot() + 1)); context.put("is_shift_click", new Element(event.isShiftClick())); context.put("action", new Element(event.getAction().name())); + context.put("hotbar_button", new Element(event.getHotbarButton())); String determination = doEvents(events, null, player, context, true);