From e44031b5c4ad12b13f5a3635161141b2c2185b41 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 7 Jan 2011 12:01:37 -0800 Subject: [PATCH] Updated Minecart/vehicle Bukkit implementation. By: sk89q --- .../java/org/bukkit/craftbukkit/CraftMinecart.java | 9 --------- .../java/org/bukkit/craftbukkit/CraftVehicle.java | 13 ++++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java index 44082603ba..583f7dbd17 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java +++ b/paper-server/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/paper-server/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java index a5c03868c4..c978b8b7df 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java +++ b/paper-server/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; + } }