Ignore cancellation to avoid potential issues

Former-commit-id: 1567cdb95276504f64420bcccc71183fc8fd9b01
This commit is contained in:
Sotr committed 2018-10-29 01:20:20 +08:00
1 parent 2b93acb406
commit e0c54dfdfe
3 files changed
+6 -6

No files matched your search

@@ -18,7 +18,7 @@ public class ChatListener implements Listener {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.LOWEST)
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onChat(final AsyncPlayerChatEvent e) {
if (!plugin.getShopManager().getActions().containsKey(e.getPlayer().getUniqueId())) {
plugin.log(plugin.getShopManager().getActions().toString());
@@ -21,7 +21,7 @@ public class DisplayProtectionListener implements Listener {
this.plugin = plugin;
}
@EventHandler
@EventHandler(ignoreCancelled = true)
public void onInventoryOpen(InventoryOpenEvent event) {
for (int i = 0; i<event.getInventory().getContents().length; i++) {
try {
@@ -37,7 +37,7 @@ public class DisplayProtectionListener implements Listener {
}
}
@EventHandler
@EventHandler(ignoreCancelled = true)
public void onInventoryClick(InventoryClickEvent event) {
try {
if (itemStackCheck(event.getCurrentItem()) || itemStackCheck(event.getCursor())) {
@@ -54,8 +54,8 @@ public class DisplayProtectionListener implements Listener {
} catch (Exception e) {}
}
@EventHandler
void onInventoryPickupItem(InventoryPickupItemEvent event) {
@EventHandler(ignoreCancelled = true)
public void onInventoryPickupItem(InventoryPickupItemEvent event) {
try {
ItemStack is = event.getItem().getItemStack();
if (itemStackCheck(is)) {
@@ -56,7 +56,7 @@ public class LockListener implements Listener {
/**
* Handles hopper placement
*/
@EventHandler(priority = EventPriority.LOW)
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlace(BlockPlaceEvent e) {
Block b = e.getBlock();
try {