mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Re-add SportBukkit visual offset fix
Looks to be entirely unrelated to the visual issues being seen Revert "Remove SportBukkit visual offset fix, may cause issues with certain cannons" This reverts commit 1156e17179492f530ced9a91a2db0ee32f6bf0e9.
This commit is contained in:
parent
1db4108509
commit
4c10135801
1 changed files with 76 additions and 0 deletions
|
@ -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);
|
||||
--
|
Loading…
Reference in a new issue