mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 12:43:52 -07:00
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:
@@ -65,5 +65,24 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
|
|||||||
public int getDamage() {
|
public int getDamage() {
|
||||||
return minecart.a;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user