diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java index 0ec37541a..e51a6277f 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java @@ -505,6 +505,9 @@ public class NMSImpl implements NMSBridge { @Override public org.bukkit.entity.Entity getVehicle(org.bukkit.entity.Entity entity) { Entity handle = NMSImpl.getHandle(entity); + if (handle == null) { + return null; + } Entity e = handle.getVehicle(); return (e == handle || e == null) ? null : e.getBukkitEntity(); } diff --git a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java index 8144d172b..9f02b3f0b 100644 --- a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java +++ b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java @@ -547,6 +547,9 @@ public class NMSImpl implements NMSBridge { @Override public org.bukkit.entity.Entity getVehicle(org.bukkit.entity.Entity entity) { Entity handle = NMSImpl.getHandle(entity); + if (handle == null) { + return null; + } Entity e = handle.getVehicle(); return (e == handle || e == null) ? null : e.getBukkitEntity(); } diff --git a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/OcelotController.java b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/OcelotController.java index 25c26647a..267751daf 100644 --- a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/OcelotController.java +++ b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/OcelotController.java @@ -84,8 +84,9 @@ public class OcelotController extends MobEntityController { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); - if (npc != null) + if (npc != null) { Util.callCollisionEvent(npc, entity.getBukkitEntity()); + } } @Override @@ -188,8 +189,9 @@ public class OcelotController extends MobEntityController { @Override public void M() { super.M(); - if (npc != null) + if (npc != null) { npc.update(); + } } @Override diff --git a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java index 232557d9a..ad344f288 100644 --- a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java +++ b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java @@ -551,6 +551,9 @@ public class NMSImpl implements NMSBridge { @Override public org.bukkit.entity.Entity getVehicle(org.bukkit.entity.Entity entity) { Entity handle = NMSImpl.getHandle(entity); + if (handle == null) { + return null; + } Entity e = handle.getVehicle(); return (e == handle || e == null) ? null : e.getBukkitEntity(); }