Former-commit-id: 7ab0f4c1fdbbfb3ab8ee641fa246ea878e45f0d4 [formerly bdfe3073727c10ac0e1919eab6a1663e513c9c09]
Former-commit-id: ff378997d09a94064fb2305baeb2f1328d1e3fe2
This commit is contained in:
Ghost_chu committed 2019-03-11 19:17:56 +08:00
1 parent b786d2ce9c
commit ac65aeba08
1 file changed
+12 -2
@@ -133,13 +133,22 @@ public class DisplayProtectionListener implements Listener {
public void onPlayerClick(PlayerInteractEvent e) {
ItemStack stack = e.getPlayer().getInventory().getItemInMainHand();
ItemStack stackOffHand = e.getPlayer().getInventory().getItemInOffHand();
boolean found = false;
try {
if (DisplayItem.checkShopItem(stack) || DisplayItem.checkShopItem(stackOffHand)) {
if (DisplayItem.checkShopItem(stack)) {
stack.setType(Material.AIR);
found=true;
// You shouldn't be able to pick up that...
}
if( DisplayItem.checkShopItem(stackOffHand)) {
stack.setType(Material.AIR);
found=true;
}
if(found) {
e.setCancelled(true);
MsgUtil.sendExploitAlert(e.getPlayer() ,"Player Interact", e.getPlayer().getLocation());
Util.debugLog("Something trying collect QuickShop displayItem, already cancelled. ("+e.getPlayer().getInventory().getLocation().toString()+")");
Util.inventoryCheck(e.getPlayer().getInventory());
// You shouldn't be able to pick up that...
}
} catch (NullPointerException ex) {
} // if meta/displayname/stack is null. We don't really care in that case.
@@ -159,6 +168,7 @@ public class DisplayProtectionListener implements Listener {
Util.debugLog("Something trying collect QuickShop displayItem, already cancelled. ("+event.getInventory().getLocation().toString()+")");
Util.inventoryCheck(event.getInventory());
}
} catch (Exception e) {}
}