From d5ba6c66448faa4839283228651665dd9b1f8811 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Sat, 9 Jun 2012 03:59:49 -0500 Subject: Fix fireballs freezing when the chunk unloads. Addresses BUKKIT-1228 --- src/main/java/net/minecraft/server/EntityFireball.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/net') diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index ec4911ea..f107b92e 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -216,6 +216,8 @@ public class EntityFireball extends Entity { nbttagcompound.setShort("zTile", (short) this.g); nbttagcompound.setByte("inTile", (byte) this.h); nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0)); + // CraftBukkit + nbttagcompound.set("Direction", this.a(new double[] { this.dirX, this.dirY, this.dirZ})); } public void a(NBTTagCompound nbttagcompound) { @@ -224,6 +226,14 @@ public class EntityFireball extends Entity { this.g = nbttagcompound.getShort("zTile"); this.h = nbttagcompound.getByte("inTile") & 255; this.i = nbttagcompound.getByte("inGround") == 1; + // CraftBukkit start + if (nbttagcompound.hasKey("Direction")) { + NBTTagList nbttaglist1 = nbttagcompound.getList("Direction"); + this.dirX = ((NBTTagDouble) nbttaglist1.get(0)).data; + this.dirY = ((NBTTagDouble) nbttaglist1.get(1)).data; + this.dirZ = ((NBTTagDouble) nbttaglist1.get(2)).data; + } + // CraftBukkit end } public boolean o_() { -- cgit v1.2.3