mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
Update from upstream SpigotMC
Fix double plants having the incorrect top half SpigotMC/Spigot@377b69d787 Fix boats thinking that they were always on land for 1.8 clients SpigotMC/Spigot@4a083f819e Correct the action used in updateGamemode. this isn't used by the ser... SpigotMC/Spigot@face904a9a Allow the updated version of protocollib to be enabled SpigotMC/Spigot@4614a615cc
This commit is contained in:
parent
f39f423fd0
commit
b7e702dacc
@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
description = loader.getPluginDescription(file);
|
description = loader.getPluginDescription(file);
|
||||||
String name = description.getName();
|
String name = description.getName();
|
||||||
+ // Spigot Start
|
+ // Spigot Start
|
||||||
+ if ( name.equalsIgnoreCase( "ProtocolLib" ) )
|
+ if ( name.equalsIgnoreCase( "ProtocolLib" ) && !description.getVersion().endsWith( "-HACK" ) )
|
||||||
+ {
|
+ {
|
||||||
+ server.getLogger().log( Level.WARNING, "Skipping loading of ProtocolLib as it does not work with Spigot 1.8 builds!" );
|
+ server.getLogger().log( Level.WARNING, "Skipping loading of ProtocolLib as it does not work with Spigot 1.8 builds!" );
|
||||||
+ continue;
|
+ continue;
|
||||||
|
@ -507,6 +507,39 @@ diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/ma
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
|
||||||
|
if (this.m > 0 || this.tracker instanceof EntityArrow) {
|
||||||
|
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.v <= 400 && !this.x) {
|
||||||
|
if (flag && flag1) {
|
||||||
|
- object = new PacketPlayOutRelEntityMoveLook(this.tracker.getId(), (byte) j1, (byte) k1, (byte) l1, (byte) l, (byte) i1);
|
||||||
|
+ object = new PacketPlayOutRelEntityMoveLook(this.tracker.getId(), (byte) j1, (byte) k1, (byte) l1, (byte) l, (byte) i1, tracker.onGround); // Spigot - protocol patch
|
||||||
|
} else if (flag) {
|
||||||
|
- object = new PacketPlayOutRelEntityMove(this.tracker.getId(), (byte) j1, (byte) k1, (byte) l1);
|
||||||
|
+ object = new PacketPlayOutRelEntityMove(this.tracker.getId(), (byte) j1, (byte) k1, (byte) l1, tracker.onGround); // Spigot - protocol patch
|
||||||
|
} else if (flag1) {
|
||||||
|
- object = new PacketPlayOutEntityLook(this.tracker.getId(), (byte) l, (byte) i1);
|
||||||
|
+ object = new PacketPlayOutEntityLook(this.tracker.getId(), (byte) l, (byte) i1, tracker.onGround); // Spigot - protocol patch
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.v = 0;
|
||||||
|
@@ -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);
|
||||||
|
+ object = new PacketPlayOutEntityTeleport(this.tracker.getId(), i, j, k, (byte) l, (byte) i1, tracker.onGround); // Spigot - protocol patch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
|
||||||
|
boolean flag2 = Math.abs(i - this.yRot) >= 4 || Math.abs(j - this.xRot) >= 4;
|
||||||
|
|
||||||
|
if (flag2) {
|
||||||
|
- this.broadcast(new PacketPlayOutEntityLook(this.tracker.getId(), (byte) i, (byte) j));
|
||||||
|
+ this.broadcast(new PacketPlayOutEntityLook(this.tracker.getId(), (byte) i, (byte) j, tracker.onGround)); // Spigot - protocol patch
|
||||||
|
this.yRot = i;
|
||||||
|
this.xRot = j;
|
||||||
|
}
|
||||||
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
|
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
|
||||||
this.trackedPlayers.add(entityplayer);
|
this.trackedPlayers.add(entityplayer);
|
||||||
Packet packet = this.c();
|
Packet packet = this.c();
|
||||||
@ -1578,6 +1611,26 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityLook.java b/s
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityLook.java
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityLook.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityLook.java
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityLook.java
|
||||||
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||||
|
|
||||||
|
public class PacketPlayOutEntityLook extends PacketPlayOutEntity {
|
||||||
|
|
||||||
|
+ private boolean onGround; // Spigot - protocol patch
|
||||||
|
+
|
||||||
|
public PacketPlayOutEntityLook() {
|
||||||
|
this.g = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- public PacketPlayOutEntityLook(int i, byte b0, byte b1) {
|
||||||
|
+ public PacketPlayOutEntityLook(int i, byte b0, byte b1, boolean onGround) { // Spigot - protocol patch
|
||||||
|
super(i);
|
||||||
|
this.e = b0;
|
||||||
|
this.f = b1;
|
||||||
|
this.g = true;
|
||||||
|
+ this.onGround = onGround; // Spigot - protocol patch
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(PacketDataSerializer packetdataserializer) {
|
||||||
@@ -0,0 +0,0 @@ public class PacketPlayOutEntityLook extends PacketPlayOutEntity {
|
@@ -0,0 +0,0 @@ public class PacketPlayOutEntityLook extends PacketPlayOutEntity {
|
||||||
super.b(packetdataserializer);
|
super.b(packetdataserializer);
|
||||||
packetdataserializer.writeByte(this.e);
|
packetdataserializer.writeByte(this.e);
|
||||||
@ -1585,7 +1638,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Spigot start - protocol patch
|
+ // Spigot start - protocol patch
|
||||||
+ if ( packetdataserializer.version >= 22 )
|
+ if ( packetdataserializer.version >= 22 )
|
||||||
+ {
|
+ {
|
||||||
+ packetdataserializer.writeBoolean( true );
|
+ packetdataserializer.writeBoolean( onGround );
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
@ -1618,6 +1671,30 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||||
+++ b/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 int d;
|
||||||
|
private byte e;
|
||||||
|
private byte f;
|
||||||
|
+ private boolean onGround; // Spigot - protocol 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) {
|
||||||
|
+ public PacketPlayOutEntityTeleport(int i, int j, int k, int l, byte b0, byte b1, boolean onGround) { // Spigot - protocol patch
|
||||||
|
this.a = i;
|
||||||
|
this.b = j;
|
||||||
|
this.c = k;
|
||||||
|
this.d = l;
|
||||||
|
this.e = b0;
|
||||||
|
this.f = b1;
|
||||||
|
+ this.onGround = onGround; // Spigot - protocol patch
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(PacketDataSerializer packetdataserializer) {
|
||||||
@@ -0,0 +0,0 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
@@ -0,0 +0,0 @@ public class PacketPlayOutEntityTeleport extends Packet {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1640,7 +1717,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Spigot start - protocol patch
|
+ // Spigot start - protocol patch
|
||||||
+ if ( packetdataserializer.version >= 22 )
|
+ if ( packetdataserializer.version >= 22 )
|
||||||
+ {
|
+ {
|
||||||
+ packetdataserializer.writeBoolean( true );
|
+ packetdataserializer.writeBoolean( onGround );
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
@ -2342,7 +2419,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+ public static PacketPlayOutPlayerInfo updateGamemode(EntityPlayer player) {
|
+ public static PacketPlayOutPlayerInfo updateGamemode(EntityPlayer player) {
|
||||||
+ PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
+ PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
||||||
+ packet.action = UPDATE_LATENCY;
|
+ packet.action = UPDATE_GAMEMODE;
|
||||||
+ packet.username = player.listName;
|
+ packet.username = player.listName;
|
||||||
+ packet.player = player.getProfile();
|
+ packet.player = player.getProfile();
|
||||||
+ packet.gamemode = player.playerInteractManager.getGameMode().getId();
|
+ packet.gamemode = player.playerInteractManager.getGameMode().getId();
|
||||||
@ -2467,6 +2544,24 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMove.java
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMove.java
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMove.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMove.java
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMove.java
|
||||||
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||||
|
|
||||||
|
public class PacketPlayOutRelEntityMove extends PacketPlayOutEntity {
|
||||||
|
|
||||||
|
+ private boolean onGround; // Spigot - protocol patch
|
||||||
|
+
|
||||||
|
public PacketPlayOutRelEntityMove() {}
|
||||||
|
|
||||||
|
- public PacketPlayOutRelEntityMove(int i, byte b0, byte b1, byte b2) {
|
||||||
|
+ public PacketPlayOutRelEntityMove(int i, byte b0, byte b1, byte b2, boolean onGround) { // Spigot - protocol patch
|
||||||
|
super(i);
|
||||||
|
this.b = b0;
|
||||||
|
this.c = b1;
|
||||||
|
this.d = b2;
|
||||||
|
+ this.onGround = onGround; // Spigot - protocol patch
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(PacketDataSerializer packetdataserializer) {
|
||||||
@@ -0,0 +0,0 @@ public class PacketPlayOutRelEntityMove extends PacketPlayOutEntity {
|
@@ -0,0 +0,0 @@ public class PacketPlayOutRelEntityMove extends PacketPlayOutEntity {
|
||||||
packetdataserializer.writeByte(this.b);
|
packetdataserializer.writeByte(this.b);
|
||||||
packetdataserializer.writeByte(this.c);
|
packetdataserializer.writeByte(this.c);
|
||||||
@ -2474,7 +2569,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Spigot start - protocol patch
|
+ // Spigot start - protocol patch
|
||||||
+ if ( packetdataserializer.version >= 22 )
|
+ if ( packetdataserializer.version >= 22 )
|
||||||
+ {
|
+ {
|
||||||
+ packetdataserializer.writeBoolean( true );
|
+ packetdataserializer.writeBoolean( onGround );
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
@ -2484,6 +2579,29 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMoveLook.j
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMoveLook.java
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMoveLook.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMoveLook.java
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutRelEntityMoveLook.java
|
||||||
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||||
|
|
||||||
|
public class PacketPlayOutRelEntityMoveLook extends PacketPlayOutEntity {
|
||||||
|
|
||||||
|
+ private boolean onGround; // Spigot - protocol patch
|
||||||
|
+
|
||||||
|
public PacketPlayOutRelEntityMoveLook() {
|
||||||
|
this.g = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- public PacketPlayOutRelEntityMoveLook(int i, byte b0, byte b1, byte b2, byte b3, byte b4) {
|
||||||
|
+ public PacketPlayOutRelEntityMoveLook(int i, byte b0, byte b1, byte b2, byte b3, byte b4, boolean onGround) { // Spigot - protocol patch
|
||||||
|
super(i);
|
||||||
|
this.b = b0;
|
||||||
|
this.c = b1;
|
||||||
|
@@ -0,0 +0,0 @@ public class PacketPlayOutRelEntityMoveLook extends PacketPlayOutEntity {
|
||||||
|
this.e = b3;
|
||||||
|
this.f = b4;
|
||||||
|
this.g = true;
|
||||||
|
+ this.onGround = onGround; // Spigot - protocol patch
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(PacketDataSerializer packetdataserializer) {
|
||||||
@@ -0,0 +0,0 @@ public class PacketPlayOutRelEntityMoveLook extends PacketPlayOutEntity {
|
@@ -0,0 +0,0 @@ public class PacketPlayOutRelEntityMoveLook extends PacketPlayOutEntity {
|
||||||
packetdataserializer.writeByte(this.d);
|
packetdataserializer.writeByte(this.d);
|
||||||
packetdataserializer.writeByte(this.e);
|
packetdataserializer.writeByte(this.e);
|
||||||
@ -2491,7 +2609,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Spigot start - protocol patch
|
+ // Spigot start - protocol patch
|
||||||
+ if ( packetdataserializer.version >= 22 )
|
+ if ( packetdataserializer.version >= 22 )
|
||||||
+ {
|
+ {
|
||||||
+ packetdataserializer.writeBoolean( true );
|
+ packetdataserializer.writeBoolean( onGround );
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
@ -3890,6 +4008,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ public static int getCorrectedData(int id, int data)
|
+ public static int getCorrectedData(int id, int data)
|
||||||
+ {
|
+ {
|
||||||
+ if ( id > 197 ) return data;
|
+ if ( id > 197 ) return data;
|
||||||
|
+ if ( id == 175 && data > 8 )
|
||||||
|
+ {
|
||||||
|
+ data = 8;
|
||||||
|
+ }
|
||||||
+ if ( validBlocks[ ( id << 4 ) | data ] )
|
+ if ( validBlocks[ ( id << 4 ) | data ] )
|
||||||
+ {
|
+ {
|
||||||
+ return data;
|
+ return data;
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
|
||||||
Date: Mon, 1 Sep 2014 15:33:27 -0500
|
|
||||||
Subject: [PATCH] Allow ProtocolLib to be enabled
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
|
||||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
|
||||||
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
|
|
||||||
description = loader.getPluginDescription(file);
|
|
||||||
String name = description.getName();
|
|
||||||
// Spigot Start
|
|
||||||
- if ( name.equalsIgnoreCase( "ProtocolLib" ) )
|
|
||||||
- {
|
|
||||||
- server.getLogger().log( Level.WARNING, "Skipping loading of ProtocolLib as it does not work with Spigot 1.8 builds!" );
|
|
||||||
- continue;
|
|
||||||
- }
|
|
||||||
if ( name.equalsIgnoreCase( "Orebfuscator" ) )
|
|
||||||
{
|
|
||||||
server.getLogger().log( Level.WARNING, "Skipping loading of Orebfuscator as it does not work with Spigot 1.8 builds!" );
|
|
||||||
--
|
|
@ -1,27 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Minecrell <dev@minecrell.net>
|
|
||||||
Date: Mon, 1 Sep 2014 15:33:57 -0500
|
|
||||||
Subject: [PATCH] Fix for ProtocolLib compatibility
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
|
||||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler {
|
|
||||||
|
|
||||||
// Spigot start - protocol patch
|
|
||||||
public void enableCompression() {
|
|
||||||
- m.pipeline().addBefore( "decoder", "decompress", new SpigotDecompressor() );
|
|
||||||
+ // PaperSpigot start - Fix ProtocolLib compatibility
|
|
||||||
+ if ( m.pipeline().get("protocol_lib_decoder") != null ) {
|
|
||||||
+ m.pipeline().addBefore( "protocol_lib_decoder", "decompress", new SpigotDecompressor() );
|
|
||||||
+ } else {
|
|
||||||
+ m.pipeline().addBefore( "decoder", "decompress", new SpigotDecompressor() );
|
|
||||||
+ }
|
|
||||||
+ // PaperSpigot end
|
|
||||||
+
|
|
||||||
m.pipeline().addBefore( "encoder", "compress", new SpigotCompressor() );
|
|
||||||
}
|
|
||||||
// Spigot end
|
|
||||||
--
|
|
Loading…
Reference in New Issue
Block a user