Remove NPCVehicleExitEvent

This commit is contained in:
fullwall 2013-08-18 14:04:15 +08:00
parent 57ead921a2
commit 2624eea3b1
31 changed files with 4 additions and 331 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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

View File

@ -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();
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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;
}