From 5aa95ee469f1f18b439a9a6d423545021b8a49c4 Mon Sep 17 00:00:00 2001 From: afforess Date: Sat, 12 Feb 2011 15:57:16 +0100 Subject: Added MaxSpeed methods to minecarts. Added MaxSpeed methods to boats. Added SlowWhenEmpty, FlyingMod, and DerailedMod methods to minecarts. --- .../org/bukkit/craftbukkit/entity/CraftBoat.java | 10 ++++++ .../bukkit/craftbukkit/entity/CraftMinecart.java | 39 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'src/main/java/org') diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java index 0712edce..ccb83e32 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java @@ -17,6 +17,16 @@ public class CraftBoat extends CraftVehicle implements Boat { boat = entity; } + public double getMaxSpeed() { + return boat.maxSpeed; + } + + public void setMaxSpeed(double speed) { + if (speed >= 0D) { + boat.maxSpeed = speed; + } + } + @Override public String toString() { return "CraftBoat"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java index a0cff41a..cbaa5c90 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntityMinecart; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Minecart; +import org.bukkit.util.Vector; /** * A minecart. @@ -45,6 +46,44 @@ public class CraftMinecart extends CraftVehicle implements Minecart { return minecart.a; } + public double getMaxSpeed() { + return minecart.maxSpeed; + } + + public void setMaxSpeed(double speed) { + if (speed >= 0D) { + minecart.maxSpeed = speed; + } + } + + public boolean isSlowWhenEmpty() { + return minecart.slowWhenEmpty; + } + + public void setSlowWhenEmpty(boolean slow) { + minecart.slowWhenEmpty = slow; + } + + public Vector getFlyingVelocityMod() { + return new Vector(minecart.flyingX, minecart.flyingY, minecart.flyingZ); + } + + public void setFlyingVelocityMod(Vector flying) { + minecart.flyingX = flying.getX(); + minecart.flyingY = flying.getY(); + minecart.flyingZ = flying.getZ(); + } + + public Vector getDerailedVelocityMod() { + return new Vector(minecart.derailedX, minecart.derailedY, minecart.derailedZ); + } + + public void setDerailedVelocityMod(Vector derailed) { + minecart.derailedX = derailed.getX(); + minecart.derailedY = derailed.getY(); + minecart.derailedZ = derailed.getZ(); + } + @Override public String toString() { return "CraftMinecart"; -- cgit v1.2.3