diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java | 26 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftVehicle.java | 27 |
2 files changed, 26 insertions, 27 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index f404fd47..6fa8f87d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -196,4 +196,30 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setMomentum(Vector value) { setVelocity(value); } + + public CraftEntity getPassenger() { + return isEmpty() ? null : (CraftEntity) getHandle().passenger.getBukkitEntity(); + } + + public boolean setPassenger(org.bukkit.entity.Entity passenger) { + if (passenger instanceof CraftEntity){ + ((CraftEntity) passenger).getHandle().setPassengerOf(getHandle()); + return true; + } else { + return false; + } + } + + public boolean isEmpty() { + return getHandle().passenger == null; + } + + public boolean eject() { + if (getHandle().passenger == null) { + return false; + } + + getHandle().passenger.setPassengerOf(null); + return true; + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVehicle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVehicle.java index 20c52a9d..af72ba07 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVehicle.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVehicle.java @@ -1,7 +1,6 @@ package org.bukkit.craftbukkit.entity; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.entity.Entity; import org.bukkit.entity.Vehicle; /** @@ -14,32 +13,6 @@ public abstract class CraftVehicle extends CraftEntity implements Vehicle { super(server, entity); } - public Entity getPassenger() { - return isEmpty() ? null : (getHandle().passenger.getBukkitEntity()); - } - - public boolean setPassenger(Entity passenger) { - if (passenger instanceof CraftEntity){ - ((CraftEntity)passenger).getHandle().setPassengerOf(getHandle()); - return true; - } else { - return false; - } - } - - public boolean isEmpty() { - return getHandle().passenger == null; - } - - public boolean eject() { - if (getHandle().passenger == null) { - return false; - } - - getHandle().passenger.setPassengerOf(null); - return true; - } - @Override public String toString() { return "CraftVehicle{passenger=" + getPassenger() + '}'; |