Exemplo n.º 1
0
 @Override
 public void collide(net.minecraft.server.v1_4_5.Entity entity) {
   // this method is called by both the entities involved - cancelling
   // it will not stop the NPC from moving.
   super.collide(entity);
   if (npc != null) Util.callCollisionEvent(npc, entity.getBukkitEntity());
 }
Exemplo n.º 2
0
 @Override
 public void g(double x, double y, double z) {
   if (npc == null) {
     super.g(x, y, z);
     return;
   }
   if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
     if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) super.g(x, y, z);
     return;
   }
   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.
 }
Exemplo n.º 3
0
 @Override
 public void bl() {
   super.bl();
   if (npc != null) npc.update();
 }