Skip to content

Commit

Permalink
Null check knockback event
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Sep 20, 2023
1 parent 7b650a2 commit fe0d058
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main/src/main/java/net/citizensnpcs/util/NMS.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import net.citizensnpcs.api.npc.BlockBreaker;
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.npc.NPCRegistry;
import net.citizensnpcs.api.util.BoundingBox;
import net.citizensnpcs.api.util.EntityDim;
import net.citizensnpcs.api.util.Messaging;
Expand Down Expand Up @@ -113,6 +112,8 @@ public static float[][] calculateDragonPositions(float yrot, double[][] latency)

public static void callKnockbackEvent(NPC npc, float strength, double dx, double dz,
Consumer<NPCKnockbackEvent> cb) {
if (npc.getEntity() == null)
return;
if (SUPPORT_KNOCKBACK_RESISTANCE && npc.getEntity() instanceof LivingEntity) {
try {
AttributeInstance attribute = ((LivingEntity) npc.getEntity())
Expand Down Expand Up @@ -689,8 +690,8 @@ public static void removeFromWorld(org.bukkit.entity.Entity entity) {
BRIDGE.removeFromWorld(entity);
}

public static void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
BRIDGE.removeHookIfNecessary(npcRegistry, entity);
public static void removeHookIfNecessary(FishHook entity) {
BRIDGE.removeHookIfNecessary(entity);
}

public static void replaceTracker(Entity entity) {
Expand Down

0 comments on commit fe0d058

Please sign in to comment.