diff --git a/patches/server/Add-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch index ce65312ab3..f0ef7e9bab 100644 --- a/patches/server/Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/Add-Velocity-IP-Forwarding-Support.patch @@ -164,9 +164,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + //noinspection NonStrictComparisonCanBeEquality + if (version >= com.destroystokyo.paper.proxy.VelocityProxy.MODERN_FORWARDING_WITH_KEY) { + final ProfilePublicKey.Data forwardedKey = com.destroystokyo.paper.proxy.VelocityProxy.readForwardedKey(buf); -+ if (this.playerProfilePublicKey == null) { ++ if (this.profilePublicKeyData == null) { + try { -+ this.playerProfilePublicKey = ProfilePublicKey.createValidated(this.server.getServiceSignatureValidator(), forwardedKey); ++ ProfilePublicKey.createValidated(this.server.getServiceSignatureValidator(), this.gameProfile.getId(), forwardedKey); ++ this.profilePublicKeyData = forwardedKey; + } catch (CryptException e) { + this.disconnect("Unable to validate forwarded player key"); + } diff --git a/patches/server/Add-config-option-for-logging-player-ip-addresses.patch b/patches/server/Add-config-option-for-logging-player-ip-addresses.patch index e7f6ee0917..791b519564 100644 --- a/patches/server/Add-config-option-for-logging-player-ip-addresses.patch +++ b/patches/server/Add-config-option-for-logging-player-ip-addresses.patch @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + LOGGER.error("Error whilst processing packet {} for connection from {}", packet, playerIP, exception); // Paper } net.minecraft.network.chat.Component error = net.minecraft.network.chat.Component.literal("Packet processing error"); - networkmanager.send(new net.minecraft.network.protocol.game.ClientboundDisconnectPacket(error), (future) -> { + networkmanager.send(new net.minecraft.network.protocol.game.ClientboundDisconnectPacket(error), net.minecraft.network.PacketSendListener.thenRun(() -> networkmanager.disconnect(error))); diff --git a/src/main/java/net/minecraft/server/network/LegacyQueryHandler.java b/src/main/java/net/minecraft/server/network/LegacyQueryHandler.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/LegacyQueryHandler.java diff --git a/patches/server/Load-Chunks-for-Login-Asynchronously.patch b/patches/server/Load-Chunks-for-Login-Asynchronously.patch index 1c678d72cf..8bab8a55ef 100644 --- a/patches/server/Load-Chunks-for-Login-Asynchronously.patch +++ b/patches/server/Load-Chunks-for-Login-Asynchronously.patch @@ -182,10 +182,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + void disconnectPendingPlayer(ServerPlayer entityplayer) { + Component msg = Component.translatable("multiplayer.disconnect.duplicate_login"); -+ entityplayer.networkManager.send(new net.minecraft.network.protocol.game.ClientboundDisconnectPacket(msg), (future) -> { ++ entityplayer.networkManager.send(new net.minecraft.network.protocol.game.ClientboundDisconnectPacket(msg), net.minecraft.network.PacketSendListener.thenRun(() -> { + entityplayer.networkManager.disconnect(msg); + entityplayer.networkManager = null; -+ }); ++ })); + } + + private void postChunkLoadJoin(ServerPlayer player, ServerLevel worldserver1, Connection networkmanager, ServerGamePacketListenerImpl playerconnection, CompoundTag nbttagcompound, String s1, String s) { diff --git a/patches/server/Optimize-NetworkManager-Exception-Handling.patch b/patches/server/Optimize-NetworkManager-Exception-Handling.patch index a87337a510..679725a1bc 100644 --- a/patches/server/Optimize-NetworkManager-Exception-Handling.patch +++ b/patches/server/Optimize-NetworkManager-Exception-Handling.patch @@ -60,9 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - PacketUtils.LOGGER.error("Failed to handle packet {}, suppressing error", packet, exception); + net.minecraft.network.chat.Component error = net.minecraft.network.chat.Component.literal("Packet processing error"); -+ networkmanager.send(new net.minecraft.network.protocol.game.ClientboundDisconnectPacket(error), (future) -> { -+ networkmanager.disconnect(error); -+ }); ++ networkmanager.send(new net.minecraft.network.protocol.game.ClientboundDisconnectPacket(error), net.minecraft.network.PacketSendListener.thenRun(() -> networkmanager.disconnect(error))); + networkmanager.setReadOnly(); } } else { diff --git a/patches/server/Remove-some-streams-from-structures.patch b/patches/server/Remove-some-streams-from-structures.patch index e1c8cda77d..30a17bfd21 100644 --- a/patches/server/Remove-some-streams-from-structures.patch +++ b/patches/server/Remove-some-streams-from-structures.patch @@ -15,15 +15,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32); - world.startsForStructure(pos, (structure) -> { + // Paper start - replace for each -+ for (net.minecraft.world.level.levelgen.structure.StructureStart structureStart : structureManager.startsForStructure(pos, (structure) -> { ++ for (net.minecraft.world.level.levelgen.structure.StructureStart start : world.startsForStructure(pos, (structure) -> { return structure.terrainAdaptation() != TerrainAdjustment.NONE; - }).forEach((start) -> { -- TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation(); + })) { // Paper end -+ TerrainAdjustment terrainAdjustment = structureStart.getStructure().terrainAdaptation(); + TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation(); for(StructurePiece structurePiece : start.getPieces()) { - if (structurePiece.isCloseToChunk(pos, 12)) { +@@ -0,0 +0,0 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker { + } + + for(JigsawJunction jigsawJunction : poolElementStructurePiece.getJunctions()) { +- int i = jigsawJunction.getSourceX(); +- int j = jigsawJunction.getSourceZ(); +- if (i > i - 12 && j > j - 12 && i < i + 15 + 12 && j < j + 15 + 12) { ++ // Paper start - decompile fix ++ int i2 = jigsawJunction.getSourceX(); ++ int j2 = jigsawJunction.getSourceZ(); ++ if (i2 > i - 12 && j2 > j - 12 && i2 < i + 15 + 12 && j2 < j + 15 + 12) { ++ // Paper end + objectList2.add(jigsawJunction); + } + } @@ -0,0 +0,0 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker { } }