Implemented some minecart vehicle hooks, but there's a some things missing in CraftBukkit before the implementation can be finished.

By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2011-01-03 01:28:06 -08:00
parent bccefe4c85
commit e8b157df99

View file

@ -65,5 +65,24 @@ 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
*/
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);
}
}
}