Skip to content

Commit

Permalink
Fix NPE on cause filter before tracker load (#1418)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 authored Oct 30, 2024
1 parent a59a484 commit 584112a
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ public boolean matches(MatchQuery query) {
event = ((GeneralizedEvent) event).getCause();
}

TrackerMatchModule tracker = query.moduleRequire(TrackerMatchModule.class);

EntityDamageEvent.DamageCause damageCause = null;
DamageInfo damageInfo = null;
boolean punchDamage = false;
if (event instanceof EntityDamageEvent damageEvent) {
damageCause = damageEvent.getCause();
damageInfo = tracker.resolveDamage(damageEvent);
damageInfo = query.moduleRequire(TrackerMatchModule.class).resolveDamage(damageEvent);
if (damageInfo instanceof MeleeInfo) {
PhysicalInfo weapon = ((MeleeInfo) damageInfo).getWeapon();
if (weapon instanceof ItemInfo && ((ItemInfo) weapon).getItem().getType() == Material.AIR) {
Expand Down

0 comments on commit 584112a

Please sign in to comment.