mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
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."
This commit is contained in:
parent
155b83e2c7
commit
3a0c5aff0c
@ -199,7 +199,8 @@ public abstract class EntityFireball extends Entity {
|
|||||||
nbttagcompound.setShort("zTile", (short) this.g);
|
nbttagcompound.setShort("zTile", (short) this.g);
|
||||||
nbttagcompound.setByte("inTile", (byte) this.h);
|
nbttagcompound.setByte("inTile", (byte) this.h);
|
||||||
nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
|
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) {
|
public void a(NBTTagCompound nbttagcompound) {
|
||||||
@ -208,12 +209,14 @@ public abstract class EntityFireball extends Entity {
|
|||||||
this.g = nbttagcompound.getShort("zTile");
|
this.g = nbttagcompound.getShort("zTile");
|
||||||
this.h = nbttagcompound.getByte("inTile") & 255;
|
this.h = nbttagcompound.getByte("inTile") & 255;
|
||||||
this.i = nbttagcompound.getByte("inGround") == 1;
|
this.i = nbttagcompound.getByte("inGround") == 1;
|
||||||
if (nbttagcompound.hasKey("direction")) {
|
// CraftBukkit - direction -> power
|
||||||
NBTTagList nbttaglist = nbttagcompound.getList("direction");
|
if (nbttagcompound.hasKey("power")) {
|
||||||
|
NBTTagList nbttaglist = nbttagcompound.getList("power");
|
||||||
|
|
||||||
this.motX = ((NBTTagDouble) nbttaglist.get(0)).data;
|
this.dirX = ((NBTTagDouble) nbttaglist.get(0)).data;
|
||||||
this.motY = ((NBTTagDouble) nbttaglist.get(1)).data;
|
this.dirY = ((NBTTagDouble) nbttaglist.get(1)).data;
|
||||||
this.motZ = ((NBTTagDouble) nbttaglist.get(2)).data;
|
this.dirZ = ((NBTTagDouble) nbttaglist.get(2)).data;
|
||||||
|
// CraftBukkit end
|
||||||
} else {
|
} else {
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user