Removed useless ignoreCancelled

This commit is contained in:
Roch Blonndiaux 2023-03-13 15:18:47 +01:00
parent 4f61291d7c
commit 7edd258eab

View File

@ -36,7 +36,7 @@ public class DisabledItemsListener implements Listener {
this.plugin = plugin; this.plugin = plugin;
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void rightClickEffects(PlayerInteractEvent event) { public void rightClickEffects(PlayerInteractEvent event) {
if (!event.hasItem()) if (!event.hasItem())
return; return;
@ -45,7 +45,7 @@ public class DisabledItemsListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void meleeAttacks(PlayerAttackEvent event) { public void meleeAttacks(PlayerAttackEvent event) {
if (!(event.getAttack() instanceof MeleeAttackMetadata)) if (!(event.getAttack() instanceof MeleeAttackMetadata))
return; return;
@ -55,7 +55,7 @@ public class DisabledItemsListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void specialToolAbilities(BlockBreakEvent event) { public void specialToolAbilities(BlockBreakEvent event) {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
if (player.getGameMode() == GameMode.CREATIVE) if (player.getGameMode() == GameMode.CREATIVE)
@ -66,7 +66,7 @@ public class DisabledItemsListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void rightClickWeaponInteractions(PlayerInteractEntityEvent event) { public void rightClickWeaponInteractions(PlayerInteractEntityEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (!(event.getRightClicked() instanceof LivingEntity)) if (!(event.getRightClicked() instanceof LivingEntity))
@ -77,7 +77,7 @@ public class DisabledItemsListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void gemStonesAndItemStacks(InventoryClickEvent event) { public void gemStonesAndItemStacks(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked(); Player player = (Player) event.getWhoClicked();
if (event.getAction() != InventoryAction.SWAP_WITH_CURSOR) if (event.getAction() != InventoryAction.SWAP_WITH_CURSOR)
@ -88,7 +88,7 @@ public class DisabledItemsListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void handleCustomBows(EntityShootBowEvent event) { public void handleCustomBows(EntityShootBowEvent event) {
if (!(event.getProjectile() instanceof Arrow) || !(event.getEntity() instanceof Player)) if (!(event.getProjectile() instanceof Arrow) || !(event.getEntity() instanceof Player))
return; return;
@ -98,7 +98,7 @@ public class DisabledItemsListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST)
public void handleVanillaEatenConsumables(PlayerItemConsumeEvent event) { public void handleVanillaEatenConsumables(PlayerItemConsumeEvent event) {
NBTItem item = MythicLib.plugin.getVersion().getWrapper().getNBTItem(event.getItem()); NBTItem item = MythicLib.plugin.getVersion().getWrapper().getNBTItem(event.getItem());
if (shouldCancel(item)) if (shouldCancel(item))