Make it compie

This commit is contained in:
Nassim Jahnke 2022-07-28 00:20:14 +02:00
parent 365fe29e02
commit d1727177ba
5 changed files with 24 additions and 12 deletions

View File

@ -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");
+ }

View File

@ -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

View File

@ -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) {

View File

@ -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 {

View File

@ -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 {
}
}