PaperMC/CraftBukkit-Patches/0090-Support-vanilla-s-direction-tag-on-fireballs.patch

37 lines
1.6 KiB
Diff
Raw Normal View History

2014-03-09 23:14:45 +01:00
From cea6b0426484e45c9bf8ec4a718be75c10f77b83 Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Sat, 18 Jan 2014 14:27:03 +0000
Subject: [PATCH] Support vanilla's direction tag on fireballs
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java
2014-01-31 21:42:29 +01:00
index 939de5d..436e6a1 100644
--- a/src/main/java/net/minecraft/server/EntityFireball.java
+++ b/src/main/java/net/minecraft/server/EntityFireball.java
2014-01-31 21:42:29 +01:00
@@ -199,6 +199,8 @@ public abstract class EntityFireball extends Entity {
nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
// CraftBukkit - Fix direction being mismapped to invalid variables
nbttagcompound.set("power", this.a(new double[] { this.dirX, this.dirY, this.dirZ}));
+ // Spigot - Support vanilla's direction tag
+ nbttagcompound.set("direction", this.a(new double[] { this.motX, this.motY, this.motZ}));
}
public void a(NBTTagCompound nbttagcompound) {
2014-01-31 21:42:29 +01:00
@@ -215,6 +217,13 @@ public abstract class EntityFireball extends Entity {
this.dirY = nbttaglist.d(1);
this.dirZ = nbttaglist.d(2);
// CraftBukkit end
+ } else if (nbttagcompound.hasKeyOfType("direction", 9)) { // Spigot - Support vanilla's direction tag
+ NBTTagList nbttaglist = nbttagcompound.getList("direction", 6);
+
+ this.motX = nbttaglist.d(0);
+ this.motY = nbttaglist.d(1);
+ this.motZ = nbttaglist.d(2);
+
} else {
this.die();
}
--
2014-03-09 22:37:28 +01:00
1.8.3.2