diff --git a/src/main/java/net/citizensnpcs/npc/entity/BatController.java b/src/main/java/net/citizensnpcs/npc/entity/BatController.java index b162498e0..7974043ef 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/BatController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/BatController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftBat; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.Bat; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class BatController extends MobEntityController { @@ -136,14 +134,5 @@ public class BatController extends MobEntityController { public void setFlying(boolean flying) { a(flying); } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java b/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java index 8f856e1b3..2c047395d 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftBlaze; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.Blaze; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class BlazeController extends MobEntityController { @@ -123,14 +121,5 @@ public class BlazeController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java b/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java index 369551c4b..b9385b4ea 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftCaveSpider; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.CaveSpider; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class CaveSpiderController extends MobEntityController { @@ -131,14 +129,5 @@ public class CaveSpiderController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java b/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java index fb0e17d4c..d559c6630 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftChicken; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.Chicken; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class ChickenController extends MobEntityController { @@ -120,14 +118,5 @@ public class ChickenController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/CowController.java b/src/main/java/net/citizensnpcs/npc/entity/CowController.java index 199a8104e..f369076f2 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CowController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftCow; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.Cow; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class CowController extends MobEntityController { @@ -121,14 +119,5 @@ public class CowController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java b/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java index da967f4be..5d39c42ec 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -17,7 +16,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftCreeper; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.Creeper; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class CreeperController extends MobEntityController { @@ -133,14 +131,5 @@ public class CreeperController extends MobEntityController { public void setAllowPowered(boolean allowPowered) { this.allowPowered = allowPowered; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java b/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java index c52161f0d..37d96bded 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEnderDragon; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.EnderDragon; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class EnderDragonController extends MobEntityController { @@ -144,14 +142,5 @@ public class EnderDragonController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java b/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java index 813350736..93aedce45 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEnderman; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.entity.Enderman; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class EndermanController extends MobEntityController { @@ -150,15 +148,6 @@ public class EndermanController extends MobEntityController { return false; } - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } - private void updateAIWithMovement() { NMS.updateAI(this); // taken from EntityLiving update method diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index a501ff518..6ec80c0fc 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -6,7 +6,6 @@ import java.util.List; import net.citizensnpcs.Settings.Setting; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; @@ -42,7 +41,6 @@ import org.bukkit.Location; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer; -import org.bukkit.entity.LivingEntity; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.util.Vector; @@ -228,14 +226,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { controllerMove.a(x, y, z, speed); } - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent(new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } - public void setShouldJump() { controllerJump.a(); } diff --git a/src/main/java/net/citizensnpcs/npc/entity/GhastController.java b/src/main/java/net/citizensnpcs/npc/entity/GhastController.java index 05a3ce2ae..338844375 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GhastController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GhastController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftGhast; import org.bukkit.entity.Ghast; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class GhastController extends MobEntityController { @@ -107,15 +105,6 @@ public class GhastController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class GhastNPC extends CraftGhast implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/GiantController.java b/src/main/java/net/citizensnpcs/npc/entity/GiantController.java index fd4c0ff1f..264d8a482 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GiantController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GiantController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftGiant; import org.bukkit.entity.Giant; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class GiantController extends MobEntityController { @@ -109,15 +107,6 @@ public class GiantController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class GiantNPC extends CraftGiant implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/HorseController.java b/src/main/java/net/citizensnpcs/npc/entity/HorseController.java index 09645fe1f..48eb808ac 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/HorseController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/HorseController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -18,7 +17,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftHorse; import org.bukkit.entity.Horse; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class HorseController extends MobEntityController { @@ -122,15 +120,6 @@ public class HorseController extends MobEntityController { return npc; } - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } - private void updateAIWithMovement() { NMS.updateAI(this); // taken from EntityLiving update method diff --git a/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java b/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java index fe84a22a7..ed93c55c4 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftIronGolem; import org.bukkit.entity.IronGolem; -import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; public class IronGolemController extends MobEntityController { @@ -106,15 +104,6 @@ public class IronGolemController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class IronGolemNPC extends CraftIronGolem implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java b/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java index 6fc6c2728..a79d335ee 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftMagmaCube; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.MagmaCube; import org.bukkit.util.Vector; @@ -117,15 +115,6 @@ public class MagmaCubeController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class MagmaCubeNPC extends CraftMagmaCube implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java b/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java index b4ae93fae..9ed38e8fe 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftMushroomCow; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.MushroomCow; import org.bukkit.util.Vector; @@ -107,15 +105,6 @@ public class MushroomCowController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class MushroomCowNPC extends CraftMushroomCow implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java b/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java index 35f293d3b..a71784344 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftOcelot; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Ocelot; import org.bukkit.util.Vector; @@ -107,15 +105,6 @@ public class OcelotController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class OcelotNPC extends CraftOcelot implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/PigController.java b/src/main/java/net/citizensnpcs/npc/entity/PigController.java index fad2e5a0c..b37e8a5c1 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/PigController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/PigController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPig; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Pig; import org.bukkit.util.Vector; @@ -113,15 +111,6 @@ public class PigController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class PigNPC extends CraftPig implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java b/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java index d73c24ec1..36c171df1 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPigZombie; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.PigZombie; import org.bukkit.util.Vector; @@ -117,15 +115,6 @@ public class PigZombieController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class PigZombieNPC extends CraftPigZombie implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SheepController.java b/src/main/java/net/citizensnpcs/npc/entity/SheepController.java index 8e0e35e07..ad1eb9bc7 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SheepController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SheepController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSheep; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Sheep; import org.bukkit.util.Vector; @@ -107,15 +105,6 @@ public class SheepController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SheepNPC extends CraftSheep implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java b/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java index a31da0969..486339724 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSilverfish; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Silverfish; import org.bukkit.util.Vector; @@ -116,15 +114,6 @@ public class SilverfishController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SilverfishNPC extends CraftSilverfish implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java b/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java index 6936aa087..ce66a1663 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSkeleton; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Skeleton; import org.bukkit.util.Vector; @@ -106,15 +104,6 @@ public class SkeletonController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SkeletonNPC extends CraftSkeleton implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java b/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java index 1f2fcd0cd..b6c3c4e0f 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSlime; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Slime; import org.bukkit.util.Vector; @@ -118,15 +116,6 @@ public class SlimeController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SlimeNPC extends CraftSlime implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java b/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java index 7ce45e0e0..910f3f327 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSnowman; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Snowman; import org.bukkit.util.Vector; @@ -106,15 +104,6 @@ public class SnowmanController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SnowmanNPC extends CraftSnowman implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java b/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java index 51d503902..de5a6023c 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSpider; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Spider; import org.bukkit.util.Vector; @@ -116,15 +114,6 @@ public class SpiderController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SpiderNPC extends CraftSpider implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SquidController.java b/src/main/java/net/citizensnpcs/npc/entity/SquidController.java index 939ae36be..536adc1ee 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SquidController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SquidController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftSquid; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Squid; import org.bukkit.util.Vector; @@ -107,15 +105,6 @@ public class SquidController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class SquidNPC extends CraftSquid implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java b/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java index 68a359687..1093e3853 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -16,7 +15,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftVillager; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Villager; import org.bukkit.util.Vector; @@ -122,15 +120,6 @@ public class VillagerController extends MobEntityController { public void setBlockTrades(boolean blocked) { this.blockTrades = blocked; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class VillagerNPC extends CraftVillager implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/WitchController.java b/src/main/java/net/citizensnpcs/npc/entity/WitchController.java index c3ad52308..2e6a9a0ea 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WitchController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WitchController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftWitch; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Witch; import org.bukkit.util.Vector; @@ -106,15 +104,6 @@ public class WitchController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class WitchNPC extends CraftWitch implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/WitherController.java b/src/main/java/net/citizensnpcs/npc/entity/WitherController.java index 7f7e887db..c4db41cb9 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WitherController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WitherController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftWither; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Wither; import org.bukkit.util.Vector; @@ -118,15 +116,6 @@ public class WitherController extends MobEntityController { return npc; } - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } - private void updateAIWithMovement() { NMS.updateAI(this); // taken from EntityLiving update method diff --git a/src/main/java/net/citizensnpcs/npc/entity/WolfController.java b/src/main/java/net/citizensnpcs/npc/entity/WolfController.java index f9709a25b..198e948c8 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WolfController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WolfController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftWolf; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Wolf; import org.bukkit.util.Vector; @@ -107,15 +105,6 @@ public class WolfController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class WolfNPC extends CraftWolf implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java b/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java index 471a19cba..812b9b624 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java @@ -1,7 +1,6 @@ package net.citizensnpcs.npc.entity; import net.citizensnpcs.api.event.NPCPushEvent; -import net.citizensnpcs.api.event.NPCVehicleExitEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; @@ -15,7 +14,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_6_R2.CraftServer; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftZombie; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Zombie; import org.bukkit.util.Vector; @@ -107,15 +105,6 @@ public class ZombieController extends MobEntityController { public NPC getNPC() { return npc; } - - @Override - public void setPassengerOf(net.minecraft.server.v1_6_R2.Entity entity) { - if (npc != null && entity == null && vehicle != null && vehicle.getBukkitEntity() instanceof LivingEntity) { - Bukkit.getPluginManager().callEvent( - new NPCVehicleExitEvent(npc, (LivingEntity) vehicle.getBukkitEntity())); - } - super.setPassengerOf(entity); - } } public static class ZombieNPC extends CraftZombie implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/trait/Controllable.java b/src/main/java/net/citizensnpcs/trait/Controllable.java index f7f071773..6bf00fce9 100644 --- a/src/main/java/net/citizensnpcs/trait/Controllable.java +++ b/src/main/java/net/citizensnpcs/trait/Controllable.java @@ -119,8 +119,9 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab public boolean mount(Player toMount) { Entity passenger = npc.getBukkitEntity().getPassenger(); - if (passenger != null && passenger != toMount) + if (passenger != null && passenger != toMount) { return false; + } enterOrLeaveVehicle(toMount); return true; } @@ -196,8 +197,9 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab @Override public boolean toggle() { enabled = !enabled; - if (!enabled && getHandle().passenger != null) + if (!enabled && getHandle().passenger != null) { getHandle().passenger.getBukkitEntity().leaveVehicle(); + } return enabled; }