Lower event handler priority in PvpListener

This commit is contained in:
2024-04-18 17:11:33 +02:00
parent 645068f66c
commit 7253eab958
@@ -24,7 +24,7 @@ public class PvpListener implements Listener {
this.plugin = plugin; this.plugin = plugin;
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityDamage(EntityDamageByEntityEvent event) { public void onEntityDamage(EntityDamageByEntityEvent event) {
Entity attacker = event.getDamager(); Entity attacker = event.getDamager();
Entity victim = event.getEntity(); Entity victim = event.getEntity();
@@ -36,7 +36,7 @@ public class PvpListener implements Listener {
plugin.getPlayerManager().handleDamageCheck(result); plugin.getPlayerManager().handleDamageCheck(result);
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPotionSplash(PotionSplashEvent event) { public void onPotionSplash(PotionSplashEvent event) {
if (!(event.getEntity().getShooter() instanceof Player thrower)) return; if (!(event.getEntity().getShooter() instanceof Player thrower)) return;
boolean harmful = false; boolean harmful = false;
@@ -56,7 +56,7 @@ public class PvpListener implements Listener {
} }
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPotionCloudEffectApply(AreaEffectCloudApplyEvent event) { public void onPotionCloudEffectApply(AreaEffectCloudApplyEvent event) {
if (!(event.getEntity().getSource() instanceof Player thrower)) return; if (!(event.getEntity().getSource() instanceof Player thrower)) return;
boolean harmful = false; boolean harmful = false;
@@ -78,7 +78,7 @@ public class PvpListener implements Listener {
}); });
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onFish(PlayerFishEvent event) { public void onFish(PlayerFishEvent event) {
if (event.getCaught() instanceof Item) return; if (event.getCaught() instanceof Item) return;
if (plugin.getConfigCache().allow_fishing_rod_pull) return; if (plugin.getConfigCache().allow_fishing_rod_pull) return;