From 35487dbfccff8947d0c8a3635f944e54d8fec9ec Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Fri, 11 Jun 2021 15:46:25 +0200 Subject: [PATCH] Apply a few more patches Signed-off-by: Mariell Hoversholm --- .../server-remapped/0003-MC-Dev-fixes.patch | 929 ------------------ .../server/0003-Build-system-changes.patch | 4 +- .../0004-Paper-config-files.patch} | 133 +-- patches/server/0005-MC-Dev-fixes.patch | 358 +++++++ 4 files changed, 427 insertions(+), 997 deletions(-) delete mode 100644 patches/server-remapped/0003-MC-Dev-fixes.patch rename patches/{server-remapped/0002-Paper-config-files.patch => server/0004-Paper-config-files.patch} (87%) create mode 100644 patches/server/0005-MC-Dev-fixes.patch diff --git a/patches/server-remapped/0003-MC-Dev-fixes.patch b/patches/server-remapped/0003-MC-Dev-fixes.patch deleted file mode 100644 index 10c424b9a..000000000 --- a/patches/server-remapped/0003-MC-Dev-fixes.patch +++ /dev/null @@ -1,929 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 30 Mar 2016 19:36:20 -0400 -Subject: [PATCH] MC Dev fixes - - -diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 16220ce9a7db722c8b351f8016fd1df066ffcb98..8c378d3f3138953b3b22b289fecdb6b40a09ab63 100644 ---- a/src/main/java/net/minecraft/Util.java -+++ b/src/main/java/net/minecraft/Util.java -@@ -65,8 +65,8 @@ public class Util { - return Collectors.toMap(Entry::getKey, Entry::getValue); - } - -- public static > String getPropertyName(Property iblockstate, Object object) { -- return iblockstate.value((Comparable) object); -+ public static > String a(Property iblockstate, T object) { // Paper - decompile fix -+ return iblockstate.getName(object); // Paper - decompile fix - } - - public static String makeDescriptionId(String type, @Nullable ResourceLocation id) { -@@ -234,8 +234,8 @@ public class Util { - public static T findPreviousInIterable(Iterable iterable, @Nullable T t0) { - Iterator iterator = iterable.iterator(); - -- Object object; -- Object object1; -+ T object; // Paper - decompile fix -+ T object1; // Paper - decompile fix - - for (object1 = null; iterator.hasNext(); object1 = object) { - object = iterator.next(); -@@ -260,7 +260,7 @@ public class Util { - } - - public static Strategy identityStrategy() { -- return Util.IdentityStrategy.INSTANCE; -+ return (Strategy) Util.IdentityStrategy.INSTANCE; // Paper - decompile fix - } - - public static CompletableFuture> sequence(List> futures) { -@@ -271,7 +271,7 @@ public class Util { - futures.forEach((completablefuture1) -> { - int i = list1.size(); - -- list1.add((Object) null); -+ list1.add(null); // Paper - decompile fix - acompletablefuture[i] = completablefuture1.whenComplete((object, throwable) -> { - if (throwable != null) { - completablefuture.completeExceptionally(throwable); -diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index aa35d67cc27a4f982575eab3be46f4187f29d3fe..88147a1f25cf2fd549412b653b8f0eb5c60bb55d 100644 ---- a/src/main/java/net/minecraft/core/BlockPos.java -+++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -241,8 +241,8 @@ public class BlockPos extends Vec3i { - }; - } - -- public static Iterable withinManhattan(BlockPos center, int xRange, int yRange, int zRange) { -- int l = xRange + yRange + zRange; -+ public static Iterable withinManhattan(BlockPos center, int xRange, int yRange, int zRange) { // Paper - decompile issues - variable name conflicts to inner class field refs -+ int l_decompiled = xRange + yRange + zRange; // Paper - decompile issues - int i1 = center.getX(); - int j1 = center.getY(); - int k1 = center.getZ(); -@@ -270,15 +270,15 @@ public class BlockPos extends Vec3i { - ++this.x; - if (this.x > this.maxX) { - ++this.currentDepth; -- if (this.currentDepth > x) { -+ if (this.currentDepth > l_decompiled) { // Paper - use proper l above (first line of this method) - return (BlockPos) this.endOfData(); - } - -- this.maxX = Math.min(currentDepth, this.currentDepth); -+ this.maxX = Math.min(xRange, this.currentDepth); // Paper - decompile issues - this.x = -this.maxX; - } - -- this.maxY = Math.min(maxX, this.currentDepth - Math.abs(this.x)); -+ this.maxY = Math.min(yRange, this.currentDepth - Math.abs(this.x)); // Paper - decompile issues - this.y = -this.maxY; - } - -@@ -286,7 +286,7 @@ public class BlockPos extends Vec3i { - int i2 = this.y; - int j2 = this.currentDepth - Math.abs(l1) - Math.abs(i2); - -- if (j2 <= maxY) { -+ if (j2 <= zRange) { // Paper - decompile issues - this.zMirror = j2 != 0; - blockposition_mutableblockposition = this.cursor.set(i1 + l1, j1 + i2, k1 + j2); - } -@@ -355,13 +355,13 @@ public class BlockPos extends Vec3i { - }; - } - -- public static Iterable spiralAround(BlockPos blockposition, int i, Direction enumdirection, Direction enumdirection1) { -+ public static Iterable spiralAround(BlockPos blockposition, int I, Direction enumdirection, Direction enumdirection1) { // Paper - decompile fix - Validate.validState(enumdirection.getAxis() != enumdirection1.getAxis(), "The two directions cannot be on the same axis", new Object[0]); - return () -> { - return new AbstractIterator() { - private final Direction[] directions = new Direction[]{enumdirection, enumdirection1, enumdirection.getOpposite(), enumdirection1.getOpposite()}; - private final BlockPos.MutableBlockPos cursor = blockposition.mutable().move(enumdirection1); -- private final int legs = 4 * legSize; -+ private final int legs = 4 * I; - private int leg = -1; - private int legSize; - private int legIndex; -diff --git a/src/main/java/net/minecraft/core/IdMapper.java b/src/main/java/net/minecraft/core/IdMapper.java -index 71c591487853bec3cecf5777c09ddc05bd658b64..424c6cacc2e7c7b1c9d0b92fe198237033a3fcbd 100644 ---- a/src/main/java/net/minecraft/core/IdMapper.java -+++ b/src/main/java/net/minecraft/core/IdMapper.java -@@ -27,7 +27,7 @@ public class IdMapper implements IdMap { - this.tToId.put(value, id); - - while (this.idToT.size() <= id) { -- this.idToT.add((Object) null); -+ this.idToT.add(null); // Paper - decompile fix - } - - this.idToT.set(id, value); -@@ -41,6 +41,13 @@ public class IdMapper implements IdMap { - this.addMapping(value, this.nextId); - } - -+ // Paper start - decompile fix -+ @Override -+ public int a(T t) { -+ return getId(t); -+ } -+ // Paper end -+ - public int getId(T entry) { - Integer integer = (Integer) this.tToId.get(entry); - -diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java -index efc632a8ac13f77aaf2229a09e84416c09c86255..084340dc73acb3d972e0717b48da820c027a5137 100644 ---- a/src/main/java/net/minecraft/nbt/ListTag.java -+++ b/src/main/java/net/minecraft/nbt/ListTag.java -@@ -53,7 +53,7 @@ public class ListTag extends CollectionTag { - return "TAG_List"; - } - }; -- private static final ByteSet INLINE_ELEMENT_TYPES = new ByteOpenHashSet(Arrays.asList(1, 2, 3, 4, 5, 6)); -+ private static final ByteSet INLINE_ELEMENT_TYPES = new ByteOpenHashSet(Arrays.asList((byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6)); // Paper - decompiler fix - private final List list; - private byte type; - -diff --git a/src/main/java/net/minecraft/nbt/NbtIo.java b/src/main/java/net/minecraft/nbt/NbtIo.java -index 5494db9e8e04d976aa1b005a108b452cd481d0bb..c4fbc0bc8b80d16f09d3c6642acc7476a0817868 100644 ---- a/src/main/java/net/minecraft/nbt/NbtIo.java -+++ b/src/main/java/net/minecraft/nbt/NbtIo.java -@@ -18,6 +18,7 @@ import java.util.zip.GZIPOutputStream; - import net.minecraft.CrashReport; - import net.minecraft.CrashReportCategory; - import net.minecraft.ReportedException; -+import io.netty.buffer.ByteBufInputStream; // Paper - - public class NbtIo { - -@@ -137,7 +138,7 @@ public class NbtIo { - - public static CompoundTag read(DataInput input, NbtAccounter tracker) throws IOException { - // Spigot start -- if ( input instanceof io.netty.buffer.ByteBufInputStream ) -+ if ( input instanceof ByteBufInputStream) // Paper - { - input = new DataInputStream(new org.spigotmc.LimitStream((InputStream) input, tracker)); - } -diff --git a/src/main/java/net/minecraft/nbt/Tag.java b/src/main/java/net/minecraft/nbt/Tag.java -index 483c33e9b2d64c1a003d3bb543486b8a545bc96a..85e9c5f4620fcf48cb3655fbb2db58b3fb31aa74 100644 ---- a/src/main/java/net/minecraft/nbt/Tag.java -+++ b/src/main/java/net/minecraft/nbt/Tag.java -@@ -20,7 +20,7 @@ public interface Tag { - - TagType getType(); - -- Tag copy(); -+ public Tag copy(); // Paper - decompile fix - - default String getAsString() { - return this.toString(); -diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java -index a12d169edf4e087b18fedf7199d6eb7ee58f0305..fca778d131aa10e88d5f7ed8d57eda6803318184 100644 ---- a/src/main/java/net/minecraft/network/ConnectionProtocol.java -+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java -@@ -14,23 +14,29 @@ import net.minecraft.network.protocol.Packet; - import net.minecraft.network.protocol.PacketFlow; - import net.minecraft.network.protocol.game.*; - import net.minecraft.network.protocol.handshake.ClientIntentionPacket; -+import net.minecraft.network.protocol.handshake.ServerHandshakePacketListener; -+import net.minecraft.network.protocol.login.ClientLoginPacketListener; - import net.minecraft.network.protocol.login.ClientboundCustomQueryPacket; - import net.minecraft.network.protocol.login.ClientboundGameProfilePacket; - import net.minecraft.network.protocol.login.ClientboundHelloPacket; - import net.minecraft.network.protocol.login.ClientboundLoginCompressionPacket; - import net.minecraft.network.protocol.login.ClientboundLoginDisconnectPacket; -+import net.minecraft.network.protocol.login.ServerLoginPacketListener; - import net.minecraft.network.protocol.login.ServerboundCustomQueryPacket; - import net.minecraft.network.protocol.login.ServerboundHelloPacket; - import net.minecraft.network.protocol.login.ServerboundKeyPacket; -+import net.minecraft.network.protocol.status.ClientStatusPacketListener; - import net.minecraft.network.protocol.status.ClientboundPongResponsePacket; - import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket; -+import net.minecraft.network.protocol.status.ServerStatusPacketListener; - import net.minecraft.network.protocol.status.ServerboundPingRequestPacket; - import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket; - import org.apache.logging.log4j.LogManager; - - public enum ConnectionProtocol { - -- HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).a(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).a(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).a(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).a(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).a(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).a(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).a(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).a(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).a(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).a(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).a(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).a(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).a(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).a(ClientboundChatPacket.class, ClientboundChatPacket::new).a(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).a(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).a(ClientboundContainerAckPacket.class, ClientboundContainerAckPacket::new).a(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).a(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).a(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).a(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).a(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).a(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).a(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).a(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).a(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).a(ClientboundExplodePacket.class, ClientboundExplodePacket::new).a(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).a(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).a(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).a(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).a(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).a(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).a(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).a(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).a(ClientboundLoginPacket.class, ClientboundLoginPacket::new).a(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).a(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).a(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::new).a(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::new).a(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::new).a(ClientboundMoveEntityPacket.class, ClientboundMoveEntityPacket::new).a(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).a(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).a(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).a(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).a(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).a(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).a(ClientboundPlayerCombatPacket.class, ClientboundPlayerCombatPacket::new).a(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).a(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).a(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).a(ClientboundRecipePacket.class, ClientboundRecipePacket::new).a(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new).a(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).a(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).a(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).a(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).a(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).a(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).a(ClientboundSetBorderPacket.class, ClientboundSetBorderPacket::new).a(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).a(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).a(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).a(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).a(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).a(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).a(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).a(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).a(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).a(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).a(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).a(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).a(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).a(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).a(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).a(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).a(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).a(ClientboundSetTitlesPacket.class, ClientboundSetTitlesPacket::new).a(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).a(ClientboundSoundPacket.class, ClientboundSoundPacket::new).a(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).a(ClientboundTabListPacket.class, ClientboundTabListPacket::new).a(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).a(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).a(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).a(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).a(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).a(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).a(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).a(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).a(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).a(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).a(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).a(ServerboundChatPacket.class, ServerboundChatPacket::new).a(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).a(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).a(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).a(ServerboundContainerAckPacket.class, ServerboundContainerAckPacket::new).a(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).a(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).a(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).a(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).a(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).a(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).a(ServerboundInteractPacket.class, ServerboundInteractPacket::new).a(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).a(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).a(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).a(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::new).a(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::new).a(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::new).a(ServerboundMovePlayerPacket.class, ServerboundMovePlayerPacket::new).a(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).a(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).a(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).a(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).a(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).a(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).a(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).a(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).a(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).a(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).a(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).a(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).a(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).a(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).a(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).a(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).a(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).a(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).a(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).a(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).a(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).a(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).a(ServerboundSwingPacket.class, ServerboundSwingPacket::new).a(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).a(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).a(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), STATUS(1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).a(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).a(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).a(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), LOGIN(2, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).a(ClientboundHelloPacket.class, ClientboundHelloPacket::new).a(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).a(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).a(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).a(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet<>()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).a(ServerboundKeyPacket.class, ServerboundKeyPacket::new).a(ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new))); -+ // Paper - fix decompile error - add generic names to < > like PacketListenerPlayOut -+ HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerAckPacket.class, ClientboundContainerAckPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::new).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::new).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::new).addPacket(ClientboundMoveEntityPacket.class, ClientboundMoveEntityPacket::new).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatPacket.class, ClientboundPlayerCombatPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetBorderPacket.class, ClientboundSetBorderPacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitlesPacket.class, ClientboundSetTitlesPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerAckPacket.class, ServerboundContainerAckPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::new).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::new).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::new).addPacket(ServerboundMovePlayerPacket.class, ServerboundMovePlayerPacket::new).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), STATUS(1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), LOGIN(2, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new))); - - private static final ConnectionProtocol[] LOOKUP = new ConnectionProtocol[4]; - private static final Map>, ConnectionProtocol> PROTOCOL_BY_PACKET = Maps.newHashMap(); -@@ -115,7 +121,7 @@ public enum ConnectionProtocol { - private final List>> idToConstructor; - - private PacketSet() { -- this.classToId = (Object2IntMap) Util.make((Object) (new Object2IntOpenHashMap()), (object2intopenhashmap) -> { -+ this.classToId = (Object2IntMap) Util.make(new Object2IntOpenHashMap(), (object2intopenhashmap) -> { // Paper - fix decompile error - object2intopenhashmap.defaultReturnValue(-1); - }); - this.idToConstructor = Lists.newArrayList(); -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 21f461ce884bc547dbe81c5430be530423c1605c..37a51dee4cd37844e80fdd5c9853947201151dfc 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1673,9 +1673,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoopmap(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error - }, this).thenCompose((immutablelist) -> { -- return ServerResources.loadResources(immutablelist, this.isDedicatedServer() ? Commands.CommandSelection.DEDICATED : Commands.CommandSelection.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this); -+ return ServerResources.loadResources(immutablelist, this.isDedicatedServer() ? Commands.CommandSelection.DEDICATED : Commands.CommandSelection.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this); // Paper - decompile error - }).thenAcceptAsync((datapackresources) -> { - this.resources.close(); - this.resources = datapackresources; -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 37e938b258ee4eb5f5bab56145e83b640d80bcc7..23506a8903ce64fbfe849bb94e589bdbb6e61a74 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1913,7 +1913,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl - } - - // CraftBukkit - decompile error -- return (String) object2intopenhashmap.object2IntEntrySet().stream().sorted(Comparator.comparing(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry::getIntValue).reversed()).limit(5L).map((it_unimi_dsi_fastutil_objects_object2intmap_entry) -> { -+ return (String) object2intopenhashmap.object2IntEntrySet().stream().sorted(Comparator.comparing(Object2IntMap.Entry::getIntValue).reversed()).limit(5L).map((it_unimi_dsi_fastutil_objects_object2intmap_entry) -> { // Paper - decompile fix - return it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey() + ":" + it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue(); - }).collect(Collectors.joining(",")); - } catch (Exception exception) { -diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java -index ad8a9d14e17b5e40b2cc3a83154931734d6c73d7..cc4190b3a8904d1eaae0f542a3b3090583f5ff82 100644 ---- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java -+++ b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java -@@ -179,9 +179,9 @@ public class ThreadedLevelLightEngine extends LevelLightEngine implements AutoCl - - public void tryScheduleUpdate() { - if ((!this.lightTasks.isEmpty() || super.hasLightWork()) && this.scheduled.compareAndSet(false, true)) { -- this.taskMailbox.tell((Object) (() -> { -- this.b(); -- this.g.set(false); -+ this.taskMailbox.tell((() -> { // Paper - decompile error -+ this.runUpdate(); -+ this.scheduled.set(false); - })); - } - -diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java -index 90df41ec5081fe4ef2bc507e7289b18e0fea6e53..0c118d482e304c567fe7fe778c6ff386f960bdde 100644 ---- a/src/main/java/net/minecraft/server/level/Ticket.java -+++ b/src/main/java/net/minecraft/server/level/Ticket.java -@@ -23,7 +23,7 @@ public final class Ticket implements Comparable> { - } else { - int j = Integer.compare(System.identityHashCode(this.type), System.identityHashCode(ticket.type)); - -- return j != 0 ? j : this.type.getComparator().compare(this.key, ticket.key); -+ return j != 0 ? j : this.type.getComparator().compare(this.key, (T)ticket.key); // Paper - decompile fix - } - } - -diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java -index d624c390f8550c6aa44ca5920d127c901903ce27..7d435998680a363ad06c2e08139010c2573f7fb3 100644 ---- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java -+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java -@@ -203,7 +203,7 @@ public class ServerStatsCounter extends StatsCounter { - ObjectIterator objectiterator = this.stats.object2IntEntrySet().iterator(); - - while (objectiterator.hasNext()) { -- it.unimi.dsi.fastutil.objects.Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next(); -+ Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (Object2IntMap.Entry) objectiterator.next(); // Paper - decompile fix - Stat statistic = (Stat) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey(); - - ((JsonObject) map.computeIfAbsent(statistic.getType(), (statisticwrapper) -> { -diff --git a/src/main/java/net/minecraft/util/CrudeIncrementalIntIdentityHashBiMap.java b/src/main/java/net/minecraft/util/CrudeIncrementalIntIdentityHashBiMap.java -index 74eb1ed6b3fafeaca7e65a88a982d759d6836853..66ad412e4368a8615cc66a97ac442c572813a3dd 100644 ---- a/src/main/java/net/minecraft/util/CrudeIncrementalIntIdentityHashBiMap.java -+++ b/src/main/java/net/minecraft/util/CrudeIncrementalIntIdentityHashBiMap.java -@@ -18,11 +18,18 @@ public class CrudeIncrementalIntIdentityHashBiMap implements IdMap { - - public CrudeIncrementalIntIdentityHashBiMap(int size) { - size = (int) ((float) size / 0.8F); -- this.keys = (Object[]) (new Object[size]); -+ this.keys = (K[]) (new Object[size]); // Paper - decompile fix - this.values = new int[size]; -- this.byId = (Object[]) (new Object[size]); -+ this.byId = (K[]) (new Object[size]); // Paper - decompile fix - } - -+ // Paper start - decompile fix -+ @Override -+ public int a(K k) { -+ return getId(k); -+ } -+ // Paper end -+ - public int getId(@Nullable K entry) { - return this.getValue(this.indexOf(entry, this.hash(entry))); - } -@@ -56,9 +63,9 @@ public class CrudeIncrementalIntIdentityHashBiMap implements IdMap { - K[] ak = this.keys; - int[] aint = this.values; - -- this.keys = (Object[]) (new Object[newSize]); -+ this.keys = (K[]) (new Object[newSize]); // Paper - decompile fix - this.values = new int[newSize]; -- this.byId = (Object[]) (new Object[newSize]); -+ this.byId = (K[]) (new Object[newSize]); // Paper - decompile fix - this.nextId = 0; - this.size = 0; - -diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java -index be40fc388c501c311d661927025f1c572f3b3493..93813a508be1e1e600a8211f9822f2087328de70 100644 ---- a/src/main/java/net/minecraft/util/SortedArraySet.java -+++ b/src/main/java/net/minecraft/util/SortedArraySet.java -@@ -23,11 +23,11 @@ public class SortedArraySet extends AbstractSet { - } - - public static > SortedArraySet create(int initialCapacity) { -- return new SortedArraySet<>(initialCapacity, Comparator.naturalOrder()); -+ return new SortedArraySet<>(initialCapacity, (Comparator)Comparator.naturalOrder()); // Paper - decompile fix - } - - private static T[] castRawArray(Object[] array) { -- return (Object[]) array; -+ return (T[])array; // Paper - decompile fix - } - - private int findIndex(T object) { -@@ -101,7 +101,7 @@ public class SortedArraySet extends AbstractSet { - } - - public boolean remove(Object object) { -- int i = this.findIndex(object); -+ int i = this.findIndex((T)object); // Paper - decompile fix - - if (i >= 0) { - this.removeInternal(i); -@@ -116,7 +116,7 @@ public class SortedArraySet extends AbstractSet { - } - - public boolean contains(Object object) { -- int i = this.findIndex(object); -+ int i = this.findIndex((T)object); // Paper - decompile fix - - return i >= 0; - } -@@ -135,7 +135,7 @@ public class SortedArraySet extends AbstractSet { - - public U[] toArray(U[] au) { - if (au.length < this.size) { -- return (Object[]) Arrays.copyOf(this.contents, this.size, au.getClass()); -+ return (U[])Arrays.copyOf(this.contents, this.size, au.getClass()); // Paper - decompile fix - } else { - System.arraycopy(this.contents, 0, au, 0, this.size); - if (au.length > this.size) { -diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -index d9375f83de6d069f603f8a48cc5b02194e940052..03831adce7905916423d8c3834c42c90f3a1ca8f 100644 ---- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -@@ -55,7 +55,7 @@ public abstract class BlockableEventLoop implements Processo - return this.submitAsync(task); - } else { - task.run(); -- return CompletableFuture.completedFuture((Object) null); -+ return CompletableFuture.completedFuture(null); // Paper - decompile fix - } - } - -@@ -90,14 +90,14 @@ public abstract class BlockableEventLoop implements Processo - } - - protected boolean pollTask() { -- R r0 = (Runnable) this.pendingRunnables.peek(); -+ R r0 = this.pendingRunnables.peek(); // Paper - decompile fix - - if (r0 == null) { - return false; - } else if (this.blockingCount == 0 && !this.shouldRun(r0)) { - return false; - } else { -- this.doRunTask((Runnable) this.pendingRunnables.remove()); -+ this.doRunTask(this.pendingRunnables.remove()); // Paper - decompile fix - return true; - } - } -diff --git a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -index cc77767947e458e7205e616dce3bea8da09ca0cf..c763aa0c0cf49dd844af94a820103258b49021ae 100644 ---- a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -+++ b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -@@ -100,7 +100,7 @@ public class ProcessorMailbox implements ProcessorHandle, AutoCloseable, R - - public void run() { - try { -- this.pollUntil((i) -> { -+ this.pollUntil((int i) -> { // Paper - decompile fix - return i == 0; - }); - } finally { -diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java -index 8f686f8608771d0a444dfd51dd4eabc90c6b2262..33a8604fa6c6431ccc5f61e484c163e09f1625a0 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java -+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java -@@ -191,9 +191,9 @@ public class PoiManager extends SectionStorage { - } - - private static boolean mayHavePoi(LevelChunkSection chunksection) { -- Set set = PoiType.ALL_STATES; -+ Set set = PoiType.ALL_STATES; // Paper - decompile error - -- set.getClass(); -+ //set.getClass(); // Paper - decompile error - return chunksection.maybeHas(set::contains); - } - -@@ -211,7 +211,7 @@ public class PoiManager extends SectionStorage { - SectionPos.aroundChunk(new ChunkPos(pos), Math.floorDiv(radius, 16)).map((sectionposition) -> { - return Pair.of(sectionposition, this.getOrLoad(sectionposition.asLong())); - }).filter((pair) -> { -- return !(Boolean) ((Optional) pair.getSecond()).map(PoiSection::a).orElse(false); -+ return !(Boolean) (pair.getSecond()).map(PoiSection::isValid).orElse(false); // Paper - decompile fix - }).map((pair) -> { - return ((SectionPos) pair.getFirst()).chunk(); - }).filter((chunkcoordintpair) -> { -@@ -257,13 +257,13 @@ public class PoiManager extends SectionStorage { - - public static enum Occupancy { - -- HAS_SPACE(PoiRecord::d), IS_OCCUPIED(PoiRecord::e), ANY((villageplacerecord) -> { -+ HAS_SPACE(PoiRecord::hasSpace), IS_OCCUPIED(PoiRecord::isOccupied), ANY((villageplacerecord) -> { - return true; - }); - - private final Predicate test; - -- private Occupancy(Predicate predicate) { -+ private Occupancy(Predicate predicate) { // Paper - decompile fix - this.test = predicate; - } - -diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -index 97317517a729877e307407ca9fab5fa58657fe38..a41f61daf6cbbb13d0b86cdbad8a4cae00368653 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -@@ -65,7 +65,7 @@ public class Vindicator extends AbstractIllager { - this.goalSelector.addGoal(2, new AbstractIllager.RaiderOpenDoorGoal(this)); - this.goalSelector.addGoal(3, new Raider.HoldGroundAttackGoal(this, 10.0F)); - this.goalSelector.addGoal(4, new Vindicator.VindicatorMeleeAttackGoal(this)); -- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).canUse()); -+ this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers(new Class[0])); // Paper - decompile fix - this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); - this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, true)); - this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); -diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -index ad4e181b24829980dc12f46807ec1c5226bd8e0c..fd1b84baae5f333c58dbbdcbfaa9198328f0961d 100644 ---- a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -+++ b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -@@ -47,12 +47,12 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData; - - public class VillagerTrades { - -- public static final Map> TRADES = (Map) Util.make((Object) Maps.newHashMap(), (hashmap) -> { -+ public static final Map> TRADES = Util.make(Maps.newHashMap(), (hashmap) -> { // Paper - decompile fix - hashmap.put(VillagerProfession.FARMER, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.WHEAT, 20, 16, 2), new VillagerTrades.EmeraldForItems(Items.POTATO, 26, 16, 2), new VillagerTrades.EmeraldForItems(Items.CARROT, 22, 16, 2), new VillagerTrades.EmeraldForItems(Items.BEETROOT, 15, 16, 2), new VillagerTrades.ItemsForEmeralds(Items.BREAD, 1, 6, 16, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Blocks.PUMPKIN, 6, 12, 10), new VillagerTrades.ItemsForEmeralds(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.ItemsForEmeralds(Items.APPLE, 1, 4, 16, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.COOKIE, 3, 18, 10), new VillagerTrades.EmeraldForItems(Blocks.MELON, 4, 12, 20)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Blocks.CAKE, 1, 1, 12, 15), new VillagerTrades.SuspisciousStewForEmerald(MobEffects.NIGHT_VISION, 100, 15), new VillagerTrades.SuspisciousStewForEmerald(MobEffects.JUMP, 160, 15), new VillagerTrades.SuspisciousStewForEmerald(MobEffects.WEAKNESS, 140, 15), new VillagerTrades.SuspisciousStewForEmerald(MobEffects.BLINDNESS, 120, 15), new VillagerTrades.SuspisciousStewForEmerald(MobEffects.POISON, 280, 15), new VillagerTrades.SuspisciousStewForEmerald(MobEffects.SATURATION, 7, 15)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.GOLDEN_CARROT, 3, 3, 30), new VillagerTrades.ItemsForEmeralds(Items.GLISTERING_MELON_SLICE, 4, 3, 30)}))); -- hashmap.put(VillagerProfession.FISHERMAN, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.STRING, 20, 16, 2), new VillagerTrades.EmeraldForItems(Items.COAL, 10, 16, 2), new VillagerTrades.ItemsAndEmeraldsToItems(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.ItemsForEmeralds(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.COD, 15, 16, 10), new VillagerTrades.ItemsAndEmeraldsToItems(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.ItemsForEmeralds(Items.rn, 2, 1, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.SALMON, 13, 16, 20), new VillagerTrades.EnchantedItemForEmeralds(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.EmeraldsForVillagerTypeItem(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); -+ hashmap.put(VillagerProfession.FISHERMAN, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.STRING, 20, 16, 2), new VillagerTrades.EmeraldForItems(Items.COAL, 10, 16, 2), new VillagerTrades.ItemsAndEmeraldsToItems(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.ItemsForEmeralds(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.COD, 15, 16, 10), new VillagerTrades.ItemsAndEmeraldsToItems(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.ItemsForEmeralds(Items.rn, 2, 1, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.SALMON, 13, 16, 20), new VillagerTrades.EnchantedItemForEmeralds(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.EmeraldsForVillagerTypeItem(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // Paper - add to ImmutableMap..builder() - hashmap.put(VillagerProfession.SHEPHERD, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Blocks.WHITE_WOOL, 18, 16, 2), new VillagerTrades.EmeraldForItems(Blocks.BROWN_WOOL, 18, 16, 2), new VillagerTrades.EmeraldForItems(Blocks.BLACK_WOOL, 18, 16, 2), new VillagerTrades.EmeraldForItems(Blocks.GRAY_WOOL, 18, 16, 2), new VillagerTrades.ItemsForEmeralds(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.WHITE_DYE, 12, 16, 10), new VillagerTrades.EmeraldForItems(Items.GRAY_DYE, 12, 16, 10), new VillagerTrades.EmeraldForItems(Items.BLACK_DYE, 12, 16, 10), new VillagerTrades.EmeraldForItems(Items.LIGHT_BLUE_DYE, 12, 16, 10), new VillagerTrades.EmeraldForItems(Items.LIME_DYE, 12, 16, 10), new VillagerTrades.ItemsForEmeralds(Blocks.WHITE_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.ORANGE_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.MAGENTA_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.LIGHT_BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.YELLOW_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.LIME_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.PINK_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.LIGHT_GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.CYAN_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.PURPLE_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.BROWN_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.GREEN_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.RED_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.BLACK_WOOL, 1, 1, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.WHITE_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.ORANGE_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.MAGENTA_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.LIGHT_BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.YELLOW_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.LIME_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.PINK_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.LIGHT_GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.CYAN_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.PURPLE_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.BROWN_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.GREEN_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.RED_CARPET, 1, 4, 16, 5), new VillagerTrades.ItemsForEmeralds(Blocks.BLACK_CARPET, 1, 4, 16, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.YELLOW_DYE, 12, 16, 20), new VillagerTrades.EmeraldForItems(Items.LIGHT_GRAY_DYE, 12, 16, 20), new VillagerTrades.EmeraldForItems(Items.ORANGE_DYE, 12, 16, 20), new VillagerTrades.EmeraldForItems(Items.RED_DYE, 12, 16, 20), new VillagerTrades.EmeraldForItems(Items.PINK_DYE, 12, 16, 20), new VillagerTrades.ItemsForEmeralds(Blocks.WHITE_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.YELLOW_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.RED_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.BLACK_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.BLUE_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.BROWN_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.CYAN_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.GRAY_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.GREEN_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.LIGHT_BLUE_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.LIGHT_GRAY_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.LIME_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.MAGENTA_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.ORANGE_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.PINK_BED, 3, 1, 12, 10), new VillagerTrades.ItemsForEmeralds(Blocks.PURPLE_BED, 3, 1, 12, 10)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.BROWN_DYE, 12, 16, 30), new VillagerTrades.EmeraldForItems(Items.PURPLE_DYE, 12, 16, 30), new VillagerTrades.EmeraldForItems(Items.BLUE_DYE, 12, 16, 30), new VillagerTrades.EmeraldForItems(Items.GREEN_DYE, 12, 16, 30), new VillagerTrades.EmeraldForItems(Items.MAGENTA_DYE, 12, 16, 30), new VillagerTrades.EmeraldForItems(Items.CYAN_DYE, 12, 16, 30), new VillagerTrades.ItemsForEmeralds(Items.WHITE_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.LIGHT_BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.RED_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.PINK_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.GREEN_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.LIME_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.GRAY_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.BLACK_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.PURPLE_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.MAGENTA_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.CYAN_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.BROWN_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.YELLOW_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.ORANGE_BANNER, 3, 1, 12, 15), new VillagerTrades.ItemsForEmeralds(Items.LIGHT_GRAY_BANNER, 3, 1, 12, 15)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.PAINTING, 2, 3, 30)}))); - hashmap.put(VillagerProfession.FLETCHER, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.STICK, 32, 16, 2), new VillagerTrades.ItemsForEmeralds(Items.ARROW, 1, 16, 1), new VillagerTrades.ItemsAndEmeraldsToItems(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.FLINT, 26, 12, 10), new VillagerTrades.ItemsForEmeralds(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.STRING, 14, 16, 20), new VillagerTrades.ItemsForEmeralds(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.FEATHER, 24, 16, 30), new VillagerTrades.EnchantedItemForEmeralds(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.es, 8, 12, 30), new VillagerTrades.EnchantedItemForEmeralds(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.TippedArrowForItemsAndEmeralds(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)}))); -- hashmap.put(VillagerProfession.LIBRARIAN, toIntMap(ImmutableMap.builder().put(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.PAPER, 24, 16, 2), new VillagerTrades.EnchantBookForEmeralds(1), new VillagerTrades.ItemsForEmeralds(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.BOOK, 4, 12, 10), new VillagerTrades.EnchantBookForEmeralds(5), new VillagerTrades.ItemsForEmeralds(Items.rk, 1, 1, 5)}).put(3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.INK_SAC, 5, 12, 20), new VillagerTrades.EnchantBookForEmeralds(10), new VillagerTrades.ItemsForEmeralds(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.EnchantBookForEmeralds(15), new VillagerTrades.ItemsForEmeralds(Items.CLOCK, 5, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.NAME_TAG, 20, 1, 30)}).build())); -+ hashmap.put(VillagerProfession.LIBRARIAN, toIntMap(ImmutableMap.builder().put(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.PAPER, 24, 16, 2), new VillagerTrades.EnchantBookForEmeralds(1), new VillagerTrades.ItemsForEmeralds(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.BOOK, 4, 12, 10), new VillagerTrades.EnchantBookForEmeralds(5), new VillagerTrades.ItemsForEmeralds(Items.rk, 1, 1, 5)}).put(3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.INK_SAC, 5, 12, 20), new VillagerTrades.EnchantBookForEmeralds(10), new VillagerTrades.ItemsForEmeralds(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.EnchantBookForEmeralds(15), new VillagerTrades.ItemsForEmeralds(Items.CLOCK, 5, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.NAME_TAG, 20, 1, 30)}).build())); // Paper - add to ImmutableMap..builder() - hashmap.put(VillagerProfession.CARTOGRAPHER, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.PAPER, 24, 16, 2), new VillagerTrades.ItemsForEmeralds(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.dP, 11, 16, 10), new VillagerTrades.TreasureMapForEmeralds(13, StructureFeature.OCEAN_MONUMENT, MapDecoration.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.COMPASS, 1, 12, 20), new VillagerTrades.TreasureMapForEmeralds(14, StructureFeature.WOODLAND_MANSION, MapDecoration.Type.MANSION, 12, 10)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.ItemsForEmeralds(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.ItemsForEmeralds(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)}))); - hashmap.put(VillagerProfession.CLERIC, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.ROTTEN_FLESH, 32, 16, 2), new VillagerTrades.ItemsForEmeralds(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.GOLD_INGOT, 3, 12, 10), new VillagerTrades.ItemsForEmeralds(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.RABBIT_FOOT, 2, 12, 20), new VillagerTrades.ItemsForEmeralds(Blocks.GLOWSTONE, 4, 1, 12, 10)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.SCUTE, 4, 12, 30), new VillagerTrades.EmeraldForItems(Items.GLASS_BOTTLE, 9, 12, 30), new VillagerTrades.ItemsForEmeralds(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.NETHER_WART, 22, 12, 30), new VillagerTrades.ItemsForEmeralds(Items.EXPERIENCE_BOTTLE, 3, 1, 30)}))); - hashmap.put(VillagerProfession.ARMORER, toIntMap(ImmutableMap.of(1, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.COAL, 15, 16, 2), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.rj), 36, 1, 12, 5, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.ItemListing[]{new VillagerTrades.EmeraldForItems(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.EmeraldForItems(Items.DIAMOND, 1, 12, 20), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.ItemsForEmeralds(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.ItemListing[]{new VillagerTrades.EnchantedItemForEmeralds(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.EnchantedItemForEmeralds(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.ItemListing[]{new VillagerTrades.EnchantedItemForEmeralds(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.EnchantedItemForEmeralds(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)}))); -diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -index 86d7af20fad04405f95c71e078d41070abdc43ad..c4777997cfff364818fbaee70afd7c79099213fb 100644 ---- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -@@ -75,7 +75,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { - } - - this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> { -- return (entry1.getValue()); // CraftBukkit -+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* - })); - RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); - } -diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index 1276769b22ae21f0ff4271ecc72d4aa39ddff23f..7e7a58b9a9ececdcc37fc33b33703428eb1d5faf 100644 ---- a/src/main/java/net/minecraft/world/level/EntityGetter.java -+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java -@@ -167,22 +167,22 @@ public interface EntityGetter { - - @Nullable - default T getNearestEntity(Class entityClass, TargetingConditions targetPredicate, @Nullable LivingEntity entity, double x, double y, double z, AABB box) { -- return this.getNearestEntity(this.getEntitiesOfClass(entityClass, box, (Predicate) null), targetPredicate, entity, x, y, z); -+ return this.getNearestEntity(this.getEntitiesOfClass(entityClass, box, null), targetPredicate, entity, x, y, z); // Paper - decompile fix - } - - @Nullable - default T getNearestLoadedEntity(Class entityClass, TargetingConditions targetPredicate, @Nullable LivingEntity entity, double x, double y, double z, AABB box) { -- return this.getNearestEntity(this.getLoadedEntitiesOfClass(entityClass, box, (Predicate) null), targetPredicate, entity, x, y, z); -+ return this.getNearestEntity(this.getLoadedEntitiesOfClass(entityClass, box, null), targetPredicate, entity, x, y, z); // Paper - decompile fix - } - - @Nullable - default T getNearestEntity(List entityList, TargetingConditions targetPredicate, @Nullable LivingEntity entity, double x, double y, double z) { - double d3 = -1.0D; - T t0 = null; -- Iterator iterator = entityList.iterator(); -+ Iterator iterator = entityList.iterator(); // Paper - decompile fix - - while (iterator.hasNext()) { -- T t1 = (LivingEntity) iterator.next(); -+ T t1 = iterator.next(); // Paper - decompile fix - - if (targetPredicate.test(entity, t1)) { - double d4 = t1.distanceToSqr(x, y, z); -@@ -215,10 +215,10 @@ public interface EntityGetter { - default List getNearbyEntities(Class entityClass, TargetingConditions targetPredicate, LivingEntity targetingEntity, AABB box) { - List list = this.getEntitiesOfClass(entityClass, box, (Predicate) null); - List list1 = Lists.newArrayList(); -- Iterator iterator = list.iterator(); -+ Iterator iterator = list.iterator(); // Paper - decompile fix - - while (iterator.hasNext()) { -- T t0 = (LivingEntity) iterator.next(); -+ T t0 = iterator.next(); // Paper - decompile fix - - if (targetPredicate.test(targetingEntity, t0)) { - list1.add(t0); -diff --git a/src/main/java/net/minecraft/world/level/TickNextTickData.java b/src/main/java/net/minecraft/world/level/TickNextTickData.java -index c6e64c5182d564664464e26df27e6b5f7da418e6..d97e266b83bb331fcd4031046a5843d29ce53164 100644 ---- a/src/main/java/net/minecraft/world/level/TickNextTickData.java -+++ b/src/main/java/net/minecraft/world/level/TickNextTickData.java -@@ -38,13 +38,13 @@ public class TickNextTickData { - return this.pos.hashCode(); - } - -- public static Comparator> createTimeComparator() { -+ public static Comparator createTimeComparator() { // Paper - decompile fix - return Comparator.comparingLong((nextticklistentry) -> { -- return nextticklistentry.b; -+ return ((TickNextTickData) nextticklistentry).triggerTick; // Paper - decompile fix - }).thenComparing((nextticklistentry) -> { -- return nextticklistentry.c; -+ return ((TickNextTickData) nextticklistentry).priority; // Paper - decompile fix - }).thenComparingLong((nextticklistentry) -> { -- return nextticklistentry.f; -+ return ((TickNextTickData) nextticklistentry).c; // Paper - decompile fix - }); - } - -diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java -index 79be56c26b66351bcfcd96c9967f0ce91e40d5ce..ed83335175bb882741dfaef251ab30ce1590f74c 100644 ---- a/src/main/java/net/minecraft/world/level/biome/Biome.java -+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java -@@ -49,36 +49,43 @@ import org.apache.logging.log4j.Logger; - public final class Biome { - - public static final Logger LOGGER = LogManager.getLogger(); -+ // Paper start -+ private static class dProxy extends Biome.ClimateSettings { -+ private dProxy(Precipitation precipitation, float temperature, TemperatureModifier temperatureModifier, float downfall) { -+ super(precipitation, temperature, temperatureModifier, downfall); -+ } -+ }; -+ // Paper end - public static final Codec DIRECT_CODEC = RecordCodecBuilder.create((instance) -> { -- return instance.group(BiomeBase.d.a.forGetter((biomebase) -> { -- return biomebase.j; -+ return instance.group(dProxy.CODEC.forGetter((biomebase) -> { // Paper -+ return biomebase.climateSettings; - }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biomebase) -> { -- return biomebase.o; -+ return biomebase.biomeCategory; - }), Codec.FLOAT.fieldOf("depth").forGetter((biomebase) -> { -- return biomebase.m; -+ return biomebase.depth; - }), Codec.FLOAT.fieldOf("scale").forGetter((biomebase) -> { -- return biomebase.n; -+ return biomebase.scale; - }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biomebase) -> { -- return biomebase.p; -+ return biomebase.specialEffects; - }), BiomeGenerationSettings.CODEC.forGetter((biomebase) -> { -- return biomebase.k; -+ return biomebase.generationSettings; - }), MobSpawnSettings.CODEC.forGetter((biomebase) -> { -- return biomebase.l; -+ return biomebase.mobSettings; - })).apply(instance, Biome::new); - }); - public static final Codec NETWORK_CODEC = RecordCodecBuilder.create((instance) -> { -- return instance.group(BiomeBase.d.a.forGetter((biomebase) -> { -- return biomebase.j; -+ return instance.group(dProxy.CODEC.forGetter((biomebase) -> { // Paper -+ return biomebase.climateSettings; - }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biomebase) -> { -- return biomebase.o; -+ return biomebase.biomeCategory; - }), Codec.FLOAT.fieldOf("depth").forGetter((biomebase) -> { -- return biomebase.m; -+ return biomebase.depth; - }), Codec.FLOAT.fieldOf("scale").forGetter((biomebase) -> { -- return biomebase.n; -+ return biomebase.scale; - }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biomebase) -> { -- return biomebase.p; -+ return biomebase.specialEffects; - })).apply(instance, (biomebase_d, biomebase_geography, ofloat, ofloat1, biomefog) -> { -- return new BiomeBase(biomebase_d, biomebase_geography, ofloat, ofloat1, biomefog, BiomeSettingsGeneration.b, BiomeSettingsMobs.b); -+ return new Biome(biomebase_d, biomebase_geography, ofloat, ofloat1, biomefog, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY); - }); - }); - public static final Codec> CODEC = RegistryFileCodec.a(Registry.BIOME_REGISTRY, Biome.DIRECT_CODEC); -diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -index 94a02cb23a210ee0cc789db15853b6672ec673f4..73888713746e7ddd72ba9ac9d33d8e616eb3bd25 100644 ---- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -@@ -160,7 +160,7 @@ public class PistonMovingBlockEntity extends BlockEntity implements TickableBloc - private static void moveEntityByPiston(Direction enumdirection, Entity entity, double d0, Direction enumdirection1) { - PistonMovingBlockEntity.NOCLIP.set(enumdirection); - entity.move(MoverType.PISTON, new Vec3(d0 * (double) enumdirection1.getStepX(), d0 * (double) enumdirection1.getStepY(), d0 * (double) enumdirection1.getStepZ())); -- PistonMovingBlockEntity.NOCLIP.set((Object) null); -+ PistonMovingBlockEntity.NOCLIP.set(null); // Paper - decompile fix - } - - private void moveStuckEntities(float f) { -diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java -index 95ad396fc46a587d08b87943aa05dd72d35efd3a..60ce75c7f94c995d3753c40bc8d1ec09b4d37b1a 100644 ---- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java -+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java -@@ -28,12 +28,12 @@ public abstract class StateHolder { - } else { - Property iblockstate = (Property) entry.getKey(); - -- return iblockstate.getName() + "=" + this.getName(iblockstate, (Comparable) entry.getValue()); -+ return iblockstate.getName() + "=" + this.getName((Property) iblockstate, (Comparable) entry.getValue()); // Paper - decompile fix - } - } - -- private > String getName(Property property, Comparable value) { -- return property.value(value); -+ private > String getName(Property property, T value) { // Paper - decompile error -+ return property.getName(value); - } - }; - protected final O owner; -@@ -48,11 +48,11 @@ public abstract class StateHolder { - } - - public > S cycle(Property property) { -- return this.setValue(property, (Comparable) findNextInCollection(property.getPossibleValues(), (Object) this.getValue(property))); -+ return this.setValue(property, findNextInCollection(property.getPossibleValues(), this.getValue(property))); // Paper - decompile error - } - - protected static T findNextInCollection(Collection values, T value) { -- Iterator iterator = values.iterator(); -+ Iterator iterator = values.iterator(); // Paper - - do { - if (!iterator.hasNext()) { -@@ -94,7 +94,7 @@ public abstract class StateHolder { - if (comparable == null) { - throw new IllegalArgumentException("Cannot get property " + property + " as it does not exist in " + this.owner); - } else { -- return (Comparable) property.getValueClass().cast(comparable); -+ return property.getValueClass().cast(comparable); // Paper - decompile error - } - } - -@@ -110,7 +110,7 @@ public abstract class StateHolder { - if (comparable == null) { - throw new IllegalArgumentException("Cannot set property " + property + " as it does not exist in " + this.owner); - } else if (comparable == value) { -- return this; -+ return (S) this; // Paper - decompile error - } else { - S s0 = this.neighbours.get(property, value); - -@@ -162,7 +162,7 @@ public abstract class StateHolder { - return codec.dispatch("Name", (iblockdataholder) -> { - return iblockdataholder.owner; - }, (object) -> { -- S s0 = (StateHolder) ownerToStateFunction.apply(object); -+ S s0 = ownerToStateFunction.apply(object); // Paper - decompile error - - return s0.getValues().isEmpty() ? Codec.unit(s0) : s0.propertiesCodec.fieldOf("Properties").codec(); - }); -diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java -index 9e0724c4bf06d207898e477e35412c09f3aa0f74..b5817645727f2af2785e0987ba824f431d4e9e32 100644 ---- a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java -+++ b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java -@@ -21,10 +21,10 @@ public class EnumProperty & StringRepresentable> extends Prope - protected EnumProperty(String name, Class type, Collection values) { - super(name, type); - this.values = ImmutableSet.copyOf(values); -- Iterator iterator = values.iterator(); -+ Iterator iterator = values.iterator(); // Paper - decompile fix - - while (iterator.hasNext()) { -- T t0 = (Enum) iterator.next(); -+ T t0 = iterator.next(); // Paper - Decompile fix - String s1 = ((StringRepresentable) t0).getSerializedName(); - - if (this.names.containsKey(s1)) { -diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java -index 5a16a0079bc297fb4572d2e6e9b07a9d1a53c906..8cc07c70fde81e44679f3ea7d9a4c6b2447885d4 100644 ---- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java -+++ b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java -@@ -17,12 +17,10 @@ public abstract class Property> { - private final Codec> valueCodec; - - protected Property(String name, Class type) { -- this.codec = Codec.STRING.comapFlatMap((s1) -> { -- return (DataResult) this.getValue(s1).map(DataResult::success).orElseGet(() -> { -- return DataResult.error("Unable to read property: " + this + " with value: " + s1); -- }); -- }, this::getName); -- this.valueCodec = this.codec.xmap(this::b, Property.clazz::b); -+ this.codec = Codec.STRING.comapFlatMap((s1) -> this.getValue(s1).map(DataResult::success).orElseGet(() -> { // Paper - decompile error -+ return DataResult.error("Unable to read property: " + this + " with value: " + s1); -+ }), this::getName); -+ this.valueCodec = this.codec.xmap(this::value, (Property.Value param) -> param.value()); // Paper - decompile fix - this.clazz = type; - this.name = name; - } -diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java b/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java -index 977ac6db5fbdd001c306ee6aa396bb395384dd8f..7de765786b3504dcffab98bb0d9dac64b30b3325 100644 ---- a/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java -+++ b/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java -@@ -89,7 +89,7 @@ public class IOWorker implements AutoCloseable { - return this.submitTask(() -> { - try { - this.storage.flush(); -- return Either.left((Object) null); -+ return Either.left(null); // Paper - decompile error - } catch (Exception exception) { - IOWorker.LOGGER.warn("Failed to synchronized chunks", exception); - return Either.right(exception); -@@ -123,13 +123,13 @@ public class IOWorker implements AutoCloseable { - } - - private void tellStorePending() { -- this.mailbox.tell((Object) (new StrictQueue.IntRunnable(IOWorker.Priority.LOW.ordinal(), this::storePendingChunk))); -+ this.mailbox.tell((new StrictQueue.IntRunnable(IOWorker.Priority.LOW.ordinal(), this::storePendingChunk))); // Paper - decompile error - } - - private void runStore(ChunkPos pos, IOWorker.PendingStore ioworker_a) { - try { - this.storage.write(pos, ioworker_a.data); -- ioworker_a.result.complete((Object) null); -+ ioworker_a.result.complete(null); // Paper - decompile fix - } catch (Exception exception) { - IOWorker.LOGGER.error("Failed to store chunk {}", pos, exception); - ioworker_a.result.completeExceptionally(exception); -diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index 217065b88178342159154490ffabe0fe7d32d7bf..2386ffeec60851ba192b89bc6fd7ffff9c56aff5 100644 ---- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -@@ -430,7 +430,7 @@ public class EndDragonFight { - } - } - -- worldgenendtrophy.configured((FeatureConfiguration) FeatureConfiguration.NONE).a(this.level, this.level.getChunkSource().getGenerator(), new Random(), this.portalLocation); -+ worldgenendtrophy.configured(FeatureConfiguration.NONE).place(this.level, this.level.getChunkSource().getGenerator(), new Random(), this.portalLocation); // Paper - decompile fix - } - - private EnderDragon createNewDragon() { -diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java -index 418abfdc85de157d23807059670a2dfc964cbd5f..9f60abfe0a37e30c5528a1ca0546295b00598798 100644 ---- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java -+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java -@@ -71,13 +71,13 @@ public abstract class StructureFeature { - public static final StructureFeature BASTION_REMNANT = register("Bastion_Remnant", new BastionFeature(JigsawConfiguration.CODEC), GenerationStep.Decoration.SURFACE_STRUCTURES); - public static final List> NOISE_AFFECTING_FEATURES = ImmutableList.of(StructureFeature.PILLAGER_OUTPOST, StructureFeature.VILLAGE, StructureFeature.NETHER_FOSSIL); - private static final ResourceLocation JIGSAW_RENAME = new ResourceLocation("jigsaw"); -- private static final Map RENAMES = ImmutableMap.builder().put(new ResourceLocation("nvi"), StructureFeature.JIGSAW_RENAME).put(new ResourceLocation("pcp"), StructureFeature.JIGSAW_RENAME).put(new ResourceLocation("bastionremnant"), StructureFeature.JIGSAW_RENAME).put(new ResourceLocation("runtime"), StructureFeature.JIGSAW_RENAME).build(); -+ private static final Map RENAMES = ImmutableMap.builder().put(new ResourceLocation("nvi"), StructureFeature.JIGSAW_RENAME).put(new ResourceLocation("pcp"), StructureFeature.JIGSAW_RENAME).put(new ResourceLocation("bastionremnant"), StructureFeature.JIGSAW_RENAME).put(new ResourceLocation("runtime"), StructureFeature.JIGSAW_RENAME).build(); // Paper - decompile fix - private final Codec>> y; - - private static > F register(String name, F structureFeature, GenerationStep.Decoration step) { - StructureFeature.STRUCTURES_REGISTRY.put(name.toLowerCase(Locale.ROOT), structureFeature); - StructureFeature.STEP.put(structureFeature, step); -- return (StructureFeature) Registry.registerDefaulted(Registry.STRUCTURE_FEATURE, name.toLowerCase(Locale.ROOT), (Object) structureFeature); -+ return (F) Registry.>register(Registry.STRUCTURE_FEATURE, name.toLowerCase(Locale.ROOT), structureFeature); // Paper - decomp fix - } - - public StructureFeature(Codec codec) { -diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -index cd2efdd5802605de5d3d636ce1b4a796e0c13310..c304637ae8f80c65b58e8ba8a27609b532bb1184 100644 ---- a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -+++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -@@ -34,10 +34,10 @@ public class SkyLightSectionStorage extends LayerLightSectionStorage= l) { -diff --git a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -index b106f2458361fc2a9168bbef8c9e5b35d8e359fb..60b7fdf9c092e8105d41f4af02a08651624f3eb9 100644 ---- a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -+++ b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -@@ -44,7 +44,7 @@ public class DimensionDataStorage { - if (t0 != null) { - return t0; - } else { -- T t1 = (SavedData) factory.get(); -+ T t1 = factory.get(); // Paper - decompile fix - - this.set(t1); - return t1; -@@ -53,7 +53,7 @@ public class DimensionDataStorage { - - @Nullable - public T get(Supplier factory, String id) { -- SavedData persistentbase = (SavedData) this.cache.get(id); -+ T persistentbase = (T) this.cache.get(id); // Paper - decompile fix - - if (persistentbase == null && !this.cache.containsKey(id)) { - persistentbase = this.readSavedData(factory, id); -@@ -69,7 +69,7 @@ public class DimensionDataStorage { - File file = this.getDataFile(id); - - if (file.exists()) { -- T t0 = (SavedData) factory.get(); -+ T t0 = factory.get(); // Paper - decompile fix - CompoundTag nbttagcompound = this.readTagFromDisk(id, SharedConstants.getCurrentVersion().getWorldVersion()); - - t0.load(nbttagcompound.getCompound("data")); -diff --git a/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java b/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java -index 4093a4a1f924ac722d60599be9688a88d26a5c1a..802eb7fe690adae03c80db3fc0f72ea2788a3b2c 100644 ---- a/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java -+++ b/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java -@@ -42,7 +42,7 @@ public abstract class LootPoolEntryContainer implements ComposableEntryContainer - - // CraftBukkit start - @Override -- public final void serialize(JsonObject json, T entry, JsonSerializationContext context) { -+ public void serialize(JsonObject json, T entry, JsonSerializationContext context) { // Paper - remove final - if (!org.apache.commons.lang3.ArrayUtils.isEmpty(entry.conditions)) { - json.add("conditions", context.serialize(entry.conditions)); - } -diff --git a/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolSingletonContainer.java b/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolSingletonContainer.java -index c942459e0a492dd9fab296ef60d272651d13f049..ceb5e5405ed20c8de954847bbb269109107a43fc 100644 ---- a/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolSingletonContainer.java -+++ b/src/main/java/net/minecraft/world/level/storage/loot/entries/LootPoolSingletonContainer.java -@@ -132,7 +132,7 @@ public abstract class LootPoolSingletonContainer extends LootPoolEntryContainer - @Override - public T b(LootItemFunction.Builder lootitemfunction_a) { - this.functions.add(lootitemfunction_a.b()); -- return (LootPoolSingletonContainer.Builder) this.getThis(); -+ return this.getThis(); // Paper - decompile fix - } - - protected LootItemFunction[] getFunctions() { -@@ -141,12 +141,12 @@ public abstract class LootPoolSingletonContainer extends LootPoolEntryContainer - - public T setWeight(int weight) { - this.weight = weight; -- return (LootPoolSingletonContainer.Builder) this.getThis(); -+ return this.getThis(); // Paper - decompile fix - } - - public T setQuality(int quality) { - this.quality = quality; -- return (LootPoolSingletonContainer.Builder) this.getThis(); -+ return this.getThis(); // Paper - decompile fix - } - } - -diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java -index b77c921548ff55bab62bf37fa411ad1fd8d38f82..a3ce120b0da62f9be938c58c3414ce997f5d30ea 100644 ---- a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java -+++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java -@@ -89,7 +89,7 @@ public class ExplorationMapFunction extends LootItemConditionalFunction { - public Serializer() {} - - public void serialize(JsonObject json, ExplorationMapFunction object, JsonSerializationContext context) { -- super.serialize(json, (LootItemConditionalFunction) object, context); -+ super.serialize(json, object, context); // Paper - decompile fix - if (!object.destination.equals(ExplorationMapFunction.DEFAULT_FEATURE)) { - json.add("destination", context.serialize(object.destination.getFeatureName())); - } -diff --git a/src/main/java/net/minecraft/world/phys/shapes/IndirectMerger.java b/src/main/java/net/minecraft/world/phys/shapes/IndirectMerger.java -index bc1798f130184d6b107d7a9ba972cab686534439..f0e74daa5bb9e88c028225e7c71deb04c481a7ac 100644 ---- a/src/main/java/net/minecraft/world/phys/shapes/IndirectMerger.java -+++ b/src/main/java/net/minecraft/world/phys/shapes/IndirectMerger.java -@@ -38,7 +38,7 @@ public final class IndirectMerger implements IndexMerger { - double d1 = flag4 ? first.getDouble(i++) : second.getDouble(j++); - - if ((i != 0 && flag2 || flag4 || includeSecondOnly) && (j != 0 && flag3 || !flag4 || includeFirstOnly)) { -- if (d0 < d1 - 1.0E-7D) { -+ if (!(d0 >= d1 - 1.0E-7D)) { // Paper - decompile error - welcome to hell - this.firstIndices.add(i - 1); - this.secondIndices.add(j - 1); - this.result.add(d1); diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index 3554e7bd3..92b74cc17 100644 --- a/patches/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index fddf2f440356425d948f40dcf9d9853a374ddc8e..332930391943da8b1601401f70e13f076b205e7c 100644 +index fddf2f440356425d948f40dcf9d9853a374ddc8e..32fee49011b630407d6fd1c66838a833a706741a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,21 +15,24 @@ repositories { @@ -32,7 +32,7 @@ index fddf2f440356425d948f40dcf9d9853a374ddc8e..332930391943da8b1601401f70e13f07 runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0") + implementation("co.aikar:cleaner:1.0-SNAPSHOT") // Paper -+ implementation("io.netty:netty-all:4.1.50-Final") // Paper ++ implementation("io.netty:netty-all:4.1.65.Final") // Paper + testImplementation("junit:junit:4.13.1") testImplementation("org.hamcrest:hamcrest-library:1.3") diff --git a/patches/server-remapped/0002-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch similarity index 87% rename from patches/server-remapped/0002-Paper-config-files.patch rename to patches/server/0004-Paper-config-files.patch index 363f09b24..351a72788 100644 --- a/patches/server-remapped/0002-Paper-config-files.patch +++ b/patches/server/0004-Paper-config-files.patch @@ -7,7 +7,7 @@ Loads each yml file for early init too so it can be used for early options diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java new file mode 100644 -index 0000000000000000000000000000000000000000..d05eeaa711a09bb121b530654821894e795ff4ea +index 0000000000000000000000000000000000000000..94cc5b494cdbc163fb70d0f4a6708d6ca2f42288 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -0,0 +1,286 @@ @@ -227,7 +227,7 @@ index 0000000000000000000000000000000000000000..d05eeaa711a09bb121b530654821894e + ChunkPos chunk = new ChunkPos(e.xChunk, e.zChunk); + info.left++; + info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); -+ if (!chunkProviderServer.isInEntityTickingChunk(e)) { ++ if (!chunkProviderServer.isPositionTicking(e)) { + nonEntityTicking.merge(key, Integer.valueOf(1), Integer::sum); + } + }); @@ -243,7 +243,7 @@ index 0000000000000000000000000000000000000000..d05eeaa711a09bb121b530654821894e + sender.sendMessage("Entity: " + name + " Total Ticking: " + (info.getLeft() - nonTicking) + ", Total Non-Ticking: " + nonTicking); + info.getRight().entrySet().stream() + .sorted((a, b) -> !a.getValue().equals(b.getValue()) ? b.getValue() - a.getValue() : a.getKey().toString().compareTo(b.getKey().toString())) -+ .limit(10).forEach(e -> sender.sendMessage(" " + e.getValue() + ": " + e.getKey().x + ", " + e.getKey().z + (chunkProviderServer.isEntityTickingChunk(e.getKey()) ? " (Ticking)" : " (Non-Ticking)"))); ++ .limit(10).forEach(e -> sender.sendMessage(" " + e.getValue() + ": " + e.getKey().x + ", " + e.getKey().z + (chunkProviderServer.isPositionTicking(e.getKey().toLong()) ? " (Ticking)" : " (Non-Ticking)"))); + } else { + List> info = list.entrySet().stream() + .filter(e -> names.contains(e.getKey())) @@ -563,11 +563,11 @@ index 0000000000000000000000000000000000000000..b31109d2dadd29e8852468c19265066b + } +} diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 9366b5551047e87e455fafbf45be5fb145aa875b..5d83a8d4c69144219219877c521c364d912d2452 100644 +index 1707449cbbfa5eab585657cdde811b34a92e1d17..c8385460701395cb5c65fba41335469ffb2d9b9a 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -95,6 +95,12 @@ public class Main { - DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, optionset); // CraftBukkit - CLI argument support +@@ -101,6 +101,12 @@ public class Main { + DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support dedicatedserversettings.forceSave(); + // Paper start - load config files for access below if needed @@ -576,10 +576,10 @@ index 9366b5551047e87e455fafbf45be5fb145aa875b..5d83a8d4c69144219219877c521c364d + org.bukkit.configuration.file.YamlConfiguration paperConfiguration = loadConfigFile((File) optionset.valueOf("paper-settings")); + // Paper end + - java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt"); - Eula eula = new Eula(java_nio_file_path1); + Path path1 = Paths.get("eula.txt"); + Eula eula = new Eula(path1); -@@ -236,6 +242,20 @@ public class Main { +@@ -251,6 +257,20 @@ public class Main { } @@ -601,10 +601,10 @@ index 9366b5551047e87e455fafbf45be5fb145aa875b..5d83a8d4c69144219219877c521c364d Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, worlds, eraseCache); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 2228f83f251851aa683f739ac5ce2ec98f059f3f..23d6f803eafa78fd51ea4cdc4ca25c78661bc80b 100644 +index 7bad75bd86fcb484e253fca8077d017d3161158b..fe83f13d71f84591f5506e1c6b9dfbf9fba680bd 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -184,6 +184,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -193,6 +193,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.registerCommands(); // Spigot end @@ -621,44 +621,45 @@ index 2228f83f251851aa683f739ac5ce2ec98f059f3f..23d6f803eafa78fd51ea4cdc4ca25c78 this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index aa7bf54e4b93a9b6085aa943500f5dec5f60a117..7cc5070f70a4f740add9d971385ceaa4d44275a2 100644 +index 108432435aac34fadfd899941e6d2b951f509971..623b938177cc7287bccc55f34e644bda984a7b65 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -307,15 +307,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -23,6 +23,7 @@ import net.minecraft.core.BlockPos; + import net.minecraft.core.SectionPos; + import net.minecraft.network.protocol.Packet; + import net.minecraft.server.level.progress.ChunkProgressListener; ++import net.minecraft.util.Mth; + import net.minecraft.util.VisibleForDebug; + import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.thread.BlockableEventLoop; +@@ -334,6 +335,12 @@ public class ServerChunkCache extends ChunkSource { } } -- @Override -- public boolean isEntityTickingChunk(Entity entity) { -+ public final boolean isInEntityTickingChunk(Entity entity) { return this.isEntityTickingChunk(entity); } // Paper - OBFHELPER -+ @Override public boolean isEntityTickingChunk(Entity entity) { - long i = ChunkPos.asLong(Mth.floor(entity.getX()) >> 4, Mth.floor(entity.getZ()) >> 4); - - return this.checkChunkFuture(i, (Function>>) ChunkHolder::getEntityTickingChunkFuture); // CraftBukkit - decompile error ++ // Paper start - helper ++ public boolean isPositionTicking(Entity entity) { ++ return this.isPositionTicking(ChunkPos.asLong(Mth.floor(entity.getX()) >> 4, Mth.floor(entity.getZ()) >> 4)); ++ } ++ // Paper end ++ + public boolean isPositionTicking(long i) { + return this.checkChunkFuture(i, (Function>>) ChunkHolder::getTickingChunkFuture); // CraftBukkit - decompile error } - -- @Override -- public boolean isEntityTickingChunk(ChunkPos pos) { -+ public final boolean isEntityTickingChunk(ChunkPos chunkcoordintpair) { return this.isEntityTickingChunk(chunkcoordintpair); } // Paper - OBFHELPER -+ @Override public boolean isEntityTickingChunk(ChunkPos pos) { - return this.checkChunkFuture(pos.toLong(), (Function>>) ChunkHolder::getEntityTickingChunkFuture); // CraftBukkit - decompile error - } - diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index f82fd4a50921c3c4791be18a43778e6fd216f557..ff482d0349c18d0d1ba902ea0d10611b1ca4e588 100644 +index 067216078c7b50390957d1fcfbfbaaeb81cfba21..7f3d83d3d071f6b441ad119b1c93be035e911e70 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -2,6 +2,7 @@ package net.minecraft.world.entity; - - import com.google.common.collect.ImmutableSet; +@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableSet; + import java.util.List; import java.util.Optional; + import java.util.Spliterator; +import java.util.Set; // Paper import java.util.UUID; + import java.util.function.Consumer; import java.util.function.Function; - import java.util.stream.Stream; -@@ -599,4 +600,10 @@ public class EntityType { - return new EntityType<>(this.factory, this.category, this.serialize, this.summon, this.fireImmune, this.canSpawnFarFromPlayer, this.immuneTo, this.dimensions, this.clientTrackingRange, this.updateInterval); - } +@@ -666,4 +667,10 @@ public class EntityType implements EntityTypeTest { + + T create(EntityType type, Level world); } + + // Paper start @@ -668,10 +669,10 @@ index f82fd4a50921c3c4791be18a43778e6fd216f557..ff482d0349c18d0d1ba902ea0d10611b + // Paper end } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index b7c64fcf49ea50fa38a121d906ec6df20a1be31b..f08de81dcc4acd5a3e44407b431ce827a19b2e9c 100644 +index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e3297ceb4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -129,6 +129,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -146,6 +146,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean populating; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot @@ -680,7 +681,7 @@ index b7c64fcf49ea50fa38a121d906ec6df20a1be31b..f08de81dcc4acd5a3e44407b431ce827 public final SpigotTimings.WorldTimingsHandler timings; // Spigot public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; -@@ -149,6 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -166,6 +168,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, final DimensionType dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot @@ -689,35 +690,35 @@ index b7c64fcf49ea50fa38a121d906ec6df20a1be31b..f08de81dcc4acd5a3e44407b431ce827 this.world = new CraftWorld((ServerLevel) this, gen, env); this.ticksPerAnimalSpawns = this.getCraftServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 761ad2d7e538d1e299d3050446274addcde7d772..328d1e2b128b62f24917719c79823c9fb64a0dcf 100644 +index 69617d4da7d69fa45e189dc4b94fbd136e5d547c..743c9f11dbbb66db97bcb3b8fecd97290a7c9f61 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -806,6 +806,7 @@ public final class CraftServer implements Server { +@@ -809,6 +809,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot + com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper - for (ServerLevel world : console.getAllLevels()) { - world.worldDataServer.setDifficulty(config.difficulty); + for (ServerLevel world : this.console.getAllLevels()) { + world.serverLevelData.setDifficulty(config.difficulty); world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals); -@@ -839,6 +840,7 @@ public final class CraftServer implements Server { +@@ -842,6 +843,7 @@ public final class CraftServer implements Server { world.ticksPerAmbientSpawns = this.getTicksPerAmbientSpawns(); } world.spigotConfig.init(); // Spigot + world.paperConfig.init(); // Paper } - pluginManager.clearPlugins(); -@@ -846,6 +848,7 @@ public final class CraftServer implements Server { - resetRecipes(); - reloadData(); + this.pluginManager.clearPlugins(); +@@ -849,6 +851,7 @@ public final class CraftServer implements Server { + this.resetRecipes(); + this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot + com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper - overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); - ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); + this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); + this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2101,4 +2104,35 @@ public final class CraftServer implements Server { - return spigot; +@@ -2104,4 +2107,35 @@ public final class CraftServer implements Server { + return this.spigot; } // Spigot end + @@ -753,7 +754,7 @@ index 761ad2d7e538d1e299d3050446274addcde7d772..328d1e2b128b62f24917719c79823c9f + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 46a16e31775b28c44f95a8ac5545ebcb656c74b6..05aedca561919a12ced1925c5cc9af585bb04523 100644 +index 24e08ca0fca3e87f8a6b7670b266f3c2900b798c..3c4281ad770598ecf3b9fae0d6ed6e9130136dbb 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -129,6 +129,14 @@ public class Main { @@ -772,49 +773,49 @@ index 46a16e31775b28c44f95a8ac5545ebcb656c74b6..05aedca561919a12ced1925c5cc9af58 }; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 83d83ff7ceffbb77723da721b869dfd0091e496d..0efcbab8f8806aeb8dd8bd6384e5a7cee375d100 100644 +index c7bfa5fe5f7945883bd41461247e0efb04f5e9e8..9a31d8b709b28bba658603106c623560c5362947 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -39,36 +39,36 @@ public class SpigotWorldConfig - config.set( "world-settings.default." + path, val ); + this.config.set( "world-settings.default." + path, val ); } - private boolean getBoolean(String path, boolean def) + public boolean getBoolean(String path, boolean def) // Paper - private -> public { - config.addDefault( "world-settings.default." + path, def ); - return config.getBoolean( "world-settings." + worldName + "." + path, config.getBoolean( "world-settings.default." + path ) ); + this.config.addDefault( "world-settings.default." + path, def ); + return this.config.getBoolean( "world-settings." + this.worldName + "." + path, this.config.getBoolean( "world-settings.default." + path ) ); } - private double getDouble(String path, double def) + public double getDouble(String path, double def) // Paper - private -> public { - config.addDefault( "world-settings.default." + path, def ); - return config.getDouble( "world-settings." + worldName + "." + path, config.getDouble( "world-settings.default." + path ) ); + this.config.addDefault( "world-settings.default." + path, def ); + return this.config.getDouble( "world-settings." + this.worldName + "." + path, this.config.getDouble( "world-settings.default." + path ) ); } - private int getInt(String path) + public int getInt(String path) // Paper - private -> public { - return config.getInt( "world-settings." + worldName + "." + path ); + return this.config.getInt( "world-settings." + this.worldName + "." + path ); } - private int getInt(String path, int def) + public int getInt(String path, int def) // Paper - private -> public { - config.addDefault( "world-settings.default." + path, def ); - return config.getInt( "world-settings." + worldName + "." + path, config.getInt( "world-settings.default." + path ) ); + this.config.addDefault( "world-settings.default." + path, def ); + return this.config.getInt( "world-settings." + this.worldName + "." + path, this.config.getInt( "world-settings.default." + path ) ); } - private List getList(String path, T def) + public List getList(String path, T def) // Paper - private -> public { - config.addDefault( "world-settings.default." + path, def ); - return (List) config.getList( "world-settings." + worldName + "." + path, config.getList( "world-settings.default." + path ) ); + this.config.addDefault( "world-settings.default." + path, def ); + return (List) this.config.getList( "world-settings." + this.worldName + "." + path, this.config.getList( "world-settings.default." + path ) ); } - private String getString(String path, String def) + public String getString(String path, String def) // Paper - private -> public { - config.addDefault( "world-settings.default." + path, def ); - return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); + this.config.addDefault( "world-settings.default." + path, def ); + return this.config.getString( "world-settings." + this.worldName + "." + path, this.config.getString( "world-settings.default." + path ) ); diff --git a/patches/server/0005-MC-Dev-fixes.patch b/patches/server/0005-MC-Dev-fixes.patch new file mode 100644 index 000000000..4b44bab5c --- /dev/null +++ b/patches/server/0005-MC-Dev-fixes.patch @@ -0,0 +1,358 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 30 Mar 2016 19:36:20 -0400 +Subject: [PATCH] MC Dev fixes + + +diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java +index 255b39848a4071775a7f2f0dd2e54eb4be18e109..8ba68f03c1dd87826185808e9e7080647a55c2dd 100644 +--- a/src/main/java/net/minecraft/Util.java ++++ b/src/main/java/net/minecraft/Util.java +@@ -306,7 +306,7 @@ public class Util { + } + + public static Strategy identityStrategy() { +- return Util.IdentityStrategy.INSTANCE; ++ return (Strategy) Util.IdentityStrategy.INSTANCE; // Paper - decompile fix + } + + public static CompletableFuture> sequence(List> futures) { +diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java +index 1bd6ef643b17b059eb525035496b816a098279c4..3cf71f85da94bcda5d4527b5f3e18d959c6c4634 100644 +--- a/src/main/java/net/minecraft/core/BlockPos.java ++++ b/src/main/java/net/minecraft/core/BlockPos.java +@@ -367,12 +367,12 @@ public class BlockPos extends Vec3i { + if (this.index == l) { + return this.endOfData(); + } else { +- int i = this.index % i; +- int j = this.index / i; +- int k = j % j; +- int l = j / j; ++ int offsetX = this.index % i; // Paper - decomp fix ++ int u = this.index / i; // Paper - decomp fix ++ int offsetY = u % j; // Paper - decomp fix ++ int offsetZ = u / j; // Paper - decomp fix + ++this.index; +- return this.cursor.set(startX + i, startY + k, startZ + l); ++ return this.cursor.set(startX + offsetX, startY + offsetY, startZ + offsetZ); // Paper - decomp fix + } + } + }; +diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java +index 2f8443ba50d34ff961ae5345c470e809c720fd29..88bac72edf19c578902f49d20353989ed4d96f8f 100644 +--- a/src/main/java/net/minecraft/nbt/ListTag.java ++++ b/src/main/java/net/minecraft/nbt/ListTag.java +@@ -2,9 +2,13 @@ package net.minecraft.nbt; + + import com.google.common.collect.Iterables; + import com.google.common.collect.Lists; ++import it.unimi.dsi.fastutil.bytes.ByteOpenHashSet; ++import it.unimi.dsi.fastutil.bytes.ByteSet; ++ + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; ++import java.util.Arrays; + import java.util.List; + import java.util.Objects; + +@@ -45,6 +49,7 @@ public class ListTag extends CollectionTag { + return "TAG_List"; + } + }; ++ private static final ByteSet INLINE_ELEMENT_TYPES = new ByteOpenHashSet(Arrays.asList((byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6)); // Paper - decompiler fix + private final List list; + private byte type; + +diff --git a/src/main/java/net/minecraft/nbt/NbtIo.java b/src/main/java/net/minecraft/nbt/NbtIo.java +index 58443139562d1f90465be43e9be42f5cca7fc80d..0f4d9e94438d62cb5eeb9ca0e430d8dd7ba54ef7 100644 +--- a/src/main/java/net/minecraft/nbt/NbtIo.java ++++ b/src/main/java/net/minecraft/nbt/NbtIo.java +@@ -19,6 +19,7 @@ import javax.annotation.Nullable; + import net.minecraft.CrashReport; + import net.minecraft.CrashReportCategory; + import net.minecraft.ReportedException; ++import io.netty.buffer.ByteBufInputStream; // Paper + + public class NbtIo { + +@@ -180,7 +181,7 @@ public class NbtIo { + + public static CompoundTag read(DataInput input, NbtAccounter tracker) throws IOException { + // Spigot start +- if ( input instanceof io.netty.buffer.ByteBufInputStream ) ++ if ( input instanceof ByteBufInputStream) // Paper + { + input = new DataInputStream(new org.spigotmc.LimitStream((InputStream) input, tracker)); + } +diff --git a/src/main/java/net/minecraft/nbt/Tag.java b/src/main/java/net/minecraft/nbt/Tag.java +index 440aa82b4488ed20f9fcf60f1e87cc84ea74e370..08a0327feacd81c6e4c66182cee926c6068b8aa8 100644 +--- a/src/main/java/net/minecraft/nbt/Tag.java ++++ b/src/main/java/net/minecraft/nbt/Tag.java +@@ -33,7 +33,7 @@ public interface Tag { + + TagType getType(); + +- Tag copy(); ++ public Tag copy(); // Paper - decompile fix + + default String getAsString() { + return (new StringTagVisitor()).visit(this); +diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java +index 6b66e1ad66dccacb5c959da924d7857358488678..e722cf3a8e816b0c7405e6282591d9fa8d5bfa61 100644 +--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java ++++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java +@@ -12,6 +12,7 @@ import javax.annotation.Nullable; + import net.minecraft.Util; + import net.minecraft.network.protocol.Packet; + import net.minecraft.network.protocol.PacketFlow; ++import net.minecraft.network.protocol.game.ClientGamePacketListener; + import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; + import net.minecraft.network.protocol.game.ClientboundAddExperienceOrbPacket; + import net.minecraft.network.protocol.game.ClientboundAddMobPacket; +@@ -113,6 +114,7 @@ import net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket; + import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket; + import net.minecraft.network.protocol.game.ClientboundUpdateRecipesPacket; + import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket; ++import net.minecraft.network.protocol.game.ServerGamePacketListener; + import net.minecraft.network.protocol.game.ServerboundAcceptTeleportationPacket; + import net.minecraft.network.protocol.game.ServerboundBlockEntityTagQuery; + import net.minecraft.network.protocol.game.ServerboundChangeDifficultyPacket; +@@ -159,25 +161,32 @@ import net.minecraft.network.protocol.game.ServerboundTeleportToEntityPacket; + import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket; + import net.minecraft.network.protocol.game.ServerboundUseItemPacket; + import net.minecraft.network.protocol.handshake.ClientIntentionPacket; ++import net.minecraft.network.protocol.handshake.ServerHandshakePacketListener; ++import net.minecraft.network.protocol.login.ClientLoginPacketListener; + import net.minecraft.network.protocol.login.ClientboundCustomQueryPacket; + import net.minecraft.network.protocol.login.ClientboundGameProfilePacket; + import net.minecraft.network.protocol.login.ClientboundHelloPacket; + import net.minecraft.network.protocol.login.ClientboundLoginCompressionPacket; + import net.minecraft.network.protocol.login.ClientboundLoginDisconnectPacket; ++import net.minecraft.network.protocol.login.ServerLoginPacketListener; + import net.minecraft.network.protocol.login.ServerboundCustomQueryPacket; + import net.minecraft.network.protocol.login.ServerboundHelloPacket; + import net.minecraft.network.protocol.login.ServerboundKeyPacket; ++import net.minecraft.network.protocol.status.ClientStatusPacketListener; + import net.minecraft.network.protocol.status.ClientboundPongResponsePacket; + import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket; ++import net.minecraft.network.protocol.status.ServerStatusPacketListener; + import net.minecraft.network.protocol.status.ServerboundPingRequestPacket; + import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket; + import org.apache.logging.log4j.LogManager; + + public enum ConnectionProtocol { +- HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), +- PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntityPacket.class, ClientboundRemoveEntityPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), +- STATUS(1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), +- LOGIN(2, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new))); ++ // Paper start - fix decompile error - add correct generic packet listeners (e.g. ServerHandshakePacketListener) to PacketSet's generic type, matching the packet flow direction ++ HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), ++ PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntityPacket.class, ClientboundRemoveEntityPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), ++ STATUS(1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), ++ LOGIN(2, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new))); ++ // Paper end + + private static final int MIN_PROTOCOL_ID = -1; + private static final int MAX_PROTOCOL_ID = 2; +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 8ae7218512a7aa7c26c49da83cbb923ba0ecdf09..ecb775edb17d629855f1be37943f9bc933d93d63 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1765,7 +1765,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoopmap(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error + }, this).thenCompose((immutablelist) -> { + return ServerResources.loadResources(immutablelist, this.registryHolder, this.isDedicatedServer() ? Commands.CommandSelection.DEDICATED : Commands.CommandSelection.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this); + }).thenAcceptAsync((datapackresources) -> { +diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java +index 2f66abf62d303342f5fe614fb3e35e7844497ffc..b346fa94b23d81da7da073f71dd12e672e0f079c 100644 +--- a/src/main/java/net/minecraft/server/level/Ticket.java ++++ b/src/main/java/net/minecraft/server/level/Ticket.java +@@ -21,7 +21,7 @@ public final class Ticket implements Comparable> { + return i; + } else { + int j = Integer.compare(System.identityHashCode(this.type), System.identityHashCode(ticket.type)); +- return j != 0 ? j : this.type.getComparator().compare(this.key, ticket.key); ++ return j != 0 ? j : this.type.getComparator().compare(this.key, (T)ticket.key); // Paper - decompile fix + } + } + +diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java +index ee5bb1a8edb812d48d5af45ea8485f574dcb2ad5..9f3355dbbbab1ab88cf2b7034130c2888e38d7a7 100644 +--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java ++++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java +@@ -206,7 +206,7 @@ public class ServerStatsCounter extends StatsCounter { + ObjectIterator objectiterator = this.stats.object2IntEntrySet().iterator(); + + while (objectiterator.hasNext()) { +- it.unimi.dsi.fastutil.objects.Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next(); ++ Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (Object2IntMap.Entry) objectiterator.next(); // Paper - decompile fix + Stat statistic = (Stat) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey(); + + ((JsonObject) map.computeIfAbsent(statistic.getType(), (statisticwrapper) -> { +diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java +index d0f6eb3981a171c0f34870cb0472599d6cca9642..d1b2ba24ef54e01c6249c3b2ca16e80f03c001a6 100644 +--- a/src/main/java/net/minecraft/util/SortedArraySet.java ++++ b/src/main/java/net/minecraft/util/SortedArraySet.java +@@ -28,7 +28,7 @@ public class SortedArraySet extends AbstractSet { + } + + public static > SortedArraySet create(int initialCapacity) { +- return new SortedArraySet<>(initialCapacity, Comparator.naturalOrder()); ++ return new SortedArraySet<>(initialCapacity, Comparator.naturalOrder()); // Paper - decompile fix + } + + public static SortedArraySet create(Comparator comparator) { +diff --git a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java +index d4488ebc4d4f50e1c3ccfeeb8bb82d06a7a90c30..37110c535b9fe25b53b5ebe9aa448ade6dcda2f9 100644 +--- a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java ++++ b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java +@@ -93,7 +93,7 @@ public class ProcessorMailbox implements ProfilerMeasured, ProcessorHandle + @Override + public void run() { + try { +- this.pollUntil((i) -> { ++ this.pollUntil((int i) -> { // Paper - decompile fix + return i == 0; + }); + } finally { +diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +index 2d79d4014770081fcd58a929e5fe0a26ac1b8023..f39a82bb231f5623fc69b044e6c17e742f56171a 100644 +--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java ++++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +@@ -75,7 +75,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { + } + + this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> { +- return (entry1.getValue()); // CraftBukkit ++ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* + })); + RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); + } +diff --git a/src/main/java/net/minecraft/world/level/TickNextTickData.java b/src/main/java/net/minecraft/world/level/TickNextTickData.java +index eb07e63f3c40fd8914cde50dfa789b1ed20b755a..3af31dc2c82c11ee78d497c5777615c17cb13c7a 100644 +--- a/src/main/java/net/minecraft/world/level/TickNextTickData.java ++++ b/src/main/java/net/minecraft/world/level/TickNextTickData.java +@@ -39,7 +39,7 @@ public class TickNextTickData { + } + + public static Comparator> createTimeComparator() { +- return Comparator.comparingLong((tickNextTickData) -> { ++ return Comparator.>comparingLong((tickNextTickData) -> { // Paper - decompile fix + return tickNextTickData.triggerTick; + }).thenComparing((tickNextTickData) -> { + return tickNextTickData.priority; +diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java +index eb870fba1d54201664f4a384fa45db99b65a252f..3f3b4e4ea8231fdcc799bd9de3e20747a5634603 100644 +--- a/src/main/java/net/minecraft/world/level/biome/Biome.java ++++ b/src/main/java/net/minecraft/world/level/biome/Biome.java +@@ -53,8 +53,40 @@ import org.apache.logging.log4j.Logger; + + public final class Biome { + public static final Logger LOGGER = LogManager.getLogger(); +- public static final Codec DIRECT_CODEC; +- public static final Codec NETWORK_CODEC; ++ // Paper start - decompile fix: move up verbatim from static block ++ public static final Codec DIRECT_CODEC = RecordCodecBuilder.create((instance) -> { ++ return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> { ++ return biome.climateSettings; ++ }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> { ++ return biome.biomeCategory; ++ }), Codec.FLOAT.fieldOf("depth").forGetter((biome) -> { ++ return biome.depth; ++ }), Codec.FLOAT.fieldOf("scale").forGetter((biome) -> { ++ return biome.scale; ++ }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> { ++ return biome.specialEffects; ++ }), BiomeGenerationSettings.CODEC.forGetter((biome) -> { ++ return biome.generationSettings; ++ }), MobSpawnSettings.CODEC.forGetter((biome) -> { ++ return biome.mobSettings; ++ })).apply(instance, Biome::new); ++ }); ++ public static final Codec NETWORK_CODEC = RecordCodecBuilder.create((instance) -> { ++ return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> { ++ return biome.climateSettings; ++ }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> { ++ return biome.biomeCategory; ++ }), Codec.FLOAT.fieldOf("depth").forGetter((biome) -> { ++ return biome.depth; ++ }), Codec.FLOAT.fieldOf("scale").forGetter((biome) -> { ++ return biome.scale; ++ }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> { ++ return biome.specialEffects; ++ })).apply(instance, (climateSettings, biomeCategory, float_, float2, biomeSpecialEffects) -> { ++ return new Biome(climateSettings, biomeCategory, float_, float2, biomeSpecialEffects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY); ++ }); ++ }); ++ // Paper end + public static final Codec> CODEC = RegistryFileCodec.create(Registry.BIOME_REGISTRY, DIRECT_CODEC); + public static final Codec>> LIST_CODEC = RegistryFileCodec.homogeneousList(Registry.BIOME_REGISTRY, DIRECT_CODEC); + private final Map>> structuresByStep = Registry.STRUCTURE_FEATURE.stream().collect(Collectors.groupingBy((structureFeature) -> { +@@ -336,41 +368,6 @@ public final class Biome { + return resourceLocation == null ? super.toString() : resourceLocation.toString(); + } + +- static { +- DIRECT_CODEC = RecordCodecBuilder.create((instance) -> { +- return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> { +- return biome.climateSettings; +- }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> { +- return biome.biomeCategory; +- }), Codec.FLOAT.fieldOf("depth").forGetter((biome) -> { +- return biome.depth; +- }), Codec.FLOAT.fieldOf("scale").forGetter((biome) -> { +- return biome.scale; +- }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> { +- return biome.specialEffects; +- }), BiomeGenerationSettings.CODEC.forGetter((biome) -> { +- return biome.generationSettings; +- }), MobSpawnSettings.CODEC.forGetter((biome) -> { +- return biome.mobSettings; +- })).apply(instance, Biome::new); +- }); +- NETWORK_CODEC = RecordCodecBuilder.create((instance) -> { +- return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> { +- return biome.climateSettings; +- }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> { +- return biome.biomeCategory; +- }), Codec.FLOAT.fieldOf("depth").forGetter((biome) -> { +- return biome.depth; +- }), Codec.FLOAT.fieldOf("scale").forGetter((biome) -> { +- return biome.scale; +- }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> { +- return biome.specialEffects; +- })).apply(instance, (climateSettings, biomeCategory, float_, float2, biomeSpecialEffects) -> { +- return new Biome(climateSettings, biomeCategory, float_, float2, biomeSpecialEffects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY); +- }); +- }); +- } +- + public static class BiomeBuilder { + @Nullable + private Biome.Precipitation precipitation; +diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java +index f1ba8da158963f01c63412370a31aec617e0c7da..e76591dec764d92e1a760c5208714f3c80ea8fc7 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java ++++ b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java +@@ -6,6 +6,7 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import java.util.Arrays; + import java.util.Collection; ++import java.util.Iterator; + import java.util.Map; + import java.util.Optional; + import java.util.function.Predicate; +@@ -19,6 +20,7 @@ public class EnumProperty & StringRepresentable> extends Prope + protected EnumProperty(String name, Class type, Collection values) { + super(name, type); + this.values = ImmutableSet.copyOf(values); ++ Iterator iterator = values.iterator(); // Paper - decompile fix + + for(T enum_ : values) { + String string = enum_.getSerializedName();