Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
98a702c7d [CI-SKIP] [Auto] Rebuild Patches
cab361600 Expose LivingEntity hurt direction
7ef05fbd8 Do not perform neighbour updates when using debug stick (Fixes #2134)
This commit is contained in:
BillyGalbreath
2020-12-23 00:10:08 -06:00
parent 8cabaaeced
commit 4e8a150377
125 changed files with 784 additions and 121 deletions

View File

@@ -362,15 +362,6 @@ Copy passenger list in enderTeleportTo
Fixes https://github.com/Spottedleaf/Tuinity/issues/208
Apply more strict limitations to books
For reference is the vanilla limits, this must be checked
on update
- Max book pages: 50
- Max Length: 256
Currently, patch limits to 50 pages and 512 characters.
Rewrite the light engine
The standard vanilla light engine is plagued by
@@ -8406,7 +8397,7 @@ index dcc5b098bfe36ef7ee8536b3da65c4ce1748c9d8..7b32a1fb79dcae355a8d95f3a8aa4284
if (entityhuman != null) {
double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index dd3287f953a1a24d2406816b3c0ae176476b6452..43a4b474273a58ac3995407e72e5b830696b9ba0 100644
index 0294ff10dc8edb24aabfbe1589048a405c356ef0..9737c8b31482de140e14e58aa9baa8618d1c3fb4 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2858,7 +2858,11 @@ public abstract class EntityLiving extends Entity {
@@ -11213,7 +11204,7 @@ index 6c399bcea03e839bf2f21e92b5d76d46b7088667..d3bf356ea768a32a5684eb851a2a0add
}
// Paper end - optimised tracker
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..df01083f826463cce714eccd5317791c781f04ed 100644
index 4d3a427b16e1e0d6889faf4b913b212f8a6e938d..acaaf78c13f379f9b076d615c8a77ebc4bc8d2be 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -419,7 +419,9 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -11227,44 +11218,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..df01083f826463cce714eccd5317791c
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
return;
}
@@ -898,6 +900,36 @@ public class PlayerConnection implements PacketListenerPlayIn {
@Override
public void a(PacketPlayInBEdit packetplayinbedit) {
+ // Tuinity start - apply strict vanilla limits to books
+ ItemStack bookStack = packetplayinbedit.b();
+ if (!bookStack.isEmpty() && bookStack.getTag() != null) {
+ NBTTagList pages = bookStack.getTag().getList("pages", 8);
+ if (pages != null && !pages.isEmpty()) {
+ if (pages.size() > 50) {
+ this.minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ return;
+ }
+ for (int i = 0, len = pages.size(); i < len; ++i) {
+ NBTBase base = pages.get(i);
+ if (!(base instanceof NBTTagString)) {
+ this.minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ return;
+ }
+ String string = ((NBTTagString)base).asString();
+ if (string.length() <= 256) {
+ continue;
+ }
+
+ if (string.length() > (256*2)) {
+ this.minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ return;
+ }
+
+ // Don't check the full length of the string, it's too expensive, could be exploited.
+ }
+ }
+ }
+ // Tuinity end - apply strict vanilla limits to books
// Paper start
ItemStack testStack = packetplayinbedit.b(); // TODO(Proximyst): Add obfhelper here
if (!server.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) {
@@ -1058,7 +1090,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1068,7 +1070,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
if (this.teleportPos != null) {
@@ -11273,7 +11227,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..df01083f826463cce714eccd5317791c
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@@ -1128,7 +1160,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1138,7 +1140,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
speed = player.abilities.walkSpeed * 10f;
}
// Paper start - Prevent moving into unloaded chunks
@@ -11282,7 +11236,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..df01083f826463cce714eccd5317791c
this.internalTeleport(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch, Collections.emptySet());
return;
}
@@ -1184,6 +1216,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1194,6 +1196,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
@@ -11290,7 +11244,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..df01083f826463cce714eccd5317791c
this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move
// Paper start - prevent position desync
if (this.teleportPos != null) {
@@ -1208,7 +1241,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1218,7 +1221,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
this.player.setLocation(d4, d5, d6, f, f1);