mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
Added passenger methods to Vehicle/LivingEntity.
This commit is contained in:
@@ -17,8 +17,22 @@ public abstract class CraftVehicle extends CraftEntity implements Vehicle {
|
||||
public Entity getPassenger() {
|
||||
return ((CraftWorld)getWorld()).toCraftEntity(getHandle().j);
|
||||
}
|
||||
|
||||
public boolean setPassenger(Entity passenger) {
|
||||
((CraftEntity)passenger).getHandle().setPassengerOf(getHandle());
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return getHandle().j == null;
|
||||
}
|
||||
|
||||
public boolean eject() {
|
||||
if (getHandle().j == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getHandle().j.setPassengerOf(null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user