diff options
Diffstat (limited to 'src/main')
4 files changed, 17 insertions, 85 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index 9bb96e21..c5bd46be 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -4,8 +4,6 @@ import java.util.List; // CraftBukkit start import org.bukkit.Location; -import org.bukkit.craftbukkit.entity.CraftBoat; -import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.entity.Vehicle; @@ -31,14 +29,6 @@ public class EntityBoat extends Entity { private double am; // CraftBukkit start - private void handleCreation(World world) { - CraftServer server = ((WorldServer) world).getServer(); - Type eventType = Type.VEHICLE_CREATE; - Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - VehicleCreateEvent event = new VehicleCreateEvent(eventType, vehicle); - server.getPluginManager().callEvent(event); - } - public void c(Entity entity) { CraftServer server = ((WorldServer) this.world).getServer(); Type eventType = Type.VEHICLE_COLLISION_ENTITY; @@ -91,7 +81,13 @@ public class EntityBoat extends Entity { this.lastY = d1; this.lastZ = d2; - handleCreation(world); // CraftBukkit + // CraftBukkit start + CraftServer server = ((WorldServer) world).getServer(); + Type eventType = Type.VEHICLE_CREATE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + VehicleCreateEvent event = new VehicleCreateEvent(eventType, vehicle); + server.getPluginManager().callEvent(event); + // CraftBukkit end } public double k() { diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index e9db574a..5cbc07b6 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -4,12 +4,7 @@ import java.util.List; // CraftBukkit start import org.bukkit.Location; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.entity.CraftPoweredMinecart; -import org.bukkit.craftbukkit.entity.CraftStorageMinecart; -import org.bukkit.craftbukkit.CraftMappable; import org.bukkit.craftbukkit.CraftWorld; -import org.bukkit.craftbukkit.entity.CraftMinecart; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Vehicle; import org.bukkit.event.Event.Type; @@ -50,26 +45,6 @@ public class EntityMinecart extends Entity implements IInventory { public ItemStack[] getContents() { return this.al; } - - private void handleCreation(World world) { - CraftServer server = ((WorldServer) world).getServer(); - Type eventType = Type.VEHICLE_CREATE; - Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - - VehicleCreateEvent event = new VehicleCreateEvent(eventType, vehicle); - server.getPluginManager().callEvent(event); - } - - @Override - public org.bukkit.entity.Entity getBukkitEntity(){ - if (this.d == CraftMinecart.Type.StorageMinecart.getId()) { - return this.bukkitStorageMinecart; - } else if (this.d == CraftMinecart.Type.PoweredMinecart.getId()) { - return this.bukkitPoweredMinecart; - } else { - return this.bukkitEntity; - } - } // CraftBukkit end public EntityMinecart(World world) { @@ -86,10 +61,11 @@ public class EntityMinecart extends Entity implements IInventory { // CraftBukkit start CraftServer server = ((WorldServer) this.world).getServer(); - this.bukkitEntity = new CraftMinecart(server, this); - this.bukkitPoweredMinecart = new CraftPoweredMinecart(server, this); - this.bukkitStorageMinecart = new CraftStorageMinecart(server, this); - handleCreation(world); + Type eventType = Type.VEHICLE_CREATE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + + VehicleCreateEvent event = new VehicleCreateEvent(eventType, vehicle); + server.getPluginManager().callEvent(event); // CraftBukkit end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftMappable.java b/src/main/java/org/bukkit/craftbukkit/CraftMappable.java deleted file mode 100644 index da0c2bce..00000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftMappable.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.bukkit.craftbukkit; - -import org.bukkit.craftbukkit.entity.CraftEntity; - -/** - * Indicates that an object has a method to get its CraftBukkit-equivalent - * CraftEntity object from its Minecraft net.minecraft.server.Entity object. - * - * @author sk89q - */ -/**@deprecated*/ -public interface CraftMappable { - /** - * Gets the CraftEntity version. - * - * @return - */ - public CraftEntity getCraftEntity(); -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java index de8114fd..a0cff41a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Minecart; /** * A minecart. - * + * * @author sk89q */ public class CraftMinecart extends CraftVehicle implements Minecart { @@ -18,18 +18,18 @@ public class CraftMinecart extends CraftVehicle implements Minecart { Minecart(0), StorageMinecart(1), PoweredMinecart(2); - + private final int id; - + private Type(int id) { this.id = id; } - + public int getId() { return id; } } - + protected EntityMinecart minecart; public CraftMinecart(CraftServer server, EntityMinecart entity) { @@ -44,27 +44,6 @@ public class CraftMinecart extends CraftVehicle implements Minecart { public int getDamage() { return minecart.a; } - - /** - * Internal function to convert an MC entity to an appropriate CraftBukkit - * entity. - * - * @param server - * @param minecart - * @return - * - * @deprecated - */ - public static CraftMinecart getCraftMinecart(CraftServer server, - EntityMinecart minecart) { - if (minecart.d == Type.StorageMinecart.getId()) { - return new CraftStorageMinecart(server, minecart); - } else if (minecart.d == Type.PoweredMinecart.getId()) { - return new CraftPoweredMinecart(server, minecart); - } else { - return new CraftMinecart(server, minecart); - } - } @Override public String toString() { |