mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-04 07:27:59 +01:00
Update push event handling
This commit is contained in:
parent
073ee8a65f
commit
be84708f90
@ -59,7 +59,8 @@ public class CitizensBlazeNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -68,8 +69,11 @@ public class CitizensBlazeNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -66,7 +66,8 @@ public class CitizensCaveSpiderNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,8 +76,11 @@ public class CitizensCaveSpiderNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -51,7 +51,8 @@ public class CitizensChickenNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -60,8 +61,11 @@ public class CitizensChickenNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -51,7 +51,8 @@ public class CitizensCowNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -60,8 +61,11 @@ public class CitizensCowNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -65,7 +65,8 @@ public class CitizensCreeperNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -74,8 +75,11 @@ public class CitizensCreeperNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -53,7 +53,8 @@ public class CitizensEnderDragonNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -70,8 +71,11 @@ public class CitizensEnderDragonNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -106,7 +106,8 @@ public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -125,8 +126,11 @@ public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -59,7 +59,8 @@ public class CitizensGhastNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -68,8 +69,11 @@ public class CitizensGhastNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -55,7 +55,8 @@ public class CitizensGiantNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -64,8 +65,11 @@ public class CitizensGiantNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -54,7 +54,8 @@ public class CitizensIronGolemNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,8 +64,11 @@ public class CitizensIronGolemNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -69,7 +69,8 @@ public class CitizensMagmaCubeNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,8 +79,11 @@ public class CitizensMagmaCubeNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -51,7 +51,8 @@ public class CitizensMushroomCowNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -60,8 +61,11 @@ public class CitizensMushroomCowNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -58,7 +58,8 @@ public class CitizensOcelotNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -67,8 +68,11 @@ public class CitizensOcelotNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -84,7 +84,8 @@ public class CitizensPigNPC extends CitizensMobNPC implements Equipable {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -93,8 +94,11 @@ public class CitizensPigNPC extends CitizensMobNPC implements Equipable {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -68,7 +68,8 @@ public class CitizensPigZombieNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,8 +78,11 @@ public class CitizensPigZombieNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -89,7 +89,8 @@ public class CitizensSheepNPC extends CitizensMobNPC implements Equipable {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,8 +99,11 @@ public class CitizensSheepNPC extends CitizensMobNPC implements Equipable {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -68,7 +68,8 @@ public class CitizensSilverfishNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,8 +78,11 @@ public class CitizensSilverfishNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -58,7 +58,8 @@ public class CitizensSkeletonNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -67,8 +68,11 @@ public class CitizensSkeletonNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -69,7 +69,8 @@ public class CitizensSlimeNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,8 +79,11 @@ public class CitizensSlimeNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -54,7 +54,8 @@ public class CitizensSnowmanNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,8 +64,11 @@ public class CitizensSnowmanNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -67,7 +67,8 @@ public class CitizensSpiderNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -76,8 +77,11 @@ public class CitizensSpiderNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -59,7 +59,8 @@ public class CitizensSquidNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -68,8 +69,11 @@ public class CitizensSquidNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -66,7 +66,8 @@ public class CitizensVillagerNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,8 +76,11 @@ public class CitizensVillagerNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -58,7 +58,8 @@ public class CitizensWolfNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -67,8 +68,11 @@ public class CitizensWolfNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -58,7 +58,8 @@ public class CitizensZombieNPC extends CitizensMobNPC {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -67,8 +68,11 @@ public class CitizensZombieNPC extends CitizensMobNPC {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
@ -40,7 +40,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
Util.callCollisionEvent(npc, entity);
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -49,8 +50,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||||||
super.g(x, y, z);
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0)
|
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||||
|
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))
|
||||||
|
super.g(x, y, z);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Vector vector = new Vector(x, y, z);
|
Vector vector = new Vector(x, y, z);
|
||||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user