diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensBlazeNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensBlazeNPC.java index f09bb3618..15a6ff1f7 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensBlazeNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensBlazeNPC.java @@ -63,9 +63,12 @@ public class CitizensBlazeNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensCaveSpiderNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensCaveSpiderNPC.java index 372f68537..5aca32e7f 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensCaveSpiderNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensCaveSpiderNPC.java @@ -65,9 +65,12 @@ public class CitizensCaveSpiderNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensChickenNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensChickenNPC.java index 49d216b92..a4520aa8e 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensChickenNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensChickenNPC.java @@ -62,9 +62,12 @@ public class CitizensChickenNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensCowNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensCowNPC.java index 1564af098..9b8a24118 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensCowNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensCowNPC.java @@ -62,9 +62,12 @@ public class CitizensCowNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensCreeperNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensCreeperNPC.java index e405f1a87..e65a0fe28 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensCreeperNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensCreeperNPC.java @@ -69,12 +69,15 @@ public class CitizensCreeperNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the - // NPC - // so we prevent it from doing anything if the event is cancelled. + // NPC so we prevent it from doing anything if the event is + // cancelled. } @Override diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensEnderDragonNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensEnderDragonNPC.java index ecbe80993..850417820 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensEnderDragonNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensEnderDragonNPC.java @@ -65,9 +65,12 @@ public class CitizensEnderDragonNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensEndermanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensEndermanNPC.java index d31bd7b11..df81788c4 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensEndermanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensEndermanNPC.java @@ -115,9 +115,12 @@ public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensGhastNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensGhastNPC.java index f3997b962..838580c5f 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensGhastNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensGhastNPC.java @@ -63,9 +63,12 @@ public class CitizensGhastNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensGiantNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensGiantNPC.java index c0c8dda94..a8d653701 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensGiantNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensGiantNPC.java @@ -59,9 +59,12 @@ public class CitizensGiantNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensIronGolemNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensIronGolemNPC.java index 2b6de8294..2e324bd97 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensIronGolemNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensIronGolemNPC.java @@ -58,9 +58,12 @@ public class CitizensIronGolemNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensMagmaCubeNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensMagmaCubeNPC.java index 00cc0ed2a..5cfdcded7 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensMagmaCubeNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensMagmaCubeNPC.java @@ -71,9 +71,12 @@ public class CitizensMagmaCubeNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensMushroomCowNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensMushroomCowNPC.java index 9c192d768..f16ae8454 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensMushroomCowNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensMushroomCowNPC.java @@ -62,9 +62,12 @@ public class CitizensMushroomCowNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensOcelotNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensOcelotNPC.java index 4de61ddfc..2517fa3ce 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensOcelotNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensOcelotNPC.java @@ -62,9 +62,12 @@ public class CitizensOcelotNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensPigNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensPigNPC.java index 6ee041e25..4e42a0e86 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensPigNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensPigNPC.java @@ -95,9 +95,12 @@ public class CitizensPigNPC extends CitizensMobNPC implements Equipable { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensPigZombieNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensPigZombieNPC.java index a5895c94f..dd7071500 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensPigZombieNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensPigZombieNPC.java @@ -70,9 +70,12 @@ public class CitizensPigZombieNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSheepNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSheepNPC.java index c46b448be..70b4dd8b6 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSheepNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSheepNPC.java @@ -100,9 +100,12 @@ public class CitizensSheepNPC extends CitizensMobNPC implements Equipable { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSilverfishNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSilverfishNPC.java index adb81774c..70a0e60bc 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSilverfishNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSilverfishNPC.java @@ -70,9 +70,12 @@ public class CitizensSilverfishNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSkeletonNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSkeletonNPC.java index 71f6f69bb..e63ba34a7 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSkeletonNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSkeletonNPC.java @@ -62,9 +62,12 @@ public class CitizensSkeletonNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSlimeNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSlimeNPC.java index 8d49332ff..50735cb1c 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSlimeNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSlimeNPC.java @@ -71,9 +71,12 @@ public class CitizensSlimeNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSnowmanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSnowmanNPC.java index f68907e3c..47190befb 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSnowmanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSnowmanNPC.java @@ -57,9 +57,12 @@ public class CitizensSnowmanNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSpiderNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSpiderNPC.java index 9a85e15d3..83636be20 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSpiderNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSpiderNPC.java @@ -69,9 +69,12 @@ public class CitizensSpiderNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensSquidNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensSquidNPC.java index 6c3781f0a..89a69b0e3 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensSquidNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensSquidNPC.java @@ -63,9 +63,12 @@ public class CitizensSquidNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java index a5df6412b..518d37f8f 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java @@ -70,9 +70,12 @@ public class CitizensVillagerNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensWolfNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensWolfNPC.java index 86977ca14..5e4ecd290 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensWolfNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensWolfNPC.java @@ -62,9 +62,12 @@ public class CitizensWolfNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensZombieNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensZombieNPC.java index d393f6221..362f9be43 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensZombieNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensZombieNPC.java @@ -62,9 +62,12 @@ public class CitizensZombieNPC extends CitizensMobNPC { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } // when another entity collides, this method is called to push the // NPC so we prevent it from doing anything if the event is // cancelled. diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index 48a775ebe..c37e73bfb 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -63,11 +63,15 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { } if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) return; - NPCPushEvent event = Util.callPushEvent(npc, new Vector(x, y, z)); - if (!event.isCancelled()) - super.g(x, y, z); - // when another entity collides, this method is called to push the NPC - // so we prevent it from doing anything if the event is cancelled. + Vector vector = new Vector(x, y, z); + NPCPushEvent event = Util.callPushEvent(npc, vector); + if (!event.isCancelled()) { + vector = event.getCollisionVector(); + super.g(vector.getX(), vector.getY(), vector.getZ()); + } + // when another entity collides, this method is called to push the + // NPC so we prevent it from doing anything if the event is + // cancelled. } @Override