Moved getVehicle, leaveVehicle and isInsideVehicle from CraftLivingEntity to CraftEntity. Addresses BUKKIT-811

This commit is contained in:
TomyLobo
2011-10-25 15:53:43 +02:00
committed by EvilSeph
parent 1394926e53
commit 53e4a034f4
2 changed files with 22 additions and 26 deletions

View File

@@ -128,32 +128,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return launchProjectile(Arrow.class);
}
public boolean isInsideVehicle() {
return getHandle().vehicle != null;
}
public boolean leaveVehicle() {
if (getHandle().vehicle == null) {
return false;
}
getHandle().setPassengerOf(null);
return true;
}
public Vehicle getVehicle() {
if (getHandle().vehicle == null) {
return null;
}
org.bukkit.entity.Entity vehicle = (getHandle().vehicle.getBukkitEntity());
if (vehicle instanceof Vehicle) {
return (Vehicle) vehicle;
}
return null;
}
public int getRemainingAir() {
return getHandle().getAirTicks();
}