Skip to content

Commit

Permalink
Add slot numbers to "drags in inventory" context
Browse files Browse the repository at this point in the history
For #859
  • Loading branch information
Morphan1 committed Oct 12, 2014
1 parent 565fdaa commit a1c187a
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -2691,6 +2691,8 @@ public void inventoryCloseEvent(InventoryCloseEvent event) {
// @Context
// <context.item> returns the dItem the player has dragged.
// <context.inventory> returns the dInventory.
// <context.slots> returns a dList of the slot numbers dragged through.
// <context.raw_slots> returns a dList of the raw slot numbers dragged through.
//
// @Determine
// "CANCELLED" to stop the player from dragging.
Expand Down Expand Up @@ -2731,6 +2733,16 @@ public void inventoryDragEvent(InventoryDragEvent event) {

context.put("item", item);
context.put("inventory", dInventory.mirrorBukkitInventory(inventory));
dList slots = new dList();
for (Integer slot : event.getInventorySlots()) {
slots.add(slot.toString());
}
context.put("slots", slots);
dList raw_slots = new dList();
for (Integer raw_slot : event.getRawSlots()) {
raw_slots.add(raw_slot.toString());
}
context.put("raw_slots", raw_slots);

String determination = EventManager.doEvents(events, null, player, context, true);

Expand Down

0 comments on commit a1c187a

Please sign in to comment.