diff --git a/patches/unapplied/server/0416-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/patches/server/0400-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch similarity index 100% rename from patches/unapplied/server/0416-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch rename to patches/server/0400-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/patches/unapplied/server/0417-Fix-piston-physics-inconsistency-MC-188840.patch b/patches/server/0401-Fix-piston-physics-inconsistency-MC-188840.patch similarity index 95% rename from patches/unapplied/server/0417-Fix-piston-physics-inconsistency-MC-188840.patch rename to patches/server/0401-Fix-piston-physics-inconsistency-MC-188840.patch index 1b2148c12..c3ac52967 100644 --- a/patches/unapplied/server/0417-Fix-piston-physics-inconsistency-MC-188840.patch +++ b/patches/server/0401-Fix-piston-physics-inconsistency-MC-188840.patch @@ -32,10 +32,10 @@ This patch fixes https://bugs.mojang.com/browse/MC-188840 This patch also fixes rail duping and carpet duping. diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java -index 29755807fdb6c30e31c0ec2bbf33bed9afd5d478..8d73893100884c08aa552ff41c2a07a3e714df47 100644 +index 4f6b7ed4809086811f0460544ba2ec0606f0f5da..9abae63e06c1dde9b8434d32bac8798808428d10 100644 --- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java -@@ -411,14 +411,26 @@ public class PistonBaseBlock extends DirectionalBlock { +@@ -412,14 +412,26 @@ public class PistonBaseBlock extends DirectionalBlock { } for (k = list.size() - 1; k >= 0; --k) { @@ -66,7 +66,7 @@ index 29755807fdb6c30e31c0ec2bbf33bed9afd5d478..8d73893100884c08aa552ff41c2a07a3 } 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 4f7b12d8f213d43f4ef5538b7e05809a1a106cbd..221c5d080d55326e458c1182823d6b49224ef498 100644 +index 17a6327ab7b26dfab38881bbc0689b0b25f8f025..30fafbb26a347b73c72b9f5c30da3b01e42b851c 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 @@ -288,7 +288,7 @@ public class PistonMovingBlockEntity extends BlockEntity { diff --git a/patches/unapplied/server/0418-Fix-sand-duping.patch b/patches/server/0402-Fix-sand-duping.patch similarity index 76% rename from patches/unapplied/server/0418-Fix-sand-duping.patch rename to patches/server/0402-Fix-sand-duping.patch index 0d292a092..258cb04f5 100644 --- a/patches/unapplied/server/0418-Fix-sand-duping.patch +++ b/patches/server/0402-Fix-sand-duping.patch @@ -7,7 +7,7 @@ If the falling block dies during teleportation (entity#move), then we need to detect that by placing a check after the move. diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d..5967e5093af785b5ad33e0b0da2044b3a4065107 100644 +index 95bcd8f03a784287c5a6106c784448e54c4b531b..4a44109df0aece6661567dac5ebf6355de5d58c7 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -129,6 +129,11 @@ public class FallingBlockEntity extends Entity { @@ -22,10 +22,11 @@ index d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d..5967e5093af785b5ad33e0b0da2044b3 if (this.blockState.isAir()) { this.discard(); } else { -@@ -141,6 +146,12 @@ public class FallingBlockEntity extends Entity { +@@ -140,6 +145,13 @@ public class FallingBlockEntity extends Entity { + } this.move(MoverType.SELF, this.getDeltaMovement()); - ++ + // Paper start - fix sand duping + if (this.isRemoved()) { + return; @@ -33,5 +34,5 @@ index d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d..5967e5093af785b5ad33e0b0da2044b3 + // Paper end - fix sand duping + // Paper start - Configurable EntityFallingBlock height nerf - if (this.level.paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) { - if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { + if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) { + if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { diff --git a/patches/unapplied/server/0419-Fix-missing-chunks-due-to-integer-overflow.patch b/patches/server/0403-Fix-missing-chunks-due-to-integer-overflow.patch similarity index 100% rename from patches/unapplied/server/0419-Fix-missing-chunks-due-to-integer-overflow.patch rename to patches/server/0403-Fix-missing-chunks-due-to-integer-overflow.patch diff --git a/patches/unapplied/server/0420-Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/0404-Prevent-position-desync-in-playerconnection-causing-.patch similarity index 84% rename from patches/unapplied/server/0420-Prevent-position-desync-in-playerconnection-causing-.patch rename to patches/server/0404-Prevent-position-desync-in-playerconnection-causing-.patch index b0f884fd2..1034f1644 100644 --- a/patches/unapplied/server/0420-Prevent-position-desync-in-playerconnection-causing-.patch +++ b/patches/server/0404-Prevent-position-desync-in-playerconnection-causing-.patch @@ -14,18 +14,18 @@ behaviour, we need to move all of this dangerous logic outside of the move call and into an appropriate place in the tick method. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f77abe31d6d56c11dba390cca4b8069bc535103a..16eaffffd78e60a79cdd6a15abab90c81affce78 100644 +index a9cdf3e774dbc8b689c7bbd95d94c8be32b33d92..76407e0d9081e848380c17b5f680a8560173edbc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1438,6 +1438,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1434,6 +1434,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9)); + this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8)); this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move + // Paper start - prevent position desync + if (this.awaitingPositionFromClient != null) { + return; // ... thanks Mojang for letting move calls teleport across dimensions. + } + // Paper end - prevent position desync - double d12 = d8; + double d11 = d7; - d7 = d0 - this.player.getX(); + d6 = d0 - this.player.getX(); diff --git a/patches/unapplied/server/0421-Inventory-getHolder-method-without-block-snapshot.patch b/patches/server/0405-Inventory-getHolder-method-without-block-snapshot.patch similarity index 100% rename from patches/unapplied/server/0421-Inventory-getHolder-method-without-block-snapshot.patch rename to patches/server/0405-Inventory-getHolder-method-without-block-snapshot.patch diff --git a/patches/unapplied/server/0422-Improve-Arrow-API.patch b/patches/server/0406-Improve-Arrow-API.patch similarity index 100% rename from patches/unapplied/server/0422-Improve-Arrow-API.patch rename to patches/server/0406-Improve-Arrow-API.patch diff --git a/patches/unapplied/server/0423-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/0407-Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 92% rename from patches/unapplied/server/0423-Add-and-implement-PlayerRecipeBookClickEvent.patch rename to patches/server/0407-Add-and-implement-PlayerRecipeBookClickEvent.patch index 6045e9558..e94aea902 100644 --- a/patches/unapplied/server/0423-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ b/patches/server/0407-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 38ee1f5b16e60405947b171030fc7d828440aeb0..cf1034b252d95913a3888a04b1658644c0e8e374 100644 +index 76407e0d9081e848380c17b5f680a8560173edbc..4e90349313c7e8a94949c94127dee24780a631eb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3115,9 +3115,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3107,9 +3107,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (!this.player.containerMenu.stillValid(this.player)) { ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu); } else { diff --git a/patches/unapplied/server/0424-Hide-sync-chunk-writes-behind-flag.patch b/patches/server/0408-Hide-sync-chunk-writes-behind-flag.patch similarity index 100% rename from patches/unapplied/server/0424-Hide-sync-chunk-writes-behind-flag.patch rename to patches/server/0408-Hide-sync-chunk-writes-behind-flag.patch diff --git a/patches/unapplied/server/0425-Add-permission-for-command-blocks.patch b/patches/server/0409-Add-permission-for-command-blocks.patch similarity index 91% rename from patches/unapplied/server/0425-Add-permission-for-command-blocks.patch rename to patches/server/0409-Add-permission-for-command-blocks.patch index 308fb39db..e2aea6d5a 100644 --- a/patches/unapplied/server/0425-Add-permission-for-command-blocks.patch +++ b/patches/server/0409-Add-permission-for-command-blocks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add permission for command blocks diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 051cbce8394c7a629a7ea8ac422308d96bbad6a6..52d71b08c8338254a0e50780363155da4f4c1934 100644 +index 562534d15f6f70ff286be90fb512b807e00ad807..c185083abf2b4527a7fe046d83c64cd2cc5b5bb9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -404,7 +404,7 @@ public class ServerPlayerGameMode { +@@ -402,7 +402,7 @@ public class ServerPlayerGameMode { BlockEntity tileentity = this.level.getBlockEntity(pos); Block block = iblockdata.getBlock(); @@ -18,11 +18,11 @@ index 051cbce8394c7a629a7ea8ac422308d96bbad6a6..52d71b08c8338254a0e50780363155da return false; } else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 16baa852df509a3180dc38c8e1c262bf5602b539..cf065dc3a37080fd74c240271d4699ea278ac333 100644 +index 4e90349313c7e8a94949c94127dee24780a631eb..792cc9567e1982f0cea75078045d70bc806934a4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -870,7 +870,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); +@@ -871,7 +871,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); - } else if (!this.player.canUseGameMasterBlocks()) { @@ -30,17 +30,17 @@ index 16baa852df509a3180dc38c8e1c262bf5602b539..cf065dc3a37080fd74c240271d4699ea this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); } else { BaseCommandBlock commandblocklistenerabstract = null; -@@ -937,7 +937,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); +@@ -938,7 +938,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); - } else if (!this.player.canUseGameMasterBlocks()) { + } else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); } else { - BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level); + BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level()); diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java -index 7dac559fd35e7ba646b84bb28315001375723643..7c7e5f3c0f9cd1f16192a8fc8163da9b2d9519d5 100644 +index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..c138678fe82e6c1dd7ce634f90bcbfcad6159276 100644 --- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java +++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java @@ -198,7 +198,7 @@ public abstract class BaseCommandBlock implements CommandSource { diff --git a/patches/unapplied/server/0426-Ensure-Entity-AABB-s-are-never-invalid.patch b/patches/server/0410-Ensure-Entity-AABB-s-are-never-invalid.patch similarity index 74% rename from patches/unapplied/server/0426-Ensure-Entity-AABB-s-are-never-invalid.patch rename to patches/server/0410-Ensure-Entity-AABB-s-are-never-invalid.patch index 1435741fc..4ff56c23a 100644 --- a/patches/unapplied/server/0426-Ensure-Entity-AABB-s-are-never-invalid.patch +++ b/patches/server/0410-Ensure-Entity-AABB-s-are-never-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2c9a829c3376e8767627fc94bb063486c7d0d81c..24ba8dc2a5fc72ade003fa14d337f2c64a0e654e 100644 +index e17237a1fe56bf04516b0ee0489c781a225b6a81..316597f54e6ce8da0869e6398b048c618b4a1a7b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -715,8 +715,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -636,8 +636,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public void setPos(double x, double y, double z) { @@ -19,7 +19,7 @@ index 2c9a829c3376e8767627fc94bb063486c7d0d81c..24ba8dc2a5fc72ade003fa14d337f2c6 } protected AABB makeBoundingBox() { -@@ -4075,6 +4075,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4112,6 +4112,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public final void setPosRaw(double x, double y, double z) { @@ -28,10 +28,10 @@ index 2c9a829c3376e8767627fc94bb063486c7d0d81c..24ba8dc2a5fc72ade003fa14d337f2c6 + } + public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) { + // Paper end - // Paper start - rewrite chunk system - if (this.updatingSectionStatus) { - LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable()); -@@ -4098,6 +4103,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + if (this.position.x != x || this.position.y != y || this.position.z != z) { + this.position = new Vec3(x, y, z); + int i = Mth.floor(x); +@@ -4129,6 +4134,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.levelCallback.onMove(); } diff --git a/patches/unapplied/server/0427-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0411-Fix-Per-World-Difficulty-Remembering-Difficulty.patch similarity index 82% rename from patches/unapplied/server/0427-Fix-Per-World-Difficulty-Remembering-Difficulty.patch rename to patches/server/0411-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index e43a3a80a..dd20e3d98 100644 --- a/patches/unapplied/server/0427-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0411-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -8,11 +8,11 @@ makes it so that the server keeps the last difficulty used instead of restoring the server.properties every single load. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4a58843f7ce2dd9e50f9daf3065d056a28910e5a..55625495437e94d5dc98fabe68550f68b318381f 100644 +index 49283b13a88402ac5b54fd8c64e90a82499d09d7..afa54e9cdb81f08cd9703a3991b90dbd53861b61 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -802,7 +802,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { + return Component.translatable("commands.difficulty.success", difficulty.getDisplayName()); + }, true); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 771677c0e1cd7bfe089b9a5bb9095650216ff588..520cd1a6b347687b2ec6d13f034be391d1a1af85 100644 +index 9d2eb13130d3b68fd0ca07243a3a41735f89c7b2..97b8c8cf85527db734e70679b29d64cdfbbddec3 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -326,7 +326,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -76,25 +76,25 @@ index 771677c0e1cd7bfe089b9a5bb9095650216ff588..520cd1a6b347687b2ec6d13f034be391 @Override diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 245ac1e53bfcb1888e8f10d632b181cf31d6d030..2c052d0a8c6d58ad8eae41c22c753327342e90f1 100644 +index 4495edee3b29c441d14460be1bb3f5e0ef4b9851..af06ca58e3ae488d23566b3db333067c62145ae0 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1163,7 +1163,7 @@ public class ServerPlayer extends Player { +@@ -1161,7 +1161,7 @@ public class ServerPlayer extends Player { this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds - this.connection.send(new ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), (byte) 3, this.getLastDeathLocation())); -- this.connection.send(new ClientboundChangeDifficultyPacket(this.level.getDifficulty(), this.level.getLevelData().isDifficultyLocked())); -+ this.connection.send(new ClientboundChangeDifficultyPacket(worldserver.getDifficulty(), this.level.getLevelData().isDifficultyLocked())); // Paper - fix difficulty sync issue + this.connection.send(new ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), (byte) 3, this.getLastDeathLocation(), this.getPortalCooldown())); +- this.connection.send(new ClientboundChangeDifficultyPacket(this.level().getDifficulty(), this.level().getLevelData().isDifficultyLocked())); ++ this.connection.send(new ClientboundChangeDifficultyPacket(worldserver.getDifficulty(), this.level().getLevelData().isDifficultyLocked())); // Paper - fix difficulty sync issue PlayerList playerlist = this.server.getPlayerList(); playerlist.sendPlayerPermissionLevel(this); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e9902fa67719c4b40fb9524bf77798357e9a97d9..b4f17b9c195081b54d79494d9afaf0da21f292c0 100644 +index 792cc9567e1982f0cea75078045d70bc806934a4..2768e46562f36bcb11cead95e65deb8db4884a12 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3390,7 +3390,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3345,7 +3345,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { - this.server.setDifficulty(packet.getDifficulty(), false); + // this.server.setDifficulty(packet.getDifficulty(), false); // Paper - don't allow clients to change this @@ -102,7 +102,7 @@ index e9902fa67719c4b40fb9524bf77798357e9a97d9..b4f17b9c195081b54d79494d9afaf0da } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d4439eb165cf01f4dd7eb106d14f7b96c1989e63..dfde62de3b59b9c2473e8f320552051a8904d51b 100644 +index cd04bdf3637584b6ea7298b5d833d4a71ce427ff..ae1c8ec8b1cbfd5fab89d6cf5e33e2f209f82d03 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -964,8 +964,8 @@ public final class CraftServer implements Server { @@ -117,10 +117,10 @@ index d4439eb165cf01f4dd7eb106d14f7b96c1989e63..dfde62de3b59b9c2473e8f320552051a for (SpawnCategory spawnCategory : SpawnCategory.values()) { if (CraftSpawnCategory.isValidForLimits(spawnCategory)) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ec934c2cb6f183c43c06ba9c4d015890d5992934..6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d 100644 +index 76054a4fc036b1f9577aa8da215388c5137f3611..7cca27a4bedbb4b1f5cf0707e72052b6e155acfd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1145,7 +1145,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1150,7 +1150,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setDifficulty(Difficulty difficulty) { diff --git a/patches/unapplied/server/0428-Paper-dumpitem-command.patch b/patches/server/0412-Paper-dumpitem-command.patch similarity index 94% rename from patches/unapplied/server/0428-Paper-dumpitem-command.patch rename to patches/server/0412-Paper-dumpitem-command.patch index 49612cd29..1842eaab6 100644 --- a/patches/unapplied/server/0428-Paper-dumpitem-command.patch +++ b/patches/server/0412-Paper-dumpitem-command.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Paper dumpitem command Let's you quickly view the item in your hands NBT data diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 1e9f191dc0f9d98f4404d2796f15b13912860b13..6d56c812262f7f109598ef4a941d0226b1eb638a 100644 +index 1188d221be8a4f1dece514e3f66b99f60b556488..65209c7d15fc1b51e20c4f18cd44d1f61c769d09 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { +@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); commands.put(Set.of("fixlight"), new FixLightCommand()); - commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); + commands.put(Set.of("dumpitem"), new DumpItemCommand()); diff --git a/patches/unapplied/server/0429-Improve-Legacy-Component-serialization-size.patch b/patches/server/0413-Improve-Legacy-Component-serialization-size.patch similarity index 100% rename from patches/unapplied/server/0429-Improve-Legacy-Component-serialization-size.patch rename to patches/server/0413-Improve-Legacy-Component-serialization-size.patch diff --git a/patches/unapplied/server/0430-Optimize-Bit-Operations-by-inlining.patch b/patches/server/0414-Optimize-Bit-Operations-by-inlining.patch similarity index 94% rename from patches/unapplied/server/0430-Optimize-Bit-Operations-by-inlining.patch rename to patches/server/0414-Optimize-Bit-Operations-by-inlining.patch index 278f49121..468568d8a 100644 --- a/patches/unapplied/server/0430-Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/0414-Optimize-Bit-Operations-by-inlining.patch @@ -7,10 +7,10 @@ Inline bit operations and reduce instruction count to make these hot operations faster diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b123501498140238a 100644 +index fbdbf61f49bd6867eea609d5572fb31ece094944..441ea6b9fd55a5288f264472d7297728d0546d6b 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -30,15 +30,16 @@ public class BlockPos extends Vec3i { +@@ -37,15 +37,16 @@ public class BlockPos extends Vec3i { }).stable(); private static final Logger LOGGER = LogUtils.getLogger(); public static final BlockPos ZERO = new BlockPos(0, 0, 0); @@ -36,7 +36,7 @@ index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b12350149 public BlockPos(int x, int y, int z) { super(x, y, z); -@@ -48,28 +49,29 @@ public class BlockPos extends Vec3i { +@@ -55,28 +56,29 @@ public class BlockPos extends Vec3i { this(pos.getX(), pos.getY(), pos.getZ()); } @@ -71,7 +71,7 @@ index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b12350149 } public static BlockPos containing(double x, double y, double z) { -@@ -85,10 +87,7 @@ public class BlockPos extends Vec3i { +@@ -92,10 +94,7 @@ public class BlockPos extends Vec3i { } public static long asLong(int x, int y, int z) { @@ -84,7 +84,7 @@ index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b12350149 public static long getFlatIndex(long y) { diff --git a/src/main/java/net/minecraft/core/SectionPos.java b/src/main/java/net/minecraft/core/SectionPos.java -index a481bd6328fe9e66f6911bf32ed11947c504c93c..a9d0d72aad7b1b708617a082c5efcd881a0f00d3 100644 +index eb97928380384b8c33cf142dd9a5db65951c94c6..392c3681c08d9e3d99cbabaf72d22c1d1518998d 100644 --- a/src/main/java/net/minecraft/core/SectionPos.java +++ b/src/main/java/net/minecraft/core/SectionPos.java @@ -38,7 +38,7 @@ public class SectionPos extends Vec3i { @@ -167,8 +167,8 @@ index a481bd6328fe9e66f6911bf32ed11947c504c93c..a9d0d72aad7b1b708617a082c5efcd88 + return (((long) (int) (blockPos >> 42) & 4194303L) << 42) | (((long) (int) ((blockPos << 52) >> 56) & 1048575L)) | (((long) (int) ((blockPos << 26) >> 42) & 4194303L) << 20); // Simplify to reduce instruction count } - public static long getZeroNode(long pos) { -@@ -201,15 +207,18 @@ public class SectionPos extends Vec3i { + public static long getZeroNode(int x, int z) { +@@ -205,15 +211,18 @@ public class SectionPos extends Vec3i { return asLong(blockToSectionCoord(pos.getX()), blockToSectionCoord(pos.getY()), blockToSectionCoord(pos.getZ())); } @@ -192,7 +192,7 @@ index a481bd6328fe9e66f6911bf32ed11947c504c93c..a9d0d72aad7b1b708617a082c5efcd88 } @Override -@@ -222,16 +231,11 @@ public class SectionPos extends Vec3i { +@@ -226,16 +235,11 @@ public class SectionPos extends Vec3i { } public static Stream cube(SectionPos center, int radius) { diff --git a/patches/unapplied/server/0431-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0415-Add-Plugin-Tickets-to-API-Chunk-Methods.patch similarity index 94% rename from patches/unapplied/server/0431-Add-Plugin-Tickets-to-API-Chunk-Methods.patch rename to patches/server/0415-Add-Plugin-Tickets-to-API-Chunk-Methods.patch index b30b0ed8a..4c1feb6a8 100644 --- a/patches/unapplied/server/0431-Add-Plugin-Tickets-to-API-Chunk-Methods.patch +++ b/patches/server/0415-Add-Plugin-Tickets-to-API-Chunk-Methods.patch @@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dfde62de3b59b9c2473e8f320552051a8904d51b..e9c52523142df3a0dd9ae9389c69024eb2fe5386 100644 +index ae1c8ec8b1cbfd5fab89d6cf5e33e2f209f82d03..fcf6585a66a95c3414c2b4eb384b9321aa678c22 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -377,7 +377,7 @@ public final class CraftServer implements Server { @@ -44,7 +44,7 @@ index dfde62de3b59b9c2473e8f320552051a8904d51b..e9c52523142df3a0dd9ae9389c69024e this.printSaveWarning = false; console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea46f75bd2 100644 +index 7cca27a4bedbb4b1f5cf0707e72052b6e155acfd..4ee07d866c23ffe3061ccf0d663e5d4235b9007e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -280,7 +280,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -84,7 +84,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea } return true; -@@ -445,9 +457,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -437,9 +449,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot // Paper start - Optimize this method ChunkPos chunkPos = new ChunkPos(x, z); @@ -98,7 +98,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea if (immediate == null) { immediate = world.getChunkSource().chunkMap.getUnloadingChunk(x, z); } -@@ -455,7 +470,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -447,7 +462,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!(immediate instanceof ImposterProtoChunk) && !(immediate instanceof net.minecraft.world.level.chunk.LevelChunk)) { return false; // not full status } @@ -107,7 +107,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea world.getChunk(x, z); // make sure we're at ticket level 32 or lower return true; } -@@ -481,7 +496,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -473,7 +488,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // we do this so we do not re-read the chunk data on disk } @@ -116,7 +116,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true); return true; // Paper end -@@ -2201,6 +2216,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2167,6 +2182,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> { net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> { net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c; diff --git a/patches/unapplied/server/0432-incremental-chunk-and-player-saving.patch b/patches/server/0416-incremental-chunk-and-player-saving.patch similarity index 88% rename from patches/unapplied/server/0432-incremental-chunk-and-player-saving.patch rename to patches/server/0416-incremental-chunk-and-player-saving.patch index dbca41fb9..c013b8b7e 100644 --- a/patches/unapplied/server/0432-incremental-chunk-and-player-saving.patch +++ b/patches/server/0416-incremental-chunk-and-player-saving.patch @@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 55625495437e94d5dc98fabe68550f68b318381f..4fec26c84cb435756fe4b2dcdfc90716f342f9f1 100644 +index afa54e9cdb81f08cd9703a3991b90dbd53861b61..b5cc8a2c46b928796c47832ee7430f63f616bfd2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -875,7 +875,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop) enchantSorter); // Paper } catch (Exception ignored) {} } @@ -53,7 +53,7 @@ index 57661672d02b19c864bb267c09b2fa433e716b7b..3cb83cfeb2709384ef4f7dd74694d47d // Paper end public ItemStack(ItemLike item) { -@@ -227,6 +265,7 @@ public final class ItemStack { +@@ -222,6 +260,7 @@ public final class ItemStack { this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end this.processEnchantOrder(this.tag); // Paper diff --git a/patches/unapplied/server/0443-Spawn-player-in-correct-world-on-login.patch b/patches/server/0426-Spawn-player-in-correct-world-on-login.patch similarity index 90% rename from patches/unapplied/server/0443-Spawn-player-in-correct-world-on-login.patch rename to patches/server/0426-Spawn-player-in-correct-world-on-login.patch index 08b6e1b41..d859c7ec9 100644 --- a/patches/unapplied/server/0443-Spawn-player-in-correct-world-on-login.patch +++ b/patches/server/0426-Spawn-player-in-correct-world-on-login.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Spawn player in correct world on login diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 44ead3a9831d913f7337a447b73a94e06fb0f06a..ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba 100644 +index bc2bf0fc3bd169caadba9a2e3faf2fa333a41f04..2d75a19def131b63e238dd81bb651834ed53df6b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -205,7 +205,18 @@ public abstract class PlayerList { +@@ -212,7 +212,18 @@ public abstract class PlayerList { } // CraftBukkit end diff --git a/patches/unapplied/server/0444-Add-PrepareResultEvent.patch b/patches/server/0427-Add-PrepareResultEvent.patch similarity index 88% rename from patches/unapplied/server/0444-Add-PrepareResultEvent.patch rename to patches/server/0427-Add-PrepareResultEvent.patch index 19a4825ee..2d660c5c5 100644 --- a/patches/unapplied/server/0444-Add-PrepareResultEvent.patch +++ b/patches/server/0427-Add-PrepareResultEvent.patch @@ -8,19 +8,19 @@ Adds a new event for all crafting stations that generate a result slot item Anvil, Grindstone and Smithing now extend this event diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -index 0a132fbbc58f52e51f50a44e887a3f20d2e0a61c..b7a2295290227045e6426ee0f71707185d95b943 100644 +index d15f01f5a4f14d25ded9de015c70cbc7977a6a77..e0c3a4ba27e21c3692e601acd0af60873bcbb84c 100644 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -@@ -332,6 +332,7 @@ public class AnvilMenu extends ItemCombinerMenu { - } +@@ -338,6 +338,7 @@ public class AnvilMenu extends ItemCombinerMenu { + } - this.createResult(); -+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper - } - - public int getCost() { + this.createResult(); ++ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper + return true; + } else { + return false; diff --git a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java -index 8e4f331b9d90c98943e93a70b574d59cbb6d2909..310e447d8db86a322ca33d4e803b03ead8a7b202 100644 +index fe1ce65b35e83ee0ada77e44b080729346bb3c2d..819187dbcf468d9278ce33bd97688476aab53f8e 100644 --- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java +++ b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java @@ -150,6 +150,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { @@ -32,7 +32,7 @@ index 8e4f331b9d90c98943e93a70b574d59cbb6d2909..310e447d8db86a322ca33d4e803b03ea private void setupResultSlot(ItemStack map, ItemStack item, ItemStack oldResult) { diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 5bcd3857fd30ec43e0191a862fc9c7712149e3dd..4770f2b19847be6002f9fea9c258f8239b735589 100644 +index 2c263447aa8853f18d1c1d476b49a47f6e9ca2ad..03d3edadf39d4871a332808458870ea9479669c4 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -159,6 +159,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -56,7 +56,7 @@ index 4087e381b2250be387b608d8742f6a6009a52879..ff770b9ce68a62418de0c7ed38965062 } diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index cdc7334b21120dde30705138436608a3af4acf05..6e2784938e1e1a29ac133567ae6c2d29429478f0 100644 +index edc8da447a531cec3a0590ee39811f0949ca7dda..c4766df6d64b484375e5e3474e97dee196c0fef4 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java @@ -248,7 +248,8 @@ public class LoomMenu extends AbstractContainerMenu { @@ -70,10 +70,10 @@ index cdc7334b21120dde30705138436608a3af4acf05..6e2784938e1e1a29ac133567ae6c2d29 this.resultSlot.set(ItemStack.EMPTY); this.selectablePatterns = List.of(); diff --git a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java -index d8437b76488e26451f3ed13c392fab6c2badc085..db73a4dda83a128aa0cd5f19e2f233b86479839a 100644 +index a56061fe2a12254827209b17fb0b9d89032649ba..dbfd36859010a1f950769708fbc5fc604c0754a9 100644 --- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java +++ b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java -@@ -107,6 +107,7 @@ public class SmithingMenu extends ItemCombinerMenu { +@@ -114,6 +114,7 @@ public class SmithingMenu extends ItemCombinerMenu { } } @@ -82,10 +82,10 @@ index d8437b76488e26451f3ed13c392fab6c2badc085..db73a4dda83a128aa0cd5f19e2f233b8 @Override diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -index 665b01ff3579c8fd87074edfc6da6b7ef07693b2..24c31e96be460bcb5062a1fcf7f86c1affc4978c 100644 +index 8734a129244271b370f965fcbf488a14ce04684a..00f01ab2eff69c18b50ec07b7623af66c66a28b6 100644 --- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java +++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -@@ -176,6 +176,7 @@ public class StonecutterMenu extends AbstractContainerMenu { +@@ -180,6 +180,7 @@ public class StonecutterMenu extends AbstractContainerMenu { this.setupRecipeList(inventory, itemstack); } @@ -94,7 +94,7 @@ index 665b01ff3579c8fd87074edfc6da6b7ef07693b2..24c31e96be460bcb5062a1fcf7f86c1a private void setupRecipeList(Container input, ItemStack stack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0ad0d6e15f57c16fb71f988ac7d0d2e243493801..a1948b59e5c6bcc4c85d175d3267e9dd091768a6 100644 +index 7af0710c40c1453bd0bd8ecb4ea7606bbe76c20f..2502da6e68f97a7c37f1756d6845e531da1663c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1624,26 +1624,53 @@ public class CraftEventFactory { diff --git a/patches/unapplied/server/0445-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0428-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 74% rename from patches/unapplied/server/0445-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/0428-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 0f403623f..c84891c8c 100644 --- a/patches/unapplied/server/0445-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/0428-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index b0a57ff0780c3f37110a9c3640f29cb08daa52d5..164c22a70f4b916615da36819cae09d94cd88d39 100644 +index d9ee22bbd654a2f39c443262b4a11f997ed1559e..84f56d1eb0075f1f3d3d52d1b893732c3804c276 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3435,7 +3435,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3484,7 +3484,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress -- if (entity != null && entity != this.getVehicle() && !this.level.isClientSide) { -+ if (entity != null && entity != this.getVehicle() && !this.level.isClientSide && entity.valid) { // Paper - don't process on world gen +- if (entity != null && entity != this.getVehicle() && !this.level().isClientSide) { ++ if (entity != null && entity != this.getVehicle() && !this.level().isClientSide && entity.valid) { // Paper - don't process on world gen this.dismountVehicle(entity); } diff --git a/patches/unapplied/server/0446-Optimize-NetworkManager-Exception-Handling.patch b/patches/server/0429-Optimize-NetworkManager-Exception-Handling.patch similarity index 100% rename from patches/unapplied/server/0446-Optimize-NetworkManager-Exception-Handling.patch rename to patches/server/0429-Optimize-NetworkManager-Exception-Handling.patch diff --git a/patches/unapplied/server/0447-Fix-arrows-never-despawning-MC-125757.patch b/patches/server/0430-Fix-arrows-never-despawning-MC-125757.patch similarity index 91% rename from patches/unapplied/server/0447-Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/0430-Fix-arrows-never-despawning-MC-125757.patch index 3a2912d8b..bd9c1d6de 100644 --- a/patches/unapplied/server/0447-Fix-arrows-never-despawning-MC-125757.patch +++ b/patches/server/0430-Fix-arrows-never-despawning-MC-125757.patch @@ -9,7 +9,7 @@ instead of getting stuck in a never despawn state (bubble columns, etc). diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 01ccd4f90ad8aed84a89630cf6df9f7ba9bc3fec..6486fa86e4bf3c90c09c0425d825bab568a68757 100644 +index 86a82ecdcffc27b523fddc2709bbd92f315e8590..a0d688128a1268fa1acf7c339cde15df5dce1c82 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -200,6 +200,7 @@ public abstract class AbstractArrow extends Projectile { diff --git a/patches/unapplied/server/0448-Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/0431-Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 91% rename from patches/unapplied/server/0448-Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/0431-Thread-Safe-Vanilla-Command-permission-checking.patch index 41ee49df9..c285fc146 100644 --- a/patches/unapplied/server/0448-Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/patches/server/0431-Thread-Safe-Vanilla-Command-permission-checking.patch @@ -26,19 +26,19 @@ index 20a7cdf87f307878d66922aaac0c60cff218e46c..39844531b03eb8a6c70700b4ecbf0ff1 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index efad6dc30ff2731fdaed9c7f8d974aba8d8a4bcf..24172c3b7b1d2faa13b18bedf89ad051267feb6c 100644 +index 66bd75ee66840f17cc7d00ff89adcb88d83e4dc9..308b3a36f063c401a447f9b7f0364700eee5a54c 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java -@@ -61,7 +61,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy - private final Vec2 rotation; +@@ -64,7 +64,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy private final CommandSigningContext signingContext; private final TaskChainer chatMessageChainer; + private final IntConsumer returnValueConsumer; - public volatile CommandNode currentCommand; // CraftBukkit + public java.util.Map currentCommand = new java.util.concurrent.ConcurrentHashMap<>(); // CraftBukkit // Paper public boolean bypassSelectorPermissions = false; // Paper public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) { -@@ -194,9 +194,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy +@@ -203,9 +203,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @Override public boolean hasPermission(int level) { // CraftBukkit start diff --git a/patches/unapplied/server/0449-Fix-SPIGOT-5989.patch b/patches/server/0432-Fix-SPIGOT-5989.patch similarity index 90% rename from patches/unapplied/server/0449-Fix-SPIGOT-5989.patch rename to patches/server/0432-Fix-SPIGOT-5989.patch index 268acb81a..a74a46585 100644 --- a/patches/unapplied/server/0449-Fix-SPIGOT-5989.patch +++ b/patches/server/0432-Fix-SPIGOT-5989.patch @@ -10,10 +10,10 @@ This fixes that by checking if the modified spawn location is still at a respawn anchor. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837ecb424d65 100644 +index 2d75a19def131b63e238dd81bb651834ed53df6b..20fe7dd46b8b641fe628695f17edac42fd000bb6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -787,6 +787,7 @@ public abstract class PlayerList { +@@ -794,6 +794,7 @@ public abstract class PlayerList { // Paper start boolean isBedSpawn = false; boolean isRespawn = false; @@ -21,7 +21,7 @@ index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837e // Paper end // CraftBukkit start - fire PlayerRespawnEvent -@@ -797,7 +798,7 @@ public abstract class PlayerList { +@@ -804,7 +805,7 @@ public abstract class PlayerList { Optional optional; if (blockposition != null) { @@ -30,7 +30,7 @@ index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837e } else { optional = Optional.empty(); } -@@ -841,7 +842,12 @@ public abstract class PlayerList { +@@ -848,7 +849,12 @@ public abstract class PlayerList { } // Spigot End @@ -44,7 +44,7 @@ index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837e if (!flag) entityplayer.reset(); // SPIGOT-4785 isRespawn = true; // Paper } else { -@@ -881,8 +887,14 @@ public abstract class PlayerList { +@@ -888,8 +894,14 @@ public abstract class PlayerList { } // entityplayer1.initInventoryMenu(); entityplayer1.setHealth(entityplayer1.getHealth()); diff --git a/patches/unapplied/server/0450-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0433-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 88% rename from patches/unapplied/server/0450-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/0433-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch index 8f7b49fc0..f37241f89 100644 --- a/patches/unapplied/server/0450-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch +++ b/patches/server/0433-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 12ff7071a5b78a8ae5567aa42b69191166a7cbca..51640f991f23ad9c10a969a2c8100bcfab882050 100644 +index 13797f0a55d62a022eda19f3134fe6256d15ff67..62bcf73e0ea23a610b67709457a8c6d0cdf3233b 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -169,8 +169,17 @@ public class Main { @@ -29,10 +29,10 @@ index 12ff7071a5b78a8ae5567aa42b69191166a7cbca..51640f991f23ad9c10a969a2c8100bcf String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java -index d7d65d0faefa5551480a4090de3a881828238ffd..ef6ff78af2ae747e939895b82ee9d11c75012dcd 100644 +index f1cc27809c1e8612f7c4fa912f5e39c07b09d808..a9b2c8cd4dcd3f884e4306bebee9334d3848fce5 100644 --- a/src/main/java/net/minecraft/server/Services.java +++ b/src/main/java/net/minecraft/server/Services.java -@@ -19,12 +19,12 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato +@@ -22,12 +22,12 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se return java.util.Objects.requireNonNull(this.paperConfigurations); } // Paper end @@ -45,6 +45,6 @@ index d7d65d0faefa5551480a4090de3a881828238ffd..ef6ff78af2ae747e939895b82ee9d11c GameProfileRepository gameProfileRepository = authenticationService.createProfileRepository(); - GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, new File(rootDirectory, "usercache.json")); + GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, userCacheFile); // Paper - SignatureValidator signatureValidator = SignatureValidator.from(authenticationService.getServicesKey()); // Paper start final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath(); + final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath(); diff --git a/patches/unapplied/server/0451-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0434-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 89% rename from patches/unapplied/server/0451-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/0434-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch index 297822e86..288f02d66 100644 --- a/patches/unapplied/server/0451-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch +++ b/patches/server/0434-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 51640f991f23ad9c10a969a2c8100bcfab882050..5516888e72adf3f0b39119ed4f24e9aab09b1f37 100644 +index 62bcf73e0ea23a610b67709457a8c6d0cdf3233b..b51636545036ee7492c9f907f94295b1dd66a811 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -169,6 +169,7 @@ public class Main { diff --git a/patches/unapplied/server/0452-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/0435-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 92% rename from patches/unapplied/server/0452-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/0435-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index 43380c596..c043b4259 100644 --- a/patches/unapplied/server/0452-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/0435-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -9,7 +9,7 @@ itself, so the criterion object stores no references - and thus needs no cleanup. diff --git a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java -index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fdd3e0489e 100644 +index 70d4467e8e4dd9be38a7bfe8494efb6e67e18b9a..4b0e967fac5adb54b2d26ee8f7a1ced259ad11db 100644 --- a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java +++ b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java @@ -14,22 +14,24 @@ import net.minecraft.server.level.ServerPlayer; @@ -49,7 +49,7 @@ index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fd + tracker.criterionData.remove(this); // Paper - fix AdvancementDataPlayer leak } - protected abstract T createInstance(JsonObject obj, EntityPredicate.Composite playerPredicate, DeserializationContext predicateDeserializer); + protected abstract T createInstance(JsonObject obj, ContextAwarePredicate playerPredicate, DeserializationContext predicateDeserializer); @@ -50,7 +52,7 @@ public abstract class SimpleCriterionTrigger predicate) { @@ -60,7 +60,7 @@ index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fd LootContext lootContext = EntityPredicate.createContext(player, player); List> list = null; diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 6802e1def5e93c208d01a68f5cfc4c8809bb910f..7116b0752c8d790a6eae0cb4ea851beac59faaa4 100644 +index 100781852965e09c92aca34785673c5de51c7107..9034faaf7b169788abad01d3da9c65ad5ddc4b8b 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -62,6 +62,7 @@ public class PlayerAdvancements {