mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
Fix visual offset of falling block entities on 1.8 clients
This commit is contained in:
parent
b414734791
commit
e073a27598
1 changed files with 17 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
|||
From 63f9f21655f64f989e638f123002365ea7ea3e91 Mon Sep 17 00:00:00 2001
|
||||
From 0fb56bb05ba15c8f6d605d9657195e3662dbcb47 Mon Sep 17 00:00:00 2001
|
||||
From: Thinkofdeath <thinkofdeath@spigotmc.org>
|
||||
Date: Mon, 1 Sep 2014 16:47:48 +1000
|
||||
Subject: [PATCH] Snapshot protocol
|
||||
|
@ -527,7 +527,7 @@ index 413af68..6e80242 100644
|
|||
|
||||
public ChunkCoordinates getChunkCoordinates() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index f654d58..46c4fb8 100644
|
||||
index f654d58..4ecfc83 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -134,11 +134,11 @@ public class EntityTrackerEntry {
|
||||
|
@ -550,7 +550,7 @@ index f654d58..46c4fb8 100644
|
|||
}
|
||||
// CraftBukkit end
|
||||
- object = new PacketPlayOutEntityTeleport(this.tracker.getId(), i, j, k, (byte) l, (byte) i1);
|
||||
+ object = new PacketPlayOutEntityTeleport(this.tracker.getId(), i, j, k, (byte) l, (byte) i1, tracker.onGround); // Spigot - protocol 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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1717,23 +1717,24 @@ index a95877f..c937f59 100644
|
|||
|
||||
public void a(PacketPlayOutListener packetplayoutlistener) {
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||
index c988bcc..87260d5 100644
|
||||
index c988bcc..8335f1b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||
@@ -8,6 +8,7 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
||||
@@ -8,6 +8,8 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
||||
private int d;
|
||||
private byte e;
|
||||
private byte f;
|
||||
+ private boolean onGround; // Spigot - protocol patch
|
||||
+ private boolean heightCorrection; // Spigot - protocol patch
|
||||
|
||||
public PacketPlayOutEntityTeleport() {}
|
||||
|
||||
@@ -20,13 +21,14 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
||||
@@ -20,13 +22,15 @@ 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) {
|
||||
+ 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;
|
||||
|
@ -1741,10 +1742,11 @@ index c988bcc..87260d5 100644
|
|||
this.e = b0;
|
||||
this.f = b1;
|
||||
+ this.onGround = onGround; // Spigot - protocol patch
|
||||
+ this.heightCorrection = heightCorrection; // Spigot - protocol patch
|
||||
}
|
||||
|
||||
public void a(PacketDataSerializer packetdataserializer) {
|
||||
@@ -39,12 +41,26 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
||||
@@ -39,12 +43,26 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
||||
}
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer) {
|
||||
|
@ -1759,7 +1761,8 @@ index c988bcc..87260d5 100644
|
|||
+ }
|
||||
+ // Spigot end
|
||||
packetdataserializer.writeInt(this.b);
|
||||
packetdataserializer.writeInt(this.c);
|
||||
- packetdataserializer.writeInt(this.c);
|
||||
+ 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);
|
||||
|
@ -2811,10 +2814,10 @@ index 5aeb4e3..8893b61 100644
|
|||
|
||||
public PacketPlayOutSetSlot() {}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java
|
||||
index 17302e0..dcf1204 100644
|
||||
index 17302e0..b1faa6d 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java
|
||||
@@ -84,6 +84,39 @@ public class PacketPlayOutSpawnEntity extends Packet {
|
||||
@@ -84,6 +84,42 @@ public class PacketPlayOutSpawnEntity extends Packet {
|
||||
public void b(PacketDataSerializer packetdataserializer) {
|
||||
packetdataserializer.b(this.a);
|
||||
packetdataserializer.writeByte(this.j);
|
||||
|
@ -2850,6 +2853,9 @@ index 17302e0..dcf1204 100644
|
|||
+ int data = k >> 16;
|
||||
+ k = id | ( data << 12 );
|
||||
+ }
|
||||
+ if ((j == 50 || j == 70 || j == 74) && packetdataserializer.version >= 16) { // TNTPrimed, FallingSand, DragonEgg
|
||||
+ this.c -= 16;
|
||||
+ }
|
||||
+ // Spigot end
|
||||
packetdataserializer.writeInt(this.b);
|
||||
packetdataserializer.writeInt(this.c);
|
||||
|
|
Loading…
Add table
Reference in a new issue