summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-01-07 12:01:37 -0800
committersk89q <the.sk89q@gmail.com>2011-01-07 12:07:16 -0800
commit7722e750effde5d34ed5b6f65062275a603eeda4 (patch)
tree9e2982b933ac0184fac0cec34e6fc4887ed26ef0 /src/main
parent4de1915f6ae201ed691395a27684e3db5d607f56 (diff)
downloadcraftbukkit-7722e750effde5d34ed5b6f65062275a603eeda4.tar
craftbukkit-7722e750effde5d34ed5b6f65062275a603eeda4.tar.gz
craftbukkit-7722e750effde5d34ed5b6f65062275a603eeda4.tar.lz
craftbukkit-7722e750effde5d34ed5b6f65062275a603eeda4.tar.xz
craftbukkit-7722e750effde5d34ed5b6f65062275a603eeda4.zip
Updated Minecart/vehicle Bukkit implementation.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftMinecart.java9
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftVehicle.java13
2 files changed, 10 insertions, 12 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java
index 44082603..583f7dbd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java
@@ -48,15 +48,6 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
minecart.u = vel.getZ();
}
- public LivingEntity getPassenger() {
- // @TODO: Implement
- return null;
- }
-
- public boolean isEmpty() {
- return minecart.j == null;
- }
-
public void setDamage(int damage) {
minecart.a = damage;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java b/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java
index a5c03868..c978b8b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java
@@ -1,7 +1,6 @@
package org.bukkit.craftbukkit;
-import net.minecraft.server.Entity;
-
+import org.bukkit.Entity;
import org.bukkit.Vehicle;
/**
@@ -10,7 +9,15 @@ import org.bukkit.Vehicle;
* @author sk89q
*/
public abstract class CraftVehicle extends CraftEntity implements Vehicle {
- public CraftVehicle(CraftServer server, Entity entity) {
+ public CraftVehicle(CraftServer server, net.minecraft.server.Entity entity) {
super(server, entity);
}
+
+ public Entity getPassenger() {
+ return ((CraftWorld)getWorld()).toCraftEntity(getHandle().j);
+ }
+
+ public boolean isEmpty() {
+ return getHandle().j == null;
+ }
}