summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-12-25 05:42:04 -0600
committerfeildmaster <admin@feildmaster.com>2012-12-25 05:58:49 -0600
commit3a0c5aff0c646b6ae16345da1a168805f0a53cc7 (patch)
tree001dcf92da8288594d6885612beeae1bc6be3a86
parent155b83e2c7b3ee2bdf057353edd8e24247fd14ff (diff)
downloadcraftbukkit-3a0c5aff0c646b6ae16345da1a168805f0a53cc7.tar
craftbukkit-3a0c5aff0c646b6ae16345da1a168805f0a53cc7.tar.gz
craftbukkit-3a0c5aff0c646b6ae16345da1a168805f0a53cc7.tar.lz
craftbukkit-3a0c5aff0c646b6ae16345da1a168805f0a53cc7.tar.xz
craftbukkit-3a0c5aff0c646b6ae16345da1a168805f0a53cc7.zip
Fix fireballs being motionless (again). Fixes BUKKIT-3299
The key "direction" incorrectly mapped to variables that were already set in the entity. In order to prevent loading incorrect data we renamed "direction" to "power."
-rw-r--r--src/main/java/net/minecraft/server/EntityFireball.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java
index d8f34ef8..107abcad 100644
--- a/src/main/java/net/minecraft/server/EntityFireball.java
+++ b/src/main/java/net/minecraft/server/EntityFireball.java
@@ -199,7 +199,8 @@ public abstract class EntityFireball extends Entity {
nbttagcompound.setShort("zTile", (short) this.g);
nbttagcompound.setByte("inTile", (byte) this.h);
nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
- nbttagcompound.set("direction", this.a(new double[] { this.motX, this.motY, this.motZ}));
+ // CraftBukkit - Fix direction being mismapped to invalid variables
+ nbttagcompound.set("power", this.a(new double[] { this.dirX, this.dirY, this.dirZ}));
}
public void a(NBTTagCompound nbttagcompound) {
@@ -208,12 +209,14 @@ public abstract class EntityFireball extends Entity {
this.g = nbttagcompound.getShort("zTile");
this.h = nbttagcompound.getByte("inTile") & 255;
this.i = nbttagcompound.getByte("inGround") == 1;
- if (nbttagcompound.hasKey("direction")) {
- NBTTagList nbttaglist = nbttagcompound.getList("direction");
-
- this.motX = ((NBTTagDouble) nbttaglist.get(0)).data;
- this.motY = ((NBTTagDouble) nbttaglist.get(1)).data;
- this.motZ = ((NBTTagDouble) nbttaglist.get(2)).data;
+ // CraftBukkit - direction -> power
+ if (nbttagcompound.hasKey("power")) {
+ NBTTagList nbttaglist = nbttagcompound.getList("power");
+
+ this.dirX = ((NBTTagDouble) nbttaglist.get(0)).data;
+ this.dirY = ((NBTTagDouble) nbttaglist.get(1)).data;
+ this.dirZ = ((NBTTagDouble) nbttaglist.get(2)).data;
+ // CraftBukkit end
} else {
this.die();
}