Clean vehicle code.

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
CraftBukkit/Spigot 2011-02-01 23:52:36 +01:00
parent db46d059ce
commit 6a7e7141f8
2 changed files with 5 additions and 45 deletions

View file

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

View file

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