mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-23 16:41:43 +01:00
Null check knockback event
This commit is contained in:
parent
7b650a2af4
commit
fe0d058160
@ -51,7 +51,6 @@ import net.citizensnpcs.api.jnbt.CompoundTag;
|
||||
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;
|
||||
@ -113,6 +112,8 @@ public class NMS {
|
||||
|
||||
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())
|
||||
@ -689,8 +690,8 @@ public class NMS {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user