diff options
author | sk89q <the.sk89q@gmail.com> | 2011-01-07 16:25:52 -0800 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-01-07 16:25:52 -0800 |
commit | 39999e2c9310496ca39016824d42130c13a18c28 (patch) | |
tree | cdaaee8eb7c8a8dfacb914dd41f5956187b546de /src/main/java | |
parent | b671546e927e04379b8a861fe528ba434ad7013a (diff) | |
download | bukkit-39999e2c9310496ca39016824d42130c13a18c28.tar bukkit-39999e2c9310496ca39016824d42130c13a18c28.tar.gz bukkit-39999e2c9310496ca39016824d42130c13a18c28.tar.lz bukkit-39999e2c9310496ca39016824d42130c13a18c28.tar.xz bukkit-39999e2c9310496ca39016824d42130c13a18c28.zip |
Added passenger methods to Vehicle/LivingEntity.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/LivingEntity.java | 24 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Vehicle.java | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/LivingEntity.java b/src/main/java/org/bukkit/LivingEntity.java index d1bd9180..f0987ba2 100644 --- a/src/main/java/org/bukkit/LivingEntity.java +++ b/src/main/java/org/bukkit/LivingEntity.java @@ -35,4 +35,28 @@ public interface LivingEntity extends Entity { * @return */ public Arrow shootArrow(); + + /** + * Returns whether this entity is inside a vehicle. + * + * @return + */ + public boolean isInsideVehicle(); + + /** + * Leave the current vehicle. If the entity is currently in a vehicle + * (and is removed from it), true will be returned, otherwise false will + * be returned. + * + * @return + */ + public boolean leaveVehicle(); + + /** + * Get the vehicle that this player is inside. If there is no vehicle, + * null will be returned. + * + * @return + */ + public Vehicle getVehicle(); } diff --git a/src/main/java/org/bukkit/Vehicle.java b/src/main/java/org/bukkit/Vehicle.java index 6fb95b8c..76b7267b 100644 --- a/src/main/java/org/bukkit/Vehicle.java +++ b/src/main/java/org/bukkit/Vehicle.java @@ -29,9 +29,24 @@ public interface Vehicle extends Entity { public Entity getPassenger();
/**
+ * Set the passenger of a vehicle.
+ *
+ * @param passenger
+ * @return false if it could not be done for whatever reason
+ */
+ public boolean setPassenger(Entity passenger);
+
+ /**
* Returns true if the vehicle has no passengers.
*
* @return
*/
public boolean isEmpty();
+
+ /**
+ * Eject any passenger. True if there was a passenger.
+ *
+ * @return
+ */
+ public boolean eject();
}
|