diff options
author | afforess <afforess@gmail.com> | 2011-02-12 15:57:16 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-02-12 16:14:43 +0100 |
commit | 5aa95ee469f1f18b439a9a6d423545021b8a49c4 (patch) | |
tree | 676446535c8915412b340aeb690ede07635d2a33 /src/main/java/org | |
parent | be9a264249ce40785c5f5b6463a1095ab6495be6 (diff) | |
download | craftbukkit-5aa95ee469f1f18b439a9a6d423545021b8a49c4.tar craftbukkit-5aa95ee469f1f18b439a9a6d423545021b8a49c4.tar.gz craftbukkit-5aa95ee469f1f18b439a9a6d423545021b8a49c4.tar.lz craftbukkit-5aa95ee469f1f18b439a9a6d423545021b8a49c4.tar.xz craftbukkit-5aa95ee469f1f18b439a9a6d423545021b8a49c4.zip |
Added MaxSpeed methods to minecarts. Added MaxSpeed methods to boats. Added SlowWhenEmpty, FlyingMod, and DerailedMod methods to minecarts.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java | 10 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java | 39 |
2 files changed, 49 insertions, 0 deletions
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"; |