From f8e5216b4d121b99caf2e3ae2a8e6321c2defa65 Mon Sep 17 00:00:00 2001 From: Blackvein Date: Thu, 8 Nov 2012 15:25:39 -0800 Subject: [PATCH] Unstable --- src/me/blackvein/quests/PlayerListener.java | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/me/blackvein/quests/PlayerListener.java b/src/me/blackvein/quests/PlayerListener.java index 43ee395f8..96265adce 100644 --- a/src/me/blackvein/quests/PlayerListener.java +++ b/src/me/blackvein/quests/PlayerListener.java @@ -526,26 +526,14 @@ public class PlayerListener implements Listener { return; } - List changedSlots = Quester.getChangedSlots(evt.getWhoClicked().getInventory(), evt.getCurrentItem()); - System.out.println("Number of changed slots: " + changedSlots.size()); - boolean can = true; - for (int i : changedSlots) { + String s = Quester.checkPlacement(evt.getInventory(), evt.getRawSlot()); + if (s == null) { - String s = Quester.checkPlacement(evt.getInventory(), i); - if (s != null) { - System.out.println("BAD Changed slot: " + i); - can = false; - break; - } - - } - if (!can) { - - System.out.println("Cannot."); + player.sendMessage(ChatColor.YELLOW + "You may not store Quest items."); evt.setCancelled(true); player.updateInventory(); - } else if (can && Quester.checkPlacement(evt.getInventory(), evt.getRawSlot()) != null) { + } else { ItemStack oldStack = evt.getCurrentItem(); Inventory inv = plugin.getServer().createInventory(null, evt.getInventory().getType()); @@ -558,6 +546,7 @@ public class PlayerListener implements Listener { quester.collectItem(newStack); } else { + System.out.println("Collecting " + oldStack); quester.collectItem(oldStack); }