mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly Paper Changes: a70924789 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: d1db107 Updated Upstream (Paper)
This commit is contained in:
@@ -362,6 +362,15 @@ 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
|
||||
@@ -7944,7 +7953,7 @@ index 550232cb3819138b3bae0fa1c51429485e8bc593..229c3b0f0c650b501f31147adaa17194
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 091d55c04c663df07c69f637515f53990c3c2d46..a4cf9e17a450f1603d3d1ed111404afea6e1d219 100644
|
||||
index e44e5652c12fbee51acedc1f911181b8443fae93..d93db1049ef9421f6b3edd0dc52a421c4d1b51c2 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -8328,7 +8337,7 @@ index 091d55c04c663df07c69f637515f53990c3c2d46..a4cf9e17a450f1603d3d1ed111404afe
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2844,7 +3076,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2842,7 +3074,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.cp().forEach((entity) -> {
|
||||
worldserver.chunkCheck(entity);
|
||||
entity.az = true;
|
||||
@@ -8337,7 +8346,7 @@ index 091d55c04c663df07c69f637515f53990c3c2d46..a4cf9e17a450f1603d3d1ed111404afe
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
@@ -3302,12 +3534,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -3300,12 +3532,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return this.locBlock;
|
||||
}
|
||||
|
||||
@@ -8354,7 +8363,7 @@ index 091d55c04c663df07c69f637515f53990c3c2d46..a4cf9e17a450f1603d3d1ed111404afe
|
||||
}
|
||||
|
||||
public void setMot(double d0, double d1, double d2) {
|
||||
@@ -3362,7 +3598,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -3360,7 +3596,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
}
|
||||
// Paper end
|
||||
if (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2) {
|
||||
@@ -8397,10 +8406,10 @@ 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 53d193fab101192ee0e0a5519b78c354122db353..6a3d73b33f04e2c66b4ba9ebe58f887048ae83d6 100644
|
||||
index dd3287f953a1a24d2406816b3c0ae176476b6452..43a4b474273a58ac3995407e72e5b830696b9ba0 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2852,7 +2852,11 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2858,7 +2858,11 @@ public abstract class EntityLiving extends Entity {
|
||||
return;
|
||||
}
|
||||
// Paper - end don't run getEntities if we're not going to use its result
|
||||
@@ -8413,7 +8422,7 @@ index 53d193fab101192ee0e0a5519b78c354122db353..6a3d73b33f04e2c66b4ba9ebe58f8870
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
// Paper - move up
|
||||
@@ -2881,6 +2885,9 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2887,6 +2891,9 @@ public abstract class EntityLiving extends Entity {
|
||||
this.C(entity);
|
||||
}
|
||||
}
|
||||
@@ -11204,7 +11213,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..dd2ba5d433d4aeef0ac5c0a81acb7f263104c10b 100644
|
||||
index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..df01083f826463cce714eccd5317791c781f04ed 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 {
|
||||
@@ -11218,7 +11227,44 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..dd2ba5d433d4aeef0ac5c0a81acb7f26
|
||||
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
|
||||
return;
|
||||
}
|
||||
@@ -1058,7 +1060,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
if (this.teleportPos != null) {
|
||||
@@ -11227,7 +11273,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..dd2ba5d433d4aeef0ac5c0a81acb7f26
|
||||
this.A = this.e;
|
||||
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
|
||||
}
|
||||
@@ -1128,7 +1130,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1128,7 +1160,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
speed = player.abilities.walkSpeed * 10f;
|
||||
}
|
||||
// Paper start - Prevent moving into unloaded chunks
|
||||
@@ -11236,7 +11282,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..dd2ba5d433d4aeef0ac5c0a81acb7f26
|
||||
this.internalTeleport(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch, Collections.emptySet());
|
||||
return;
|
||||
}
|
||||
@@ -1184,6 +1186,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1184,6 +1216,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
|
||||
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
|
||||
@@ -11244,7 +11290,7 @@ index 3e1f88bce8e0ba95f73bca204549db0c65b1465e..dd2ba5d433d4aeef0ac5c0a81acb7f26
|
||||
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 +1211,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1208,7 +1241,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
|
||||
this.player.setLocation(d4, d5, d6, f, f1);
|
||||
|
||||
Reference in New Issue
Block a user