mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01: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:
parent
bccefe4c85
commit
e8b157df99
1 changed files with 19 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue