summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorafforess <afforess@gmail.com>2011-02-12 15:57:16 +0100
committerErik Broes <erikbroes@grum.nl>2011-02-12 16:14:43 +0100
commit5aa95ee469f1f18b439a9a6d423545021b8a49c4 (patch)
tree676446535c8915412b340aeb690ede07635d2a33 /src/main/java/net/minecraft
parentbe9a264249ce40785c5f5b6463a1095ab6495be6 (diff)
downloadcraftbukkit-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/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/EntityBoat.java3
-rw-r--r--src/main/java/net/minecraft/server/EntityMinecart.java37
2 files changed, 24 insertions, 16 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index c5bd46be..6aa0d3b9 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
@@ -27,6 +27,7 @@ public class EntityBoat extends Entity {
private double ak;
private double al;
private double am;
+ public double maxSpeed = 0.4D; // CraftBukkit
// CraftBukkit start
public void c(Entity entity) {
@@ -219,7 +220,7 @@ public class EntityBoat extends Entity {
this.motZ += this.passenger.motZ * 0.2D;
}
- d4 = 0.4D;
+ d4 = this.maxSpeed; // CraftBukkit
if (this.motX < -d4) {
this.motX = -d4;
}
diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java
index 9de452e1..a2c25489 100644
--- a/src/main/java/net/minecraft/server/EntityMinecart.java
+++ b/src/main/java/net/minecraft/server/EntityMinecart.java
@@ -31,13 +31,14 @@ public class EntityMinecart extends Entity implements IInventory {
private double at;
// CraftBukkit start
- private boolean slowWhenEmpty = true;
- private double derailedX = 0.5;
- private double derailedY = 0.5;
- private double derailedZ = 0.5;
- private double flyingX = 0.94999998807907104;
- private double flyingY = 0.94999998807907104;
- private double flyingZ = 0.94999998807907104;
+ public boolean slowWhenEmpty = true;
+ public double derailedX = 0.5;
+ public double derailedY = 0.5;
+ public double derailedZ = 0.5;
+ public double flyingX = 0.95;
+ public double flyingY = 0.95;
+ public double flyingZ = 0.95;
+ public double maxSpeed = 0.4D;
public ItemStack[] getContents() {
return this.al;
@@ -224,7 +225,7 @@ public class EntityMinecart extends Entity implements IInventory {
--j;
}
- double d4 = 0.4D;
+ double d4 = this.maxSpeed; // CraftBukkit
boolean flag = false;
d0 = 0.0078125D;
@@ -326,7 +327,9 @@ public class EntityMinecart extends Entity implements IInventory {
this.a(this.locX, this.locY + (double) aint[1][1], this.locZ);
}
- if (this.passenger != null) {
+ // CraftBukkit start
+ if (this.passenger != null || !slowWhenEmpty) {
+ // CraftBukkit end
this.motX *= 0.996999979019165D;
this.motY *= 0.0D;
this.motZ *= 0.996999979019165D;
@@ -412,16 +415,20 @@ public class EntityMinecart extends Entity implements IInventory {
}
if (this.onGround) {
- this.motX *= 0.5D;
- this.motY *= 0.5D;
- this.motZ *= 0.5D;
+ // CraftBukkit start
+ this.motX *= this.derailedX;
+ this.motY *= this.derailedY;
+ this.motZ *= this.derailedZ;
+ // CraftBukkit start
}
this.c(this.motX, this.motY, this.motZ);
if (!this.onGround) {
- this.motX *= 0.949999988079071D;
- this.motY *= 0.949999988079071D;
- this.motZ *= 0.949999988079071D;
+ // CraftBukkit start
+ this.motX *= flyingX;
+ this.motY *= flyingY;
+ this.motZ *= flyingZ;
+ // CraftBukkit start
}
}