diff options
author | sk89q <the.sk89q@gmail.com> | 2011-09-25 11:20:51 -0700 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-09-25 11:20:51 -0700 |
commit | b7c43fbff1dffef1b4c9c4e57633d8c16606db58 (patch) | |
tree | 0f6541a82f657e6b321c88030dfb91838e0a6521 /src/main/java/net | |
parent | 8f8c62b71b76675903405df4f7f11edc1a7c6db6 (diff) | |
download | craftbukkit-b7c43fbff1dffef1b4c9c4e57633d8c16606db58.tar craftbukkit-b7c43fbff1dffef1b4c9c4e57633d8c16606db58.tar.gz craftbukkit-b7c43fbff1dffef1b4c9c4e57633d8c16606db58.tar.lz craftbukkit-b7c43fbff1dffef1b4c9c4e57633d8c16606db58.tar.xz craftbukkit-b7c43fbff1dffef1b4c9c4e57633d8c16606db58.zip |
Boat get/set (double) occupied acceleration, (double) unoccupied deceleration, (boolean) work on land. Good values to maximize boat utility: 0.6 (fast accel.), 0.99 (no loss of boat), true/false, respectively.
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityBoat.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index 3ffb55a5..a2d94b74 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -28,6 +28,9 @@ public class EntityBoat extends Entity { // CraftBukkit start public double maxSpeed = 0.4D; + public double occupiedDeceleration = 0.2D; + public double unoccupiedDeceleration = -1; + public boolean landBoats = false; @Override public void collide(Entity entity) { @@ -233,9 +236,22 @@ public class EntityBoat extends Entity { } if (this.passenger != null) { - this.motX += this.passenger.motX * 0.2D; - this.motZ += this.passenger.motZ * 0.2D; + this.motX += this.passenger.motX * occupiedDeceleration; // CraftBukkit + this.motZ += this.passenger.motZ * occupiedDeceleration; // CraftBukkit } + // CraftBukkit start - block not in vanilla + else if (unoccupiedDeceleration >= 0) { + this.motX *= unoccupiedDeceleration; + this.motZ *= unoccupiedDeceleration; + // Kill lingering speed + if (motX <= 0.00001) { + motX = 0; + } + if (motZ <= 0.00001) { + motZ = 0; + } + } + // CraftBukkit end // CraftBukkit d3 = this.maxSpeed; @@ -255,7 +271,7 @@ public class EntityBoat extends Entity { this.motZ = d3; } - if (this.onGround) { + if (this.onGround && !landBoats) { // CraftBukkit this.motX *= 0.5D; this.motY *= 0.5D; this.motZ *= 0.5D; |