diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 6252884ab9..1efc870dc5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -9,6 +9,7 @@ import org.bukkit.Server; import org.bukkit.World; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.entity.Vehicle; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; @@ -342,4 +343,25 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void removeMetadata(String metadataKey, Plugin owningPlugin) { server.getEntityMetadata().removeMetadata(this, metadataKey, owningPlugin); } + + public boolean isInsideVehicle() { + return getHandle().vehicle != null; + } + + public boolean leaveVehicle() { + if (getHandle().vehicle == null) { + return false; + } + + getHandle().setPassengerOf(null); + return true; + } + + public org.bukkit.entity.Entity getVehicle() { + if (getHandle().vehicle == null) { + return null; + } + + return getHandle().vehicle.getBukkitEntity(); + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 9f69d74f15..c8a413a45d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -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(); }