Skip to content

Commit

Permalink
Fix Event Priority
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueDarkLord committed Feb 7, 2024
1 parent 6f4f444 commit 352f9ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class AxeEnchantments implements Listener {

private final SpartanSupport spartanSupport = starter.getSpartanSupport();

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerDamage(EntityDamageByEntityEvent event) {
if (EventUtils.isIgnoredEvent(event)) return;
if (pluginSupport.isFriendly(event.getDamager(), event.getEntity())) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class SwordEnchantments implements Listener {
// Economy Management.
private final CurrencyAPI currencyAPI = starter.getCurrencyAPI();

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerDamage(EntityDamageByEntityEvent event) {
if (EventUtils.isIgnoredEvent(event) || EventUtils.isIgnoredUUID(event.getDamager().getUniqueId())) return;
if (pluginSupport.isFriendly(event.getDamager(), event.getEntity())) return;
Expand Down Expand Up @@ -276,7 +276,7 @@ public void run() {

if (SupportedPlugins.SPARTAN.isPluginLoaded()) spartanSupport.cancelNoSwing(damager);

for (LivingEntity entity :methods.getNearbyLivingEntities(2D, damager)) {
for (LivingEntity entity : methods.getNearbyLivingEntities(2D, damager)) {
EntityDamageByEntityEvent damageByEntityEvent = new EntityDamageByEntityEvent(damager, entity, EntityDamageEvent.DamageCause.CUSTOM, 5D);
methods.entityEvent(damager, entity, damageByEntityEvent);
}
Expand Down

0 comments on commit 352f9ca

Please sign in to comment.