mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-29 03:21:36 +01:00
Allow vulnerable projectiles to damage entities, implement NPCEnderTeleportEvent
This commit is contained in:
parent
3ca1e03efe
commit
be90295e10
2
pom.xml
2
pom.xml
@ -11,7 +11,7 @@
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<craftbukkit.version>1.8.7-R0.1-SNAPSHOT</craftbukkit.version>
|
||||
<craftbukkit.version>1.8.8-R0.1-SNAPSHOT</craftbukkit.version>
|
||||
<citizensapi.version>2.0.16-SNAPSHOT</citizensapi.version>
|
||||
<vault.version>1.5.4</vault.version>
|
||||
<powermock.version>1.4.12</powermock.version>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.citizensnpcs.npc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -83,13 +84,13 @@ public class CitizensNPC extends AbstractNPC {
|
||||
if (!keepSelected) {
|
||||
data().remove("selectors");
|
||||
}
|
||||
for (Trait trait : traits.values()) {
|
||||
trait.onDespawn();
|
||||
}
|
||||
navigator.onDespawn();
|
||||
if (reason == DespawnReason.RELOAD) {
|
||||
unloadEvents();
|
||||
}
|
||||
for (Trait trait : new ArrayList<Trait>(traits.values())) {
|
||||
trait.onDespawn();
|
||||
}
|
||||
entityController.remove();
|
||||
|
||||
return true;
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Bat;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -116,6 +117,17 @@ public class BatController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -1,5 +1,13 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftBlaze;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Blaze;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -11,13 +19,6 @@ import net.minecraft.server.v1_8_R3.EntityBlaze;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftBlaze;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Blaze;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BlazeController extends MobEntityController {
|
||||
public BlazeController() {
|
||||
super(EntityBlazeNPC.class);
|
||||
@ -109,6 +110,17 @@ public class BlazeController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.CaveSpider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -128,6 +129,17 @@ public class CaveSpiderController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Chicken;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -137,6 +138,17 @@ public class ChickenController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Cow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -138,6 +139,17 @@ public class CowController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -133,6 +134,17 @@ public class CreeperController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -101,6 +102,17 @@ public class EnderDragonController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -124,6 +125,17 @@ public class EndermanController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Endermite;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -124,6 +125,17 @@ public class EndermiteController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -19,6 +19,7 @@ import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.MetadataStore;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
@ -139,6 +140,17 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGhast;
|
||||
import org.bukkit.entity.Ghast;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -100,6 +101,17 @@ public class GhastController extends MobEntityController {
|
||||
super.E();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGiant;
|
||||
import org.bukkit.entity.Giant;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -103,6 +104,17 @@ public class GiantController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGuardian;
|
||||
import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -104,6 +105,17 @@ public class GuardianController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHorse;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -142,6 +143,17 @@ public class HorseController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftIronGolem;
|
||||
import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -110,6 +111,17 @@ public class IronGolemController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMagmaCube;
|
||||
import org.bukkit.entity.MagmaCube;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -120,6 +121,17 @@ public class MagmaCubeController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMushroomCow;
|
||||
import org.bukkit.entity.MushroomCow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -122,6 +123,17 @@ public class MushroomCowController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftOcelot;
|
||||
import org.bukkit.entity.Ocelot;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -121,6 +122,17 @@ public class OcelotController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -1,5 +1,13 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPig;
|
||||
import org.bukkit.entity.Pig;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -14,13 +22,6 @@ import net.minecraft.server.v1_8_R3.EntityPig;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPig;
|
||||
import org.bukkit.entity.Pig;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class PigController extends MobEntityController {
|
||||
public PigController() {
|
||||
super(EntityPigNPC.class);
|
||||
@ -123,6 +124,17 @@ public class PigController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -1,5 +1,13 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPigZombie;
|
||||
import org.bukkit.entity.PigZombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -13,13 +21,6 @@ import net.minecraft.server.v1_8_R3.EntityPigZombie;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPigZombie;
|
||||
import org.bukkit.entity.PigZombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class PigZombieController extends MobEntityController {
|
||||
|
||||
public PigZombieController() {
|
||||
@ -97,6 +98,13 @@ public class PigZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void E() {
|
||||
super.E();
|
||||
@ -105,9 +113,13 @@ public class PigZombieController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftRabbit;
|
||||
import org.bukkit.entity.Rabbit;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -126,6 +127,17 @@ public class RabbitController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -1,5 +1,13 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSheep;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -13,13 +21,6 @@ import net.minecraft.server.v1_8_R3.EntitySheep;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSheep;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class SheepController extends MobEntityController {
|
||||
public SheepController() {
|
||||
super(EntitySheepNPC.class);
|
||||
@ -107,6 +108,13 @@ public class SheepController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void E() {
|
||||
super.E();
|
||||
@ -115,9 +123,13 @@ public class SheepController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSilverfish;
|
||||
import org.bukkit.entity.Silverfish;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -110,6 +111,17 @@ public class SilverfishController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton;
|
||||
import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -111,6 +112,17 @@ public class SkeletonController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSlime;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -131,6 +132,17 @@ public class SlimeController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSnowman;
|
||||
import org.bukkit.entity.Snowman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -110,6 +111,17 @@ public class SnowmanController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSpider;
|
||||
import org.bukkit.entity.Spider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -110,6 +111,17 @@ public class SpiderController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSquid;
|
||||
import org.bukkit.entity.Squid;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -103,6 +104,17 @@ public class SquidController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftVillager;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -132,6 +133,17 @@ public class VillagerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWitch;
|
||||
import org.bukkit.entity.Witch;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -110,6 +111,17 @@ public class WitchController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWither;
|
||||
import org.bukkit.entity.Wither;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -95,6 +96,17 @@ public class WitherController extends MobEntityController {
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
@ -1,5 +1,13 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -13,13 +21,6 @@ import net.minecraft.server.v1_8_R3.EntityWolf;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class WolfController extends MobEntityController {
|
||||
public WolfController() {
|
||||
super(EntityWolfNPC.class);
|
||||
@ -108,6 +109,13 @@ public class WolfController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void E() {
|
||||
super.E();
|
||||
@ -117,9 +125,13 @@ public class WolfController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,13 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftZombie;
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -13,13 +21,6 @@ import net.minecraft.server.v1_8_R3.EntityZombie;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftZombie;
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class ZombieController extends MobEntityController {
|
||||
public ZombieController() {
|
||||
super(EntityZombieNPC.class);
|
||||
@ -96,6 +97,13 @@ public class ZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void E() {
|
||||
super.E();
|
||||
@ -105,9 +113,13 @@ public class ZombieController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
if (npc == null)
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
NPCEnderTeleportEvent event = new NPCEnderTeleportEvent(npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
super.enderTeleportTo(d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,6 +123,9 @@ public class EggController extends AbstractEntityController {
|
||||
public void t_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.t_();
|
||||
}
|
||||
} else {
|
||||
super.t_();
|
||||
}
|
||||
|
@ -107,6 +107,9 @@ public class EnderPearlController extends MobEntityController {
|
||||
public void t_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.t_();
|
||||
}
|
||||
} else {
|
||||
super.t_();
|
||||
}
|
||||
|
@ -103,6 +103,9 @@ public class LargeFireballController extends MobEntityController {
|
||||
public void t_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.t_();
|
||||
}
|
||||
} else {
|
||||
super.t_();
|
||||
}
|
||||
|
@ -1,5 +1,12 @@
|
||||
package net.citizensnpcs.npc.entity.nonliving;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSmallFireball;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -10,13 +17,6 @@ import net.minecraft.server.v1_8_R3.EntitySmallFireball;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSmallFireball;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class SmallFireballController extends MobEntityController {
|
||||
public SmallFireballController() {
|
||||
super(EntitySmallFireballNPC.class);
|
||||
@ -34,11 +34,6 @@ public class SmallFireballController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntitySmallFireballNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -54,6 +49,11 @@ public class SmallFireballController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
@ -93,6 +93,9 @@ public class SmallFireballController extends MobEntityController {
|
||||
public void t_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.t_();
|
||||
}
|
||||
} else {
|
||||
super.t_();
|
||||
}
|
||||
|
@ -1,5 +1,12 @@
|
||||
package net.citizensnpcs.npc.entity.nonliving;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftThrownExpBottle;
|
||||
import org.bukkit.entity.ThrownExpBottle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -10,13 +17,6 @@ import net.minecraft.server.v1_8_R3.EntityThrownExpBottle;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftThrownExpBottle;
|
||||
import org.bukkit.entity.ThrownExpBottle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class ThrownExpBottleController extends MobEntityController {
|
||||
public ThrownExpBottleController() {
|
||||
super(EntityThrownExpBottleNPC.class);
|
||||
@ -39,11 +39,6 @@ public class ThrownExpBottleController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_8_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -54,6 +49,11 @@ public class ThrownExpBottleController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
@ -93,6 +93,9 @@ public class ThrownExpBottleController extends MobEntityController {
|
||||
public void t_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.t_();
|
||||
}
|
||||
} else {
|
||||
super.t_();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user