diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBoat.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBoat.java new file mode 100644 index 0000000000..dd3acb62df --- /dev/null +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBoat.java @@ -0,0 +1,18 @@ +package org.bukkit.craftbukkit; + +import net.minecraft.server.EntityBoat; +import org.bukkit.Boat; + +/** + * A minecart. + * + * @author sk89q + */ +public class CraftBoat extends CraftVehicle implements Boat { + protected EntityBoat boat; + + public CraftBoat(CraftServer server, EntityBoat entity) { + super(server, entity); + boat = entity; + } +} 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 583f7dbd17..0d55ad8219 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java @@ -1,9 +1,7 @@ package org.bukkit.craftbukkit; import net.minecraft.server.EntityMinecart; -import org.bukkit.LivingEntity; import org.bukkit.Minecart; -import org.bukkit.Vector; /** * A minecart. @@ -38,16 +36,6 @@ public class CraftMinecart extends CraftVehicle implements Minecart { minecart = entity; } - public Vector getVelocity() { - return new Vector(minecart.s, minecart.t, minecart.u); - } - - public void setVelocity(Vector vel) { - minecart.s = vel.getX(); - minecart.t = vel.getY(); - minecart.u = vel.getZ(); - } - 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 c978b8b7df..42671c13b2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftVehicle.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit; import org.bukkit.Entity; +import org.bukkit.Vector; import org.bukkit.Vehicle; /** @@ -9,8 +10,11 @@ import org.bukkit.Vehicle; * @author sk89q */ public abstract class CraftVehicle extends CraftEntity implements Vehicle { + private net.minecraft.server.Entity vehicle; + public CraftVehicle(CraftServer server, net.minecraft.server.Entity entity) { super(server, entity); + vehicle = entity; } public Entity getPassenger() { @@ -20,4 +24,14 @@ public abstract class CraftVehicle extends CraftEntity implements Vehicle { public boolean isEmpty() { return getHandle().j == null; } + + public Vector getVelocity() { + return new Vector(vehicle.s, vehicle.t, vehicle.u); + } + + public void setVelocity(Vector vel) { + vehicle.s = vel.getX(); + vehicle.t = vel.getY(); + vehicle.u = vel.getZ(); + } }