diff --git a/patches/unapplied/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch similarity index 100% rename from patches/unapplied/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch rename to patches/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch diff --git a/patches/unapplied/server/Add-PrepareResultEvent.patch b/patches/server/Add-PrepareResultEvent.patch similarity index 97% rename from patches/unapplied/server/Add-PrepareResultEvent.patch rename to patches/server/Add-PrepareResultEvent.patch index 6218deffd8..b4ce2d5015 100644 --- a/patches/unapplied/server/Add-PrepareResultEvent.patch +++ b/patches/server/Add-PrepareResultEvent.patch @@ -12,13 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java @@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java diff --git a/patches/unapplied/server/Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 100% rename from patches/unapplied/server/Add-and-implement-PlayerRecipeBookClickEvent.patch rename to patches/server/Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/patches/unapplied/server/Add-entity-liquid-API.patch b/patches/server/Add-entity-liquid-API.patch similarity index 100% rename from patches/unapplied/server/Add-entity-liquid-API.patch rename to patches/server/Add-entity-liquid-API.patch diff --git a/patches/unapplied/server/Add-permission-for-command-blocks.patch b/patches/server/Add-permission-for-command-blocks.patch similarity index 98% rename from patches/unapplied/server/Add-permission-for-command-blocks.patch rename to patches/server/Add-permission-for-command-blocks.patch index 46fffaa783..4fd899b01a 100644 --- a/patches/unapplied/server/Add-permission-for-command-blocks.patch +++ b/patches/server/Add-permission-for-command-blocks.patch @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); - } else if (!this.player.canUseGameMasterBlocks()) { @@ -31,14 +31,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { BaseCommandBlock commandblocklistenerabstract = null; @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); + 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java diff --git a/patches/unapplied/server/Clean-up-duplicated-GameProfile-Properties.patch b/patches/server/Clean-up-duplicated-GameProfile-Properties.patch similarity index 100% rename from patches/unapplied/server/Clean-up-duplicated-GameProfile-Properties.patch rename to patches/server/Clean-up-duplicated-GameProfile-Properties.patch diff --git a/patches/unapplied/server/Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/Convert-legacy-attributes-in-Item-Meta.patch similarity index 100% rename from patches/unapplied/server/Convert-legacy-attributes-in-Item-Meta.patch rename to patches/server/Convert-legacy-attributes-in-Item-Meta.patch diff --git a/patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 89% rename from patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 668189d250..36c60237d3 100644 --- a/patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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/Ensure-Entity-AABB-s-are-never-invalid.patch b/patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch similarity index 87% rename from patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch rename to patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch index 9242d2a605..d76f58368c 100644 --- a/patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch +++ b/patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch @@ -28,9 +28,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + 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()); + 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); @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.levelCallback.onMove(); } diff --git a/patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 96% rename from patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index bfc8a4d50b..a16096fe52 100644 --- a/patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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); @@ -0,0 +0,0 @@ public abstract class SimpleCriterionTrigger<T extends AbstractCriterionTriggerI protected void trigger(ServerPlayer player, Predicate<T> predicate) { diff --git a/patches/unapplied/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/patches/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch rename to patches/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch similarity index 94% rename from patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch rename to patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch index a92569915d..3776e813db 100644 --- a/patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig().misc.lightQueueSize); // Paper - increase light queue size + if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper // CraftBukkit start // this.updateMobSpawningFlags(); - worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals()); @@ -59,9 +59,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { - worldServer.serverLevelData.setDifficulty(difficulty); // CraftBukkit + minecraftserver.setDifficulty(worldServer, difficulty, true); // Paper - don't skip other difficulty-changing logic (fix upstream's fix) - source.sendSuccess(Component.translatable("commands.difficulty.success", difficulty.getDisplayName()), true); - return 0; - } + source.sendSuccess(() -> { + 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -82,9 +82,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ 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); @@ -94,7 +94,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ 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 diff --git a/patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 95% rename from patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch index 7198638af2..78dedadc94 100644 --- a/patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch +++ b/patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch @@ -32,7 +32,7 @@ diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/ne index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Services.java +++ b/src/main/java/net/minecraft/server/Services.java -@@ -0,0 +0,0 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato +@@ -0,0 +0,0 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se return java.util.Objects.requireNonNull(this.paperConfigurations); } // Paper end @@ -45,6 +45,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5989.patch b/patches/server/Fix-SPIGOT-5989.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5989.patch rename to patches/server/Fix-SPIGOT-5989.patch diff --git a/patches/unapplied/server/Fix-arrows-never-despawning-MC-125757.patch b/patches/server/Fix-arrows-never-despawning-MC-125757.patch similarity index 100% rename from patches/unapplied/server/Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/Fix-arrows-never-despawning-MC-125757.patch diff --git a/patches/unapplied/server/Fix-missing-chunks-due-to-integer-overflow.patch b/patches/server/Fix-missing-chunks-due-to-integer-overflow.patch similarity index 100% rename from patches/unapplied/server/Fix-missing-chunks-due-to-integer-overflow.patch rename to patches/server/Fix-missing-chunks-due-to-integer-overflow.patch diff --git a/patches/unapplied/server/Fix-piston-physics-inconsistency-MC-188840.patch b/patches/server/Fix-piston-physics-inconsistency-MC-188840.patch similarity index 100% rename from patches/unapplied/server/Fix-piston-physics-inconsistency-MC-188840.patch rename to patches/server/Fix-piston-physics-inconsistency-MC-188840.patch diff --git a/patches/unapplied/server/Fix-sand-duping.patch b/patches/server/Fix-sand-duping.patch similarity index 86% rename from patches/unapplied/server/Fix-sand-duping.patch rename to patches/server/Fix-sand-duping.patch index 7087d5f9fa..b2f1c4d9dd 100644 --- a/patches/unapplied/server/Fix-sand-duping.patch +++ b/patches/server/Fix-sand-duping.patch @@ -23,9 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.discard(); } else { @@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // 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/Hide-sync-chunk-writes-behind-flag.patch b/patches/server/Hide-sync-chunk-writes-behind-flag.patch similarity index 100% rename from patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch rename to patches/server/Hide-sync-chunk-writes-behind-flag.patch diff --git a/patches/unapplied/server/Improve-Arrow-API.patch b/patches/server/Improve-Arrow-API.patch similarity index 100% rename from patches/unapplied/server/Improve-Arrow-API.patch rename to patches/server/Improve-Arrow-API.patch diff --git a/patches/unapplied/server/Improve-Legacy-Component-serialization-size.patch b/patches/server/Improve-Legacy-Component-serialization-size.patch similarity index 100% rename from patches/unapplied/server/Improve-Legacy-Component-serialization-size.patch rename to patches/server/Improve-Legacy-Component-serialization-size.patch diff --git a/patches/unapplied/server/Improve-fix-EntityTargetLivingEntityEvent.patch b/patches/server/Improve-fix-EntityTargetLivingEntityEvent.patch similarity index 97% rename from patches/unapplied/server/Improve-fix-EntityTargetLivingEntityEvent.patch rename to patches/server/Improve-fix-EntityTargetLivingEntityEvent.patch index 9f037428ce..34ceee266f 100644 --- a/patches/unapplied/server/Improve-fix-EntityTargetLivingEntityEvent.patch +++ b/patches/server/Improve-fix-EntityTargetLivingEntityEvent.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java @@ -0,0 +0,0 @@ public class StopAttackingIfTargetInvalid { - if (entityinsentient.canAttack(entityliving) && (!shouldForgetIfTargetUnreachable || !StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level == entityinsentient.level && !alternativeCondition.test(entityliving)) { + if (entityinsentient.canAttack(entityliving) && (!shouldForgetIfTargetUnreachable || !StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !alternativeCondition.test(entityliving)) { return true; } else { + // Paper start - better track target change reason diff --git a/patches/unapplied/server/Inventory-getHolder-method-without-block-snapshot.patch b/patches/server/Inventory-getHolder-method-without-block-snapshot.patch similarity index 100% rename from patches/unapplied/server/Inventory-getHolder-method-without-block-snapshot.patch rename to patches/server/Inventory-getHolder-method-without-block-snapshot.patch diff --git a/patches/unapplied/server/Optimize-Bit-Operations-by-inlining.patch b/patches/server/Optimize-Bit-Operations-by-inlining.patch similarity index 99% rename from patches/unapplied/server/Optimize-Bit-Operations-by-inlining.patch rename to patches/server/Optimize-Bit-Operations-by-inlining.patch index d94f068866..e7615b7a68 100644 --- a/patches/unapplied/server/Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/Optimize-Bit-Operations-by-inlining.patch @@ -167,7 +167,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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) { + public static long getZeroNode(int x, int z) { @@ -0,0 +0,0 @@ public class SectionPos extends Vec3i { return asLong(blockToSectionCoord(pos.getX()), blockToSectionCoord(pos.getY()), blockToSectionCoord(pos.getZ())); } diff --git a/patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch b/patches/server/Optimize-NetworkManager-Exception-Handling.patch similarity index 100% rename from patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch rename to patches/server/Optimize-NetworkManager-Exception-Handling.patch diff --git a/patches/unapplied/server/Paper-dumpitem-command.patch b/patches/server/Paper-dumpitem-command.patch similarity index 97% rename from patches/unapplied/server/Paper-dumpitem-command.patch rename to patches/server/Paper-dumpitem-command.patch index 8608deff59..4d5fc71282 100644 --- a/patches/unapplied/server/Paper-dumpitem-command.patch +++ b/patches/server/Paper-dumpitem-command.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java @@ -0,0 +0,0 @@ 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/Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/Prevent-position-desync-in-playerconnection-causing-.patch similarity index 93% rename from patches/unapplied/server/Prevent-position-desync-in-playerconnection-causing-.patch rename to patches/server/Prevent-position-desync-in-playerconnection-causing-.patch index 4173410706..a63fe57768 100644 --- a/patches/unapplied/server/Prevent-position-desync-in-playerconnection-causing-.patch +++ b/patches/server/Prevent-position-desync-in-playerconnection-causing-.patch @@ -19,13 +19,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ 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/Remove-some-streams-from-structures.patch b/patches/server/Remove-some-streams-from-structures.patch similarity index 100% rename from patches/unapplied/server/Remove-some-streams-from-structures.patch rename to patches/server/Remove-some-streams-from-structures.patch diff --git a/patches/unapplied/server/Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch similarity index 100% rename from patches/unapplied/server/Remove-streams-from-classes-related-villager-gossip.patch rename to patches/server/Remove-streams-from-classes-related-villager-gossip.patch diff --git a/patches/unapplied/server/Spawn-player-in-correct-world-on-login.patch b/patches/server/Spawn-player-in-correct-world-on-login.patch similarity index 100% rename from patches/unapplied/server/Spawn-player-in-correct-world-on-login.patch rename to patches/server/Spawn-player-in-correct-world-on-login.patch diff --git a/patches/unapplied/server/Support-components-in-ItemMeta.patch b/patches/server/Support-components-in-ItemMeta.patch similarity index 100% rename from patches/unapplied/server/Support-components-in-ItemMeta.patch rename to patches/server/Support-components-in-ItemMeta.patch diff --git a/patches/unapplied/server/Support-old-UUID-format-for-NBT.patch b/patches/server/Support-old-UUID-format-for-NBT.patch similarity index 100% rename from patches/unapplied/server/Support-old-UUID-format-for-NBT.patch rename to patches/server/Support-old-UUID-format-for-NBT.patch diff --git a/patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 98% rename from patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch index c6d2445035..f23d909b49 100644 --- a/patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch @@ -30,9 +30,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -0,0 +0,0 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy - private final Vec2 rotation; private final CommandSigningContext signingContext; private final TaskChainer chatMessageChainer; + private final IntConsumer returnValueConsumer; - public volatile CommandNode currentCommand; // CraftBukkit + public java.util.Map<Thread, CommandNode> currentCommand = new java.util.concurrent.ConcurrentHashMap<>(); // CraftBukkit // Paper public boolean bypassSelectorPermissions = false; // Paper diff --git a/patches/unapplied/server/Update-itemstack-legacy-name-and-lore.patch b/patches/server/Update-itemstack-legacy-name-and-lore.patch similarity index 100% rename from patches/unapplied/server/Update-itemstack-legacy-name-and-lore.patch rename to patches/server/Update-itemstack-legacy-name-and-lore.patch diff --git a/patches/unapplied/server/incremental-chunk-and-player-saving.patch b/patches/server/incremental-chunk-and-player-saving.patch similarity index 98% rename from patches/unapplied/server/incremental-chunk-and-player-saving.patch rename to patches/server/incremental-chunk-and-player-saving.patch index 07ce138b95..f6c1779d91 100644 --- a/patches/unapplied/server/incremental-chunk-and-player-saving.patch +++ b/patches/server/incremental-chunk-and-player-saving.patch @@ -112,8 +112,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) { - // Paper start - rewrite chunk system - add close param - this.save(progressListener, flush, savingDisabled, false); + ServerChunkCache chunkproviderserver = this.getChunkSource(); + diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java