From fd6ba5b43394ba6f65daf5cca224833907deb4a7 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Wed, 10 Sep 2014 16:19:22 -0500 Subject: [PATCH] Add SportBukkit fix for visually offset entities --- ...fix-for-certain-visually-offset-enti.patch | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Spigot-Server-Patches/Add-SportBukkit-fix-for-certain-visually-offset-enti.patch diff --git a/Spigot-Server-Patches/Add-SportBukkit-fix-for-certain-visually-offset-enti.patch b/Spigot-Server-Patches/Add-SportBukkit-fix-for-certain-visually-offset-enti.patch new file mode 100644 index 0000000000..139e777c9d --- /dev/null +++ b/Spigot-Server-Patches/Add-SportBukkit-fix-for-certain-visually-offset-enti.patch @@ -0,0 +1,76 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Mon, 8 Sep 2014 23:25:48 -0500 +Subject: [PATCH] Add SportBukkit fix for certain visually offset entities + + +diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +@@ -0,0 +0,0 @@ public class EntityTrackerEntry { + this.scanPlayers(new java.util.ArrayList(this.trackedPlayers)); + } + // CraftBukkit end +- object = new PacketPlayOutEntityTeleport(this.tracker.getId(), i, j, k, (byte) l, (byte) i1, tracker.onGround); // Spigot - protocol patch ++ // PaperSpigot - Fix visual offset of falling block entities in proto patch ++ object = new PacketPlayOutEntityTeleport(this.tracker.getId(), i, j, k, (byte) l, (byte) i1, tracker.onGround, tracker instanceof EntityFallingBlock || tracker instanceof EntityTNTPrimed); // Spigot - protocol patch + } + } + +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java +@@ -0,0 +0,0 @@ public class PacketPlayOutEntityTeleport extends Packet { + private byte e; + private byte f; + private boolean onGround; // Spigot - protocol patch ++ private boolean heightCorrection; // PaperSpigot - Fix visual offset of falling block entities in proto patch + + public PacketPlayOutEntityTeleport() {} + +@@ -0,0 +0,0 @@ public class PacketPlayOutEntityTeleport extends Packet { + this.f = (byte) ((int) (entity.pitch * 256.0F / 360.0F)); + } + +- public PacketPlayOutEntityTeleport(int i, int j, int k, int l, byte b0, byte b1, boolean onGround) { // Spigot - protocol patch ++ public PacketPlayOutEntityTeleport(int i, int j, int k, int l, byte b0, byte b1, boolean onGround, boolean heightCorrection) { // Spigot - protocol patch + this.a = i; + this.b = j; + this.c = k; +@@ -0,0 +0,0 @@ public class PacketPlayOutEntityTeleport extends Packet { + this.e = b0; + this.f = b1; + this.onGround = onGround; // Spigot - protocol patch ++ this.heightCorrection = heightCorrection; // PaperSpigot - Fix visual offset of falling block entities in proto patch + } + + public void a(PacketDataSerializer packetdataserializer) { +@@ -0,0 +0,0 @@ public class PacketPlayOutEntityTeleport extends Packet { + } + // Spigot end + packetdataserializer.writeInt(this.b); +- packetdataserializer.writeInt(this.c); ++ // PaperSpigot - Fix visual offset of falling block entities in proto patch ++ packetdataserializer.writeInt(packetdataserializer.version >= 16 && this.heightCorrection ? this.c - 16 : this.c); // Spigot - protocol patch + packetdataserializer.writeInt(this.d); + packetdataserializer.writeByte(this.e); + packetdataserializer.writeByte(this.f); +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java +@@ -0,0 +0,0 @@ public class PacketPlayOutSpawnEntity extends Packet { + int data = k >> 16; + k = id | ( data << 12 ); + } ++ // PaperSpigot start - Fix visual offset of falling block entities on proto patch ++ if ((j == 50 || j == 70 || j == 74) && packetdataserializer.version >= 16) { // TNTPrimed, FallingSand, DragonEgg ++ this.c -= 16; ++ } ++ // PaperSpigot end + // Spigot end + packetdataserializer.writeInt(this.b); + packetdataserializer.writeInt(this.c); +-- \ No newline at end of file