mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-28 21:56:28 +01:00
Unstable
This commit is contained in:
parent
3ef0154098
commit
f8e5216b4d
@ -526,26 +526,14 @@ public class PlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Integer> changedSlots = Quester.getChangedSlots(evt.getWhoClicked().getInventory(), evt.getCurrentItem());
|
String s = Quester.checkPlacement(evt.getInventory(), evt.getRawSlot());
|
||||||
System.out.println("Number of changed slots: " + changedSlots.size());
|
if (s == null) {
|
||||||
boolean can = true;
|
|
||||||
for (int i : changedSlots) {
|
|
||||||
|
|
||||||
String s = Quester.checkPlacement(evt.getInventory(), i);
|
player.sendMessage(ChatColor.YELLOW + "You may not store Quest items.");
|
||||||
if (s != null) {
|
|
||||||
System.out.println("BAD Changed slot: " + i);
|
|
||||||
can = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (!can) {
|
|
||||||
|
|
||||||
System.out.println("Cannot.");
|
|
||||||
evt.setCancelled(true);
|
evt.setCancelled(true);
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
|
|
||||||
} else if (can && Quester.checkPlacement(evt.getInventory(), evt.getRawSlot()) != null) {
|
} else {
|
||||||
|
|
||||||
ItemStack oldStack = evt.getCurrentItem();
|
ItemStack oldStack = evt.getCurrentItem();
|
||||||
Inventory inv = plugin.getServer().createInventory(null, evt.getInventory().getType());
|
Inventory inv = plugin.getServer().createInventory(null, evt.getInventory().getType());
|
||||||
@ -558,6 +546,7 @@ public class PlayerListener implements Listener {
|
|||||||
quester.collectItem(newStack);
|
quester.collectItem(newStack);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
System.out.println("Collecting " + oldStack);
|
||||||
quester.collectItem(oldStack);
|
quester.collectItem(oldStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user