mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-17 13:41:32 +01:00
Use collision vector from event
This commit is contained in:
parent
288bcf5e9f
commit
b081ecd5ac
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user