diff options
120 files changed, 420 insertions, 563 deletions
diff --git a/patches/server/0023-Timings-v2.patch b/patches/server/0023-Timings-v2.patch index c4e61abb06..2072bc98e1 100644 --- a/patches/server/0023-Timings-v2.patch +++ b/patches/server/0023-Timings-v2.patch @@ -878,23 +878,18 @@ index 5a4cdbc4b92a48c614564e4e421f05a9eb5b072b..d76dae9ce9022308b316080ac48b7030 this.profiler.popPush("send chunks"); iterator = this.playerList.getPlayers().iterator(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..1f8e693673f2579c9f2ca890e56074772377f5f4 100644 +index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..ddf07cb09b97a8e781739991040816eb5e59c607 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -65,10 +65,11 @@ import org.apache.logging.log4j.Level; +@@ -65,7 +65,6 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.io.IoBuilder; import org.bukkit.command.CommandSender; -import org.bukkit.craftbukkit.SpigotTimings; // Spigot -+import co.aikar.timings.MinecraftTimings; // Paper import org.bukkit.craftbukkit.util.TerminalCompletionHandler; import org.bukkit.craftbukkit.util.TerminalConsoleWriterThread; import org.bukkit.event.server.ServerCommandEvent; -+import org.bukkit.craftbukkit.util.Waitable; // Paper - import org.bukkit.event.server.RemoteServerCommandEvent; - // CraftBukkit end - -@@ -439,7 +440,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -439,7 +438,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } public void handleConsoleInputs() { @@ -902,7 +897,7 @@ index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..1f8e693673f2579c9f2ca890e5607477 while (!this.consoleInput.isEmpty()) { ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0); -@@ -454,7 +454,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -454,7 +452,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // CraftBukkit end } @@ -910,21 +905,6 @@ index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..1f8e693673f2579c9f2ca890e5607477 } @Override -diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 449608e60f3900778247101581ff598f1637499b..f774aacc6cae7fb893756b4af02f5b2fa797d850 100644 ---- a/src/main/java/net/minecraft/server/level/ChunkMap.java -+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1,8 +1,10 @@ - package net.minecraft.server.level; - -+import co.aikar.timings.Timing; // Paper - import com.google.common.collect.ImmutableList; - import com.google.common.collect.ImmutableList.Builder; - import com.google.common.collect.Iterables; -+import com.google.common.collect.ComparisonChain; // Paper - import com.google.common.collect.Lists; - import com.google.common.collect.Queues; - import com.google.common.collect.Sets; diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java index cf94dd9ddcc1eabcf3fd336e70720f4ed3e52175..e48452401358996ff558a4788ebee51a1ec3ea13 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -968,19 +948,10 @@ index cf94dd9ddcc1eabcf3fd336e70720f4ed3e52175..e48452401358996ff558a4788ebee51a } } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4c39d9e0466240b5cd459ee649a22fe3a72bf9f0..eb98bb1bd76869fd76b34885223c8e57a04e0c51 100644 +index 4c39d9e0466240b5cd459ee649a22fe3a72bf9f0..b8b7db1d067c657a6412e376f804947c015dde6c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1,6 +1,8 @@ - package net.minecraft.server.level; - - import com.google.common.annotations.VisibleForTesting; -+import co.aikar.timings.TimingHistory; // Paper -+import co.aikar.timings.Timings; // Paper - import com.google.common.collect.Lists; - import com.mojang.datafixers.DataFixer; - import com.mojang.datafixers.util.Pair; -@@ -173,7 +175,6 @@ import net.minecraft.world.ticks.LevelTicks; +@@ -173,7 +173,6 @@ import net.minecraft.world.ticks.LevelTicks; import org.slf4j.Logger; import org.bukkit.Bukkit; import org.bukkit.WeatherType; @@ -988,106 +959,40 @@ index 4c39d9e0466240b5cd459ee649a22fe3a72bf9f0..eb98bb1bd76869fd76b34885223c8e57 import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; import org.bukkit.craftbukkit.util.WorldUUID; -@@ -478,7 +479,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -478,7 +477,6 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.popPush("tickPending"); - this.timings.doTickPending.startTiming(); // Spigot -+ this.timings.scheduledBlocks.startTiming(); // Paper if (!this.isDebug() && flag) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); -@@ -487,15 +488,19 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -487,7 +485,6 @@ public class ServerLevel extends Level implements WorldGenLevel { this.fluidTicks.tick(j, 65536, this::tickFluid); gameprofilerfiller.pop(); } - this.timings.doTickPending.stopTiming(); // Spigot -+ this.timings.scheduledBlocks.stopTiming(); // Paper gameprofilerfiller.popPush("raid"); if (flag) { -+ this.timings.raids.startTiming(); // Paper - timings - this.raids.tick(); -+ this.timings.raids.stopTiming(); // Paper - timings - } - - gameprofilerfiller.popPush("chunkSource"); -+ this.timings.chunkProviderTick.startTiming(); // Paper - timings - this.getChunkSource().tick(shouldKeepTicking, true); -+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings - gameprofilerfiller.popPush("blockEvents"); - if (flag) { - this.timings.doSounds.startTiming(); // Spigot -@@ -648,6 +653,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - } - - gameprofilerfiller.popPush("tickBlocks"); -+ timings.chunkTicksBlocks.startTiming(); // Paper - if (randomTickSpeed > 0) { - LevelChunkSection[] achunksection = chunk.getSections(); - -@@ -680,6 +686,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - } - } - -+ timings.chunkTicksBlocks.stopTiming(); // Paper - gameprofilerfiller.pop(); - } - -@@ -956,14 +963,22 @@ public class ServerLevel extends Level implements WorldGenLevel { - } - - public void tickNonPassenger(Entity entity) { -+ ++TimingHistory.entityTicks; // Paper - timings - // Spigot start -+ co.aikar.timings.Timing timer; // Paper - if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { - entity.tickCount++; -+ timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings - entity.inactiveTick(); -+ } finally { timer.stopTiming(); } // Paper +@@ -963,7 +960,6 @@ public class ServerLevel extends Level implements WorldGenLevel { return; } // Spigot end - entity.tickTimer.startTiming(); // Spigot -+ // Paper start- timings -+ TimingHistory.activatedEntityTicks++; -+ timer = entity.getVehicle() != null ? entity.getType().passengerTickTimer.startTiming() : entity.getType().tickTimer.startTiming(); -+ try { -+ // Paper end - timings entity.setOldPosAndRot(); ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -982,7 +997,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -982,7 +978,6 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(entity, entity1); } - entity.tickTimer.stopTiming(); // Spigot -+ } finally { timer.stopTiming(); } // Paper - timings } -@@ -1024,6 +1039,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - - if (!savingDisabled) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit -+ try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper - if (progressListener != null) { - progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); - } -@@ -1033,7 +1049,10 @@ public class ServerLevel extends Level implements WorldGenLevel { - progressListener.progressStage(Component.translatable("menu.savingChunks")); - } - -+ timings.worldSaveChunks.startTiming(); // Paper - chunkproviderserver.save(flush); -+ timings.worldSaveChunks.stopTiming(); // Paper -+ }// Paper - if (flush) { - this.entityManager.saveAll(); - } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 556d8f23ee2de77cea71abcc0e56718e60b20b05..47e1640cafc8087d94d0b88b8b3117591f9f238e 100644 +index 556d8f23ee2de77cea71abcc0e56718e60b20b05..eee2d397b1de010552e5d194a7896598d63ec4a6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -330,7 +330,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1106,54 +1011,40 @@ index 556d8f23ee2de77cea71abcc0e56718e60b20b05..47e1640cafc8087d94d0b88b8b311759 } -@@ -2103,7 +2101,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2103,7 +2101,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } private void handleCommand(String s) { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot -+ co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2113,7 +2111,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2113,7 +2110,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot -+ co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper return; } -@@ -2126,7 +2124,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2125,8 +2121,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command"); java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; - } finally { +- } finally { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot -+ co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper } } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9dcfcea63f57f45a5584bb80c34fe445d65849e8..765c412cd0c5cd410c224b4bc55dbf431fd6617b 100644 +index 9dcfcea63f57f45a5584bb80c34fe445d65849e8..0166d594cb8b4aeabc1fcdb850cd3305216b680a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1,5 +1,6 @@ - package net.minecraft.server.players; - -+import co.aikar.timings.MinecraftTimings; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.google.common.collect.Sets; -@@ -1007,10 +1008,11 @@ public abstract class PlayerList { - } - - public void saveAll() { -+ MinecraftTimings.savePlayers.startTiming(); // Paper +@@ -1010,7 +1010,6 @@ public abstract class PlayerList { for (int i = 0; i < this.players.size(); ++i) { this.save((ServerPlayer) this.players.get(i)); } - -+ MinecraftTimings.savePlayers.stopTiming(); // Paper } public UserWhiteList getWhiteList() { diff --git a/patches/server/0033-Expose-server-build-information.patch b/patches/server/0033-Expose-server-build-information.patch index 2a0bceab6c..3e4432759c 100644 --- a/patches/server/0033-Expose-server-build-information.patch +++ b/patches/server/0033-Expose-server-build-information.patch @@ -563,10 +563,10 @@ index e9d56d75b7c648f04d3a56942b2866090c570129..57ec168bac3727feb734e28cebc68032 public SystemReport fillSystemReport(SystemReport details) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index b51c3f8c485496734ea58c15377a1215a334c765..48107f8eb50483430053b990496862d71c9f8a3e 100644 +index ddf07cb09b97a8e781739991040816eb5e59c607..6e68ae77f519b229743e1c44a1efa9a0c1cbc6ee 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -218,6 +218,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -216,6 +216,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // Paper end - initialize global and world-defaults configuration io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics diff --git a/patches/server/0036-Entity-Origin-API.patch b/patches/server/0036-Entity-Origin-API.patch index eaf335d0d3..b391dff1e4 100644 --- a/patches/server/0036-Entity-Origin-API.patch +++ b/patches/server/0036-Entity-Origin-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index eb98bb1bd76869fd76b34885223c8e57a04e0c51..754045e71f180862fa57fd1c97e5d7deb1d788e6 100644 +index b8b7db1d067c657a6412e376f804947c015dde6c..5a16de470423bc89e5fc59fcce70892726726c88 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2141,6 +2141,15 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2117,6 +2117,15 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.valid = true; // CraftBukkit @@ -25,7 +25,7 @@ index eb98bb1bd76869fd76b34885223c8e57a04e0c51..754045e71f180862fa57fd1c97e5d7de public void onTrackingEnd(Entity entity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 63f45a77c8511e05954030cf117c5e4cda0a518f..dbe5239b1a1769ef9f2ef66c32b1a68cd684428e 100644 +index 0a3ed94165430774c7037e78fd7bffc205c6f72f..66df9b75349b2fb20a13c12392d4771603521291 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -328,7 +328,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0045-Disable-thunder.patch b/patches/server/0045-Disable-thunder.patch index de88451538..b3a0d6e355 100644 --- a/patches/server/0045-Disable-thunder.patch +++ b/patches/server/0045-Disable-thunder.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable thunder diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 754045e71f180862fa57fd1c97e5d7deb1d788e6..aca595551c90d5515309c9c82ad6ffcfa1d680c8 100644 +index 5a16de470423bc89e5fc59fcce70892726726c88..71d988f5976d3dfee7889ccb14052ed9b71e00d4 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -616,7 +616,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -608,7 +608,7 @@ public class ServerLevel extends Level implements WorldGenLevel { ProfilerFiller gameprofilerfiller = this.getProfiler(); gameprofilerfiller.push("thunder"); diff --git a/patches/server/0046-Disable-ice-and-snow.patch b/patches/server/0046-Disable-ice-and-snow.patch index ae60e5cb8c..1566e4266f 100644 --- a/patches/server/0046-Disable-ice-and-snow.patch +++ b/patches/server/0046-Disable-ice-and-snow.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable ice and snow diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index aca595551c90d5515309c9c82ad6ffcfa1d680c8..6d89dc22e28a9c3557d9972be0935d75719e7f7d 100644 +index 71d988f5976d3dfee7889ccb14052ed9b71e00d4..502089e5ad5cbdfc3d6450dcb62595b6feb95891 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -646,11 +646,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -638,11 +638,13 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.popPush("iceandsnow"); @@ -21,4 +21,4 @@ index aca595551c90d5515309c9c82ad6ffcfa1d680c8..6d89dc22e28a9c3557d9972be0935d75 + } // Paper - Option to disable ice and snow gameprofilerfiller.popPush("tickBlocks"); - timings.chunkTicksBlocks.startTiming(); // Paper + if (randomTickSpeed > 0) { diff --git a/patches/server/0053-Fix-spawn-location-event-changing-location.patch b/patches/server/0053-Fix-spawn-location-event-changing-location.patch index e9256b2783..fc62bdeb02 100644 --- a/patches/server/0053-Fix-spawn-location-event-changing-location.patch +++ b/patches/server/0053-Fix-spawn-location-event-changing-location.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Fix spawn location event changing location public net.minecraft.world.entity.Entity setRot(FF)V diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 765c412cd0c5cd410c224b4bc55dbf431fd6617b..8a91a44e46a2d49e2f4b9e9970c2b77f2e87767e 100644 +index 0166d594cb8b4aeabc1fcdb850cd3305216b680a..d12b75f0080a763799fd77b1a35a4ee7779cf4e5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -234,7 +234,10 @@ public abstract class PlayerList { +@@ -233,7 +233,10 @@ public abstract class PlayerList { player.spawnIn(worldserver1); player.gameMode.setLevel((ServerLevel) player.level()); diff --git a/patches/server/0055-Improve-Player-chat-API-handling.patch b/patches/server/0055-Improve-Player-chat-API-handling.patch index e91ed39415..591c124700 100644 --- a/patches/server/0055-Improve-Player-chat-API-handling.patch +++ b/patches/server/0055-Improve-Player-chat-API-handling.patch @@ -17,7 +17,7 @@ Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: SoSeDiK <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 47e1640cafc8087d94d0b88b8b3117591f9f238e..64db7e017b41bffcaac202ee4ecfd7df46d69331 100644 +index eee2d397b1de010552e5d194a7896598d63ec4a6..7b9e613d68f5765207bc60aa9b82bfc8e9da49bf 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2013,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -36,9 +36,9 @@ index 47e1640cafc8087d94d0b88b8b3117591f9f238e..64db7e017b41bffcaac202ee4ecfd7df - private void handleCommand(String s) { + public void handleCommand(String s) { // Paper - private -> public + org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher - co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); + diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 2a36e562967ec6174efe456e489c50ca10ba47e5..b0371c51645da361b63dea02bf7633ae6191560f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch index 5d75479206..81b7bb57fe 100644 --- a/patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch +++ b/patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable spawn chances for skeleton horses diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6d89dc22e28a9c3557d9972be0935d75719e7f7d..de1708e5d39561115d2825eea4a5f6e1f1f4e5b8 100644 +index 502089e5ad5cbdfc3d6450dcb62595b6feb95891..2e53c7466215564634294c72334d556506858e7f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -621,7 +621,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -613,7 +613,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (this.isRainingAt(blockposition)) { DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); diff --git a/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index ed44e0fd8c..9a53698b1f 100644 --- a/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -18,10 +18,10 @@ index 4f1204661e345462c08cc66e3a8851033f186268..a37f11633663e07652274707b29a849e this.profiler.push(() -> { String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index de1708e5d39561115d2825eea4a5f6e1f1f4e5b8..1e5b42fc3903b14537d232c8adbbaf79078d8d8e 100644 +index 2e53c7466215564634294c72334d556506858e7f..a2528b9b4ebcfc39c3127581bafb01e0dd2eca4e 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -227,6 +227,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -225,6 +225,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // CraftBukkit start public final LevelStorageSource.LevelStorageAccess convertable; public final UUID uuid; @@ -30,7 +30,7 @@ index de1708e5d39561115d2825eea4a5f6e1f1f4e5b8..1e5b42fc3903b14537d232c8adbbaf79 public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index eae1d6eedeed09b3f49913c2bb205b80442bbfe3..622ecc1aeb9140d5c0d181fa472d123c42e5c5f4 100644 +index dfb349ed8a0fb981b3234baf040bd3297a555ebf..024da1029baecae639d7c05b5f7c30dbaa67b006 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -491,7 +491,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch index 83aad502c3..0ff2a589d8 100644 --- a/patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1e5b42fc3903b14537d232c8adbbaf79078d8d8e..e6cf145fa7a2968c70e9e467e3927fd38e199e06 100644 +index a2528b9b4ebcfc39c3127581bafb01e0dd2eca4e..12268a0691c0af96e4815f79949582c3491a23b6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2153,6 +2153,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2129,6 +2129,7 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.setOrigin(entity.getOriginVector().toLocation(getWorld())); } // Paper end - Entity origin API @@ -16,7 +16,7 @@ index 1e5b42fc3903b14537d232c8adbbaf79078d8d8e..e6cf145fa7a2968c70e9e467e3927fd3 } public void onTrackingEnd(Entity entity) { -@@ -2223,6 +2224,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2199,6 +2200,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } // CraftBukkit end diff --git a/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch index fd354e6963..02aa7f79ff 100644 --- a/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch @@ -28,10 +28,10 @@ index 1e9c68cd1868d083e6a790d56006dd4aa432010a..8a0ee9564fc36a2badf1357f7e6c47b5 + // Paper end - PlayerUseUnknownEntityEvent } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 64db7e017b41bffcaac202ee4ecfd7df46d69331..14a821bfc6b20475889d3138b8da9e6bfaf1787c 100644 +index 7b9e613d68f5765207bc60aa9b82bfc8e9da49bf..6763ac2a23fd961012fb0e450f1a46c4e036fe11 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2493,7 +2493,26 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2489,7 +2489,26 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl }); } } diff --git a/patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index ab40c40da1..9cb8910a3f 100644 --- a/patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e6cf145fa7a2968c70e9e467e3927fd38e199e06..223f8d9be5d73e296f5815db7123b95c3b345162 100644 +index 12268a0691c0af96e4815f79949582c3491a23b6..ae8b81a51050fbba75a0e71afc838f86a0eee583 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1389,6 +1389,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1365,6 +1365,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void updateNeighborsAt(BlockPos pos, Block sourceBlock) { diff --git a/patches/server/0088-Configurable-Player-Collision.patch b/patches/server/0088-Configurable-Player-Collision.patch index 719e6bb654..f0ececd06f 100644 --- a/patches/server/0088-Configurable-Player-Collision.patch +++ b/patches/server/0088-Configurable-Player-Collision.patch @@ -43,10 +43,10 @@ index a37f11633663e07652274707b29a849e518511c5..6dec7884fdd15eb8f32e8831ed0f3a92 if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8a91a44e46a2d49e2f4b9e9970c2b77f2e87767e..98862db2334508ee1a783aeabfb146751552a4d9 100644 +index d12b75f0080a763799fd77b1a35a4ee7779cf4e5..e88426555ee112104e51f60cfd2002409e78d5ce 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -159,6 +159,7 @@ public abstract class PlayerList { +@@ -158,6 +158,7 @@ public abstract class PlayerList { // CraftBukkit start private CraftServer cserver; private final Map<String,ServerPlayer> playersByName = new java.util.HashMap<>(); @@ -54,7 +54,7 @@ index 8a91a44e46a2d49e2f4b9e9970c2b77f2e87767e..98862db2334508ee1a783aeabfb14675 public PlayerList(MinecraftServer server, LayeredRegistryAccess<RegistryLayer> registryManager, PlayerDataStorage saveHandler, int maxPlayers) { this.cserver = server.server = new CraftServer((DedicatedServer) server, this); -@@ -390,6 +391,13 @@ public abstract class PlayerList { +@@ -389,6 +390,13 @@ public abstract class PlayerList { player.initInventoryMenu(); // CraftBukkit - Moved from above, added world @@ -68,7 +68,7 @@ index 8a91a44e46a2d49e2f4b9e9970c2b77f2e87767e..98862db2334508ee1a783aeabfb14675 PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); } -@@ -512,6 +520,16 @@ public abstract class PlayerList { +@@ -511,6 +519,16 @@ public abstract class PlayerList { entityplayer.doTick(); // SPIGOT-924 // CraftBukkit end @@ -85,7 +85,7 @@ index 8a91a44e46a2d49e2f4b9e9970c2b77f2e87767e..98862db2334508ee1a783aeabfb14675 this.save(entityplayer); if (entityplayer.isPassenger()) { Entity entity = entityplayer.getRootVehicle(); -@@ -1129,6 +1147,13 @@ public abstract class PlayerList { +@@ -1126,6 +1144,13 @@ public abstract class PlayerList { } // CraftBukkit end diff --git a/patches/server/0097-Async-GameProfileCache-saving.patch b/patches/server/0097-Async-GameProfileCache-saving.patch index b352f836bd..4ca853953a 100644 --- a/patches/server/0097-Async-GameProfileCache-saving.patch +++ b/patches/server/0097-Async-GameProfileCache-saving.patch @@ -18,10 +18,10 @@ index d8f2fe077e35fd6c70e0ba50945006819f50586f..d566d64c6c3bd97ac4b4f80bdf1b1bd5 // Spigot end diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 48107f8eb50483430053b990496862d71c9f8a3e..c1f41dcf49c75c3d69485c0e1ec821205438ed1e 100644 +index 6e68ae77f519b229743e1c44a1efa9a0c1cbc6ee..e75559e2f07f24a3a4298f90400f1d6d4f9a2537 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -270,7 +270,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -268,7 +268,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } if (this.convertOldUsers()) { diff --git a/patches/server/0101-Fix-global-sound-handling.patch b/patches/server/0101-Fix-global-sound-handling.patch index 8f4acbadad..ca6b3a7a68 100644 --- a/patches/server/0101-Fix-global-sound-handling.patch +++ b/patches/server/0101-Fix-global-sound-handling.patch @@ -11,10 +11,10 @@ Co-authored-by: lexikiq <[email protected]> Co-authored-by: Aikar <[email protected]> diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 223f8d9be5d73e296f5815db7123b95c3b345162..d728afbe1d6882f1ace4ead9d87f4b7d2af43ba2 100644 +index ae8b81a51050fbba75a0e71afc838f86a0eee583..198a35cad942e4677c5abf3093b7f0ef58754755 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1322,7 +1322,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1298,7 +1298,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void levelEvent(@Nullable Player player, int eventId, BlockPos pos, int data) { diff --git a/patches/server/0104-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0104-Add-setting-for-proxy-online-mode-status.patch index c5db028545..b588aa2299 100644 --- a/patches/server/0104-Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/0104-Add-setting-for-proxy-online-mode-status.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add setting for proxy online mode status TODO: Add isProxyOnlineMode check to Metrics diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index b7e664a4319c3f0062b0afea38d852b25e19aacd..39533954a361529878cf62db382604d7fb4998d8 100644 +index e75559e2f07f24a3a4298f90400f1d6d4f9a2537..d5aa5415b561b2102a0f7ca3cd8d6a5e93355dfb 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -591,7 +591,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -589,7 +589,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface public boolean enforceSecureProfile() { DedicatedServerProperties dedicatedserverproperties = this.getProperties(); diff --git a/patches/server/0124-Enforce-Sync-Player-Saves.patch b/patches/server/0124-Enforce-Sync-Player-Saves.patch index 5211b4bc78..454427cf9e 100644 --- a/patches/server/0124-Enforce-Sync-Player-Saves.patch +++ b/patches/server/0124-Enforce-Sync-Player-Saves.patch @@ -7,20 +7,18 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 98862db2334508ee1a783aeabfb146751552a4d9..e17f4f3882ae77a67e8bfad04646f02c2bbb6669 100644 +index e88426555ee112104e51f60cfd2002409e78d5ce..3ae821761c602344b7853150a00c3e0fa00691d1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1029,11 +1029,13 @@ public abstract class PlayerList { +@@ -1028,9 +1028,11 @@ public abstract class PlayerList { } public void saveAll() { + io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main - MinecraftTimings.savePlayers.startTiming(); // Paper for (int i = 0; i < this.players.size(); ++i) { - this.save((ServerPlayer) this.players.get(i)); + this.save(this.players.get(i)); } - MinecraftTimings.savePlayers.stopTiming(); // Paper + return null; }); // Paper - ensure main } diff --git a/patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch index 602cf5d4bb..0abbbea392 100644 --- a/patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch @@ -64,10 +64,10 @@ index d566d64c6c3bd97ac4b4f80bdf1b1bd5a381ef55..e464349a46eab23eb5b8d4d31f577d78 if (waitForShutdown) { try { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index e17f4f3882ae77a67e8bfad04646f02c2bbb6669..d5f17d7e3b56ca87ec9070b69265ce098de61f69 100644 +index 3ae821761c602344b7853150a00c3e0fa00691d1..2e5c759a8c5e77f93f4b1fea4dbe9fc4fc7fe467 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1143,8 +1143,15 @@ public abstract class PlayerList { +@@ -1140,8 +1140,15 @@ public abstract class PlayerList { } public void removeAll() { diff --git a/patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 20b540764e..a34c40d7e4 100644 --- a/patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -14,10 +14,10 @@ To be converted into a Paper-API event at some point in the future? public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 34aeb823950fac8eaef3f38b302c1585a45f7498..44cc60d92c6e83ecfa2c232b59986968d0161672 100644 +index fbdd5b0169d7e05ea9500ead67285c24ea373d37..461d475d97da76591eaa8fb1c7fca528cbb69442 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2259,6 +2259,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2255,6 +2255,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl switch (packet.getAction()) { case PRESS_SHIFT_KEY: this.player.setShiftKeyDown(true); diff --git a/patches/server/0145-ProfileWhitelistVerifyEvent.patch b/patches/server/0145-ProfileWhitelistVerifyEvent.patch index 69af001b9f..b2a7c7aea4 100644 --- a/patches/server/0145-ProfileWhitelistVerifyEvent.patch +++ b/patches/server/0145-ProfileWhitelistVerifyEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d5f17d7e3b56ca87ec9070b69265ce098de61f69..768a5c6ebc4466aae4108a79e1564b2bfc93463a 100644 +index 2e5c759a8c5e77f93f4b1fea4dbe9fc4fc7fe467..73b36f044ae7d6294a623df7620a1f7a016455f9 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -624,9 +624,9 @@ public abstract class PlayerList { +@@ -623,9 +623,9 @@ public abstract class PlayerList { // return chatmessage; event.disallow(PlayerLoginEvent.Result.KICK_BANNED, io.papermc.paper.adventure.PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure @@ -21,7 +21,7 @@ index d5f17d7e3b56ca87ec9070b69265ce098de61f69..768a5c6ebc4466aae4108a79e1564b2b } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); -@@ -993,7 +993,24 @@ public abstract class PlayerList { +@@ -992,7 +992,24 @@ public abstract class PlayerList { } public boolean isWhiteListed(GameProfile profile) { diff --git a/patches/server/0164-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0164-PlayerNaturallySpawnCreaturesEvent.patch index 559b77e7a0..516b544fe4 100644 --- a/patches/server/0164-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0164-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,10 +9,10 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index f774aacc6cae7fb893756b4af02f5b2fa797d850..e0aa654e8034c21a057140097a34a8b42681b097 100644 +index 449608e60f3900778247101581ff598f1637499b..66260a49dce714be2226f5205247137c7df7f052 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1037,7 +1037,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1035,7 +1035,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider chunkRange = (chunkRange > this.level.spigotConfig.viewDistance) ? (byte) this.level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange; @@ -23,7 +23,7 @@ index f774aacc6cae7fb893756b4af02f5b2fa797d850..e0aa654e8034c21a057140097a34a8b4 // Spigot end if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) { return false; -@@ -1052,6 +1054,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1050,6 +1052,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } entityplayer = (ServerPlayer) iterator.next(); diff --git a/patches/server/0176-Player.setPlayerProfile-API.patch b/patches/server/0176-Player.setPlayerProfile-API.patch index d847c9d191..216bcf61aa 100644 --- a/patches/server/0176-Player.setPlayerProfile-API.patch +++ b/patches/server/0176-Player.setPlayerProfile-API.patch @@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in. public-f net.minecraft.world.entity.player.Player gameProfile diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ec80a9138260497d0deccf3ade3f44fc849de1d5..72edfb965aca81c2d2442b794b42baa04ec713b3 100644 +index d64c3e66340d005e04ad99282c7ec4d731b9d919..4d3855749cc49414a3077005fd161bc04b018106 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1472,7 +1472,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -40,10 +40,10 @@ index 2d9db1ac80216a509a7590254e422b3c4792e3ec..b31f00f2f0b7cec59301afe36c9dd7cd playerName = gameprofile.getName(); uniqueId = gameprofile.getId(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 768a5c6ebc4466aae4108a79e1564b2bfc93463a..26cee48ea3650aaf87fd2ba9c70d4ca9a88e2d87 100644 +index 73b36f044ae7d6294a623df7620a1f7a016455f9..c4d083a970417e5052a80abd7bdebc2b8c119dd2 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -831,10 +831,16 @@ public abstract class PlayerList { +@@ -830,10 +830,16 @@ public abstract class PlayerList { } public void sendPlayerPermissionLevel(ServerPlayer player) { diff --git a/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch b/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch index c538b3c38a..c4d866a748 100644 --- a/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch +++ b/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch @@ -16,10 +16,10 @@ public net.minecraft.world.entity.projectile.Projectile cachedOwner public net.minecraft.world.entity.projectile.Projectile ownerUUID diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d728afbe1d6882f1ace4ead9d87f4b7d2af43ba2..7c6b094de5e29cb2663e8a7072a27d7adbceb4b2 100644 +index 198a35cad942e4677c5abf3093b7f0ef58754755..90fcaaa50aa75bb51b0ea49e69f5e4954f25681f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2111,6 +2111,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2087,6 +2087,12 @@ public class ServerLevel extends Level implements WorldGenLevel { public void onTickingEnd(Entity entity) { ServerLevel.this.entityTickList.remove(entity); diff --git a/patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch index d98048d69b..6326f58971 100644 --- a/patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 7c6b094de5e29cb2663e8a7072a27d7adbceb4b2..1fac100819e59d00f50e530d3a4157b56d966dba 100644 +index 90fcaaa50aa75bb51b0ea49e69f5e4954f25681f..70768c59ed939f7a157a9b152085a2c158c215a9 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1508,12 +1508,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1484,12 +1484,17 @@ public class ServerLevel extends Level implements WorldGenLevel { } public <T extends ParticleOptions> int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { diff --git a/patches/server/0208-InventoryCloseEvent-Reason-API.patch b/patches/server/0208-InventoryCloseEvent-Reason-API.patch index 02104aa8f1..d507ba6545 100644 --- a/patches/server/0208-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0208-InventoryCloseEvent-Reason-API.patch @@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1fac100819e59d00f50e530d3a4157b56d966dba..4f777c9d8c3052f68bc0465c8a7386b8fb486c83 100644 +index 70768c59ed939f7a157a9b152085a2c158c215a9..2f8c85cdcab370bd4247018b1a3f3b73bc99f7d7 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1239,7 +1239,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1215,7 +1215,7 @@ public class ServerLevel extends Level implements WorldGenLevel { for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) { if (tileentity instanceof net.minecraft.world.Container) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((net.minecraft.world.Container) tileentity).getViewers())) { @@ -19,7 +19,7 @@ index 1fac100819e59d00f50e530d3a4157b56d966dba..4f777c9d8c3052f68bc0465c8a7386b8 } } } -@@ -2196,7 +2196,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2172,7 +2172,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) { @@ -75,10 +75,10 @@ index db72318d822b876eb937f0f0f7f2b2139fb77df7..a3a1450949703851625bbb257e92b3be this.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 72edfb965aca81c2d2442b794b42baa04ec713b3..a954d3b0ff0917d857002dba70c54b3fcdf77943 100644 +index 4d3855749cc49414a3077005fd161bc04b018106..88b643bb0b46d9aec86863ace8a5311b8efad2de 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2619,10 +2619,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2615,10 +2615,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleContainerClose(ServerboundContainerClosePacket packet) { @@ -96,10 +96,10 @@ index 72edfb965aca81c2d2442b794b42baa04ec713b3..a954d3b0ff0917d857002dba70c54b3f this.player.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9019e25f61d4fdb7c5d12ea7630b0bc23827ab6e..38cf3cf1cc7ebae4b6ca8a89dc026b5b4f0b4c2b 100644 +index c4d083a970417e5052a80abd7bdebc2b8c119dd2..adbab61f924e03ea9dd5334d1fae1790e07a350c 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -510,7 +510,7 @@ public abstract class PlayerList { +@@ -509,7 +509,7 @@ public abstract class PlayerList { // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it // See SPIGOT-5799, SPIGOT-6145 if (entityplayer.containerMenu != entityplayer.inventoryMenu) { diff --git a/patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch index ebc80323b4..6272f75e1a 100644 --- a/patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a954d3b0ff0917d857002dba70c54b3fcdf77943..087e87976d738426db9a850926463900b0c1e8ca 100644 +index 88b643bb0b46d9aec86863ace8a5311b8efad2de..5fa185c257edad5fc45117c90f0dd0a6b616fd2d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2496,6 +2496,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2492,6 +2492,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (event.isCancelled()) { diff --git a/patches/server/0226-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0226-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index d4b941e99f..300ba888e0 100644 --- a/patches/server/0226-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/patches/server/0226-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 63bcd7698fdb86366441dacedbb616771f6b1a3d..a58a68220e077ce23c20cf61d63f51183df1dfc9 100644 +index 66260a49dce714be2226f5205247137c7df7f052..8c64ea9f10902a6cd2a82c0e45786e1901d3d4ff 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1254,6 +1254,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1252,6 +1252,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas()); @@ -16,7 +16,7 @@ index 63bcd7698fdb86366441dacedbb616771f6b1a3d..a58a68220e077ce23c20cf61d63f5118 this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); playerchunkmap_entitytracker.updatePlayers(this.level.players()); if (entity instanceof ServerPlayer) { -@@ -1294,7 +1295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1292,7 +1293,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (playerchunkmap_entitytracker1 != null) { playerchunkmap_entitytracker1.broadcastRemoved(); } @@ -26,10 +26,10 @@ index 63bcd7698fdb86366441dacedbb616771f6b1a3d..a58a68220e077ce23c20cf61d63f5118 protected void tick() { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4f777c9d8c3052f68bc0465c8a7386b8fb486c83..e9d08662c065d04a67918f0aa2cd4fde5798f2a6 100644 +index 2f8c85cdcab370bd4247018b1a3f3b73bc99f7d7..db8596ebc38ea16f26df335b83002be18b4f36a0 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1201,6 +1201,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1177,6 +1177,12 @@ public class ServerLevel extends Level implements WorldGenLevel { // CraftBukkit start private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -43,7 +43,7 @@ index 4f777c9d8c3052f68bc0465c8a7386b8fb486c83..e9d08662c065d04a67918f0aa2cd4fde // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f431c5a17bfc3bdf2a464470af4ec5e226b0d13e..131eda47e7a9f90a4057607870acbcb8fecfbf0b 100644 +index 7fd1a75ba0068ee3ca6c29a550a9a1b33c5cacc5..d4b1122fcf9c35f492764d0a7b8b4c41e46aa90a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -250,6 +250,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch index 6165e2a51e..581ac6abc7 100644 --- a/patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch @@ -21,10 +21,10 @@ index 7f4c9ba88c2d33c2cc23e406a616f9eb35d738ce..5d429b707383e6620a0d83f23d7a8694 // Paper start - further improve server tick loop long tickSection = Util.getNanos(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index c466ec011d059b9960606ef2ee51ea3a3a65f8d0..baf93b5d5883d0a5c360f1a475949804b7907636 100644 +index d5aa5415b561b2102a0f7ca3cd8d6a5e93355dfb..67dfd019a39287930bea2ff992f9c684dacffb3b 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -216,6 +216,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -214,6 +214,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Paper end - initialize global and world-defaults configuration diff --git a/patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch index 06ff8bd2a0..c20eebac10 100644 --- a/patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch +++ b/patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch @@ -23,10 +23,10 @@ Modified isEmpty to use the isEmpty() method instead of the slightly confusing s The point of this is readability, but does have a side-benefit of a small microptimization diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 38cf3cf1cc7ebae4b6ca8a89dc026b5b4f0b4c2b..c5ca2d8feed71cdd4dce851941654768c1e5d648 100644 +index adbab61f924e03ea9dd5334d1fae1790e07a350c..44ac8d893ee2e18900f00747fd8391b3de7aca70 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -627,7 +627,7 @@ public abstract class PlayerList { +@@ -626,7 +626,7 @@ public abstract class PlayerList { } else if (!this.isWhiteListed(gameprofile, event)) { // Paper - ProfileWhitelistVerifyEvent //ichatmutablecomponent = Component.translatable("multiplayer.disconnect.not_whitelisted"); // Paper //event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure - moved to isWhitelisted diff --git a/patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch b/patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch index e4a25f162a..e3c0b27a28 100644 --- a/patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch +++ b/patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 4a5c2e7543ece634bd42f6557882004bddc3bbff..77d903d6c91794969c3238bafbedd5bf9a9701a9 100644 +index 67dfd019a39287930bea2ff992f9c684dacffb3b..ef6324dbb7e311ac16c64f937dee64c777f4b54e 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -78,7 +78,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -76,7 +76,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface static final Logger LOGGER = LogUtils.getLogger(); private static final int CONVERSION_RETRY_DELAY_MS = 5000; private static final int CONVERSION_RETRIES = 2; @@ -18,7 +18,7 @@ index 4a5c2e7543ece634bd42f6557882004bddc3bbff..77d903d6c91794969c3238bafbedd5bf @Nullable private QueryThreadGs4 queryThreadGs4; // private final RemoteControlCommandListener rconConsoleSource; // CraftBukkit - remove field -@@ -438,12 +438,14 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -436,12 +436,14 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } public void handleConsoleInput(String command, CommandSourceStack commandSource) { diff --git a/patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch index 325676c465..e0d232a652 100644 --- a/patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch @@ -28,10 +28,10 @@ index b4947ee9615b1b2108046b9ab87b65b53dbb23f6..dbdc6b4065acc363c128580fdffe9049 public boolean queueHealthUpdatePacket; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index c5ca2d8feed71cdd4dce851941654768c1e5d648..9e8938627bfd1c45a2546e221f819e20c483a9e2 100644 +index 44ac8d893ee2e18900f00747fd8391b3de7aca70..13c7d9256e2913e0d0906359eb9eedc1bb43a473 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -182,6 +182,7 @@ public abstract class PlayerList { +@@ -181,6 +181,7 @@ public abstract class PlayerList { public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) { player.isRealPlayer = true; // Paper diff --git a/patches/server/0279-Limit-Client-Sign-length-more.patch b/patches/server/0279-Limit-Client-Sign-length-more.patch index 20e898577a..51902ecf89 100644 --- a/patches/server/0279-Limit-Client-Sign-length-more.patch +++ b/patches/server/0279-Limit-Client-Sign-length-more.patch @@ -22,7 +22,7 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 29678ddb0cb53fae9ae497614690f9d855f9eb86..86cb92b7cf18272ee4b46c292ed4a7192119ce1a 100644 +index 12ce3d0e35bbdf8407c210925ea4edc1395651da..36604b777bb8a32374358af05b873beb4cd081b2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -299,6 +299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -33,7 +33,7 @@ index 29678ddb0cb53fae9ae497614690f9d855f9eb86..86cb92b7cf18272ee4b46c292ed4a719 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) { super(server, connection, clientData, player); // CraftBukkit -@@ -3151,7 +3152,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3147,7 +3148,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSignUpdate(ServerboundSignUpdatePacket packet) { diff --git a/patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index 9eceb9ab5a..cae0b89d9b 100644 --- a/patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cdd1d8222ad1796abd0858b9ed0e2ddc9be83c93..2f1d075b8dbcf173c51f3e6396ccbc61b64f75df 100644 +index 13c7d9256e2913e0d0906359eb9eedc1bb43a473..29512882bc53d7e364a6ce29a57876b51d45782a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1127,6 +1127,7 @@ public abstract class PlayerList { +@@ -1124,6 +1124,7 @@ public abstract class PlayerList { } public void setUsingWhiteList(boolean whitelistEnabled) { diff --git a/patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch b/patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch index e910254cef..8cccbe8e64 100644 --- a/patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch +++ b/patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch @@ -26,10 +26,10 @@ index bf72cf288ade52ee8cc41ca978f368b3ad575951..798999be50d26be357ef3c6d5b9383ce }); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e9d08662c065d04a67918f0aa2cd4fde5798f2a6..a6a21def1ae0d35fa106da6242c49a0928e4eda5 100644 +index db8596ebc38ea16f26df335b83002be18b4f36a0..6351a5560975803fb0b0e915493702f4a837660c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1207,6 +1207,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1183,6 +1183,7 @@ public class ServerLevel extends Level implements WorldGenLevel { return true; } // Paper end - extra debug info @@ -38,10 +38,10 @@ index e9d08662c065d04a67918f0aa2cd4fde5798f2a6..a6a21def1ae0d35fa106da6242c49a09 // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 00c43d7b846e97e2cc2105c93be5ce918fafd775..8f90e8cd36348089799097807ead774e186c2604 100644 +index 29512882bc53d7e364a6ce29a57876b51d45782a..018c5d1783f0384c460778a6014af946285e1274 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -223,6 +223,11 @@ public abstract class PlayerList { +@@ -222,6 +222,11 @@ public abstract class PlayerList { worldserver1 = worldserver; } @@ -53,7 +53,7 @@ index 00c43d7b846e97e2cc2105c93be5ce918fafd775..8f90e8cd36348089799097807ead774e player.setServerLevel(worldserver1); String s1 = connection.getLoggableAddress(this.server.logIPs()); -@@ -348,7 +353,7 @@ public abstract class PlayerList { +@@ -347,7 +352,7 @@ public abstract class PlayerList { CompoundTag nbttagcompound = ((CompoundTag) optional.get()).getCompound("RootVehicle"); ServerLevel finalWorldServer = worldserver1; // CraftBukkit - decompile error Entity entity = EntityType.loadEntityRecursive(nbttagcompound.getCompound("Entity"), worldserver1, (entity1) -> { @@ -63,7 +63,7 @@ index 00c43d7b846e97e2cc2105c93be5ce918fafd775..8f90e8cd36348089799097807ead774e if (entity != null) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2e376b0b2bf2d49ad0669b6e6fd287628a72ea64..869cd3723c6704e7512f4637682476b8af9f0264 100644 +index 026af10f7de0267c7335385fea53a823f3898e8b..80c4b60ddd68f2c9343d0f11db9e4242147915f1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -247,6 +247,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0283-Add-PlayerPostRespawnEvent.patch b/patches/server/0283-Add-PlayerPostRespawnEvent.patch index 2babd115c1..00fcbd81c2 100644 --- a/patches/server/0283-Add-PlayerPostRespawnEvent.patch +++ b/patches/server/0283-Add-PlayerPostRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a8b92e563 100644 +index 018c5d1783f0384c460778a6014af946285e1274..f1e932c987616c529ec3957b3f4070927c8c24c0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -738,6 +738,10 @@ public abstract class PlayerList { +@@ -737,6 +737,10 @@ public abstract class PlayerList { entityplayer1.addTag(s); } @@ -19,7 +19,7 @@ index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a // CraftBukkit start - fire PlayerRespawnEvent DimensionTransition dimensiontransition; -@@ -745,6 +749,7 @@ public abstract class PlayerList { +@@ -744,6 +748,7 @@ public abstract class PlayerList { dimensiontransition = entityplayer.findRespawnPositionAndUseSpawnBlock(flag, DimensionTransition.DO_NOTHING, reason); if (!flag) entityplayer.reset(); // SPIGOT-4785 @@ -27,7 +27,7 @@ index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a } else { dimensiontransition = new DimensionTransition(((CraftWorld) location.getWorld()).getHandle(), CraftLocation.toVec3D(location), Vec3.ZERO, location.getYaw(), location.getPitch(), DimensionTransition.DO_NOTHING); } -@@ -795,6 +800,11 @@ public abstract class PlayerList { +@@ -794,6 +799,11 @@ public abstract class PlayerList { if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) { entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F, worldserver.getRandom().nextLong())); } @@ -39,7 +39,7 @@ index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a } // Added from changeDimension this.sendAllPlayerInfo(entityplayer); // Update health, etc... -@@ -816,6 +826,13 @@ public abstract class PlayerList { +@@ -815,6 +825,13 @@ public abstract class PlayerList { if (entityplayer.connection.isDisconnected()) { this.save(entityplayer); } diff --git a/patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch b/patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch index 6ffcd9f3c3..4ec203f163 100644 --- a/patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch +++ b/patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimise EntityGetter#getPlayerByUUID Use the PlayerList map instead of iterating over all players diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a6a21def1ae0d35fa106da6242c49a0928e4eda5..c85d5b941b5cb1c37cd2619d419006c5956f6eaf 100644 +index 6351a5560975803fb0b0e915493702f4a837660c..1efc5554e422d4c4c4df3aae768920e06bfd6674 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -330,6 +330,15 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -328,6 +328,15 @@ public class ServerLevel extends Level implements WorldGenLevel { } // Paper end diff --git a/patches/server/0311-Tracking-Range-Improvements.patch b/patches/server/0311-Tracking-Range-Improvements.patch index 7061f0ec06..4755df9c8d 100644 --- a/patches/server/0311-Tracking-Range-Improvements.patch +++ b/patches/server/0311-Tracking-Range-Improvements.patch @@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code Also ignores Enderdragon, defaulting it to Mojang's setting diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ee8ccf6afef2b2c563ba4f55fa679c4bca48a0f1..4e09c3ae08c6b59c64ce1836653391f7c75e8ee6 100644 +index 8c64ea9f10902a6cd2a82c0e45786e1901d3d4ff..741f7edafb79934c05710ebeb36f93b1d6339770 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1542,6 +1542,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1540,6 +1540,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); int j = entity.getType().clientTrackingRange() * 16; diff --git a/patches/server/0315-Add-debug-for-sync-chunk-loads.patch b/patches/server/0315-Add-debug-for-sync-chunk-loads.patch index bf5532d58e..5daa78388c 100644 --- a/patches/server/0315-Add-debug-for-sync-chunk-loads.patch +++ b/patches/server/0315-Add-debug-for-sync-chunk-loads.patch @@ -302,7 +302,7 @@ index 0000000000000000000000000000000000000000..95d6022c9cfb2e36ec5a71be6e343540 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 1049452baaf0381ffbf15b30da956c2a1994da35..60f678c26fb5144386d8697ddfd5b6d841563b6f 100644 +index cfdc91f4b5b7e387c701831da2fbca5e79b6de24..43bee0018fac84e05d4c63dc703cdd09938f0002 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -206,6 +206,7 @@ public class ServerChunkCache extends ChunkSource { @@ -314,10 +314,10 @@ index 1049452baaf0381ffbf15b30da956c2a1994da35..60f678c26fb5144386d8697ddfd5b6d8 chunkproviderserver_b.managedBlock(completablefuture::isDone); this.level.timings.syncChunkLoad.stopTiming(); // Paper diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c85d5b941b5cb1c37cd2619d419006c5956f6eaf..f1fa4cb11f69e248dd55b8aa69f5d07268f182a1 100644 +index 1efc5554e422d4c4c4df3aae768920e06bfd6674..d173b6192b843c4ecad72d93824cca523b3fa80d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -422,6 +422,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -420,6 +420,13 @@ public class ServerLevel extends Level implements WorldGenLevel { this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit } diff --git a/patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch index fb2f7c6706..cf9fa2fb0a 100644 --- a/patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch +++ b/patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remote Connections shouldn't hold up shutdown Bugs in the connection logic appears to leave stale connections even, preventing shutdown diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index b15cee6f21ff300b596922a8eed35a5f8a89fe22..d6dc8c983d26ce89f17a990be4284fdc78ad164b 100644 +index ef6324dbb7e311ac16c64f937dee64c777f4b54e..1c8959a80ac76dc2fcb5fdaf8dbe064e592645e7 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -416,11 +416,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -414,11 +414,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } if (this.rconThread != null) { diff --git a/patches/server/0333-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0333-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch index 8b8acb0b21..57a3e6464f 100644 --- a/patches/server/0333-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch +++ b/patches/server/0333-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch @@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding Stack will identify any causer of this and warn instead of crashing. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 6159ab8831a233c21aad48c64ef76b06c1955bb0..ee3a5b2f2f1591f68bbacea01b8eafed65c29356 100644 +index 741f7edafb79934c05710ebeb36f93b1d6339770..13c3d7fd782a945cd52a2c190b12ab38982983d5 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1241,6 +1241,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1239,6 +1239,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void addEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot @@ -25,10 +25,10 @@ index 6159ab8831a233c21aad48c64ef76b06c1955bb0..ee3a5b2f2f1591f68bbacea01b8eafed EntityType<?> entitytypes = entity.getType(); int i = entitytypes.clientTrackingRange() * 16; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index f1fa4cb11f69e248dd55b8aa69f5d07268f182a1..89e05d9316b012a5c8103682ff9dbeae757f4f57 100644 +index d173b6192b843c4ecad72d93824cca523b3fa80d..10c2ae20078895f9079f2a5cb825505176ff11c6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2149,7 +2149,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2125,7 +2125,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public void onTrackingStart(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot @@ -37,7 +37,7 @@ index f1fa4cb11f69e248dd55b8aa69f5d07268f182a1..89e05d9316b012a5c8103682ff9dbeae if (entity instanceof ServerPlayer entityplayer) { ServerLevel.this.players.add(entityplayer); ServerLevel.this.updateSleepingPlayerList(); -@@ -2179,6 +2179,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2155,6 +2155,7 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.valid = true; // CraftBukkit diff --git a/patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch b/patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch index aaa9cf191b..87c444f00c 100644 --- a/patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch +++ b/patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch @@ -35,10 +35,10 @@ index 613eefeb44beb35181243b570bad631f15802918..9b6887f40dea57d4b5e2f08d7645b1ed this.gameMode.setLevel((ServerLevel) world); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f0cc34002e260567322d7acaf803f43a8b92e563..8b0c098c795c5a57fce96ad5d98ac8436024cda9 100644 +index f1e932c987616c529ec3957b3f4070927c8c24c0..2138bc59ba47f6d3570dcacabc5e4eae08c7e9a7 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -226,6 +226,7 @@ public abstract class PlayerList { +@@ -225,6 +225,7 @@ public abstract class PlayerList { // Paper start - Entity#getEntitySpawnReason if (optional.isEmpty()) { player.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; // set Player SpawnReason to DEFAULT on first login diff --git a/patches/server/0344-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch b/patches/server/0344-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch index f99c0af332..5af161e15d 100644 --- a/patches/server/0344-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch +++ b/patches/server/0344-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch @@ -31,10 +31,10 @@ delays anymore. public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ee3a5b2f2f1591f68bbacea01b8eafed65c29356..bac8e53cab360142f224965e68d8f9e6ae0c15f6 100644 +index 13c3d7fd782a945cd52a2c190b12ab38982983d5..1964737c16ffcc1b1d751172f9a1dcd7caf7c812 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1248,6 +1248,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1246,6 +1246,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return; } // Paper end - ignore and warn about illegal addEntity calls instead of crashing server @@ -55,10 +55,10 @@ index a794131746c6cfdcbeeb64b31fb122a38be085c1..f0103bcfb29b9fed41c7642620d78fe7 // CraftBukkit end public boolean isRealPlayer; // Paper diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8b0c098c795c5a57fce96ad5d98ac8436024cda9..ed0ffff1cfc25f66e1947e40008c6c7259b17019 100644 +index 2138bc59ba47f6d3570dcacabc5e4eae08c7e9a7..dfc957d73ed966e1fc20586c978467267606d371 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -297,6 +297,12 @@ public abstract class PlayerList { +@@ -296,6 +296,12 @@ public abstract class PlayerList { this.playersByUUID.put(player.getUUID(), player); // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(entityplayer))); // CraftBukkit - replaced with loop below @@ -71,7 +71,7 @@ index 8b0c098c795c5a57fce96ad5d98ac8436024cda9..ed0ffff1cfc25f66e1947e40008c6c72 // CraftBukkit start CraftPlayer bukkitPlayer = player.getBukkitEntity(); -@@ -335,6 +341,8 @@ public abstract class PlayerList { +@@ -334,6 +340,8 @@ public abstract class PlayerList { player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(entityplayer1))); } player.sentListPacket = true; @@ -80,7 +80,7 @@ index 8b0c098c795c5a57fce96ad5d98ac8436024cda9..ed0ffff1cfc25f66e1947e40008c6c72 // CraftBukkit end player.refreshEntityData(player); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn -@@ -350,6 +358,11 @@ public abstract class PlayerList { +@@ -349,6 +357,11 @@ public abstract class PlayerList { worldserver1 = player.serverLevel(); // CraftBukkit - Update in case join event changed it // CraftBukkit end this.sendActivePlayerEffects(player); @@ -92,7 +92,7 @@ index 8b0c098c795c5a57fce96ad5d98ac8436024cda9..ed0ffff1cfc25f66e1947e40008c6c72 if (optional.isPresent() && ((CompoundTag) optional.get()).contains("RootVehicle", 10)) { CompoundTag nbttagcompound = ((CompoundTag) optional.get()).getCompound("RootVehicle"); ServerLevel finalWorldServer = worldserver1; // CraftBukkit - decompile error -@@ -396,6 +409,10 @@ public abstract class PlayerList { +@@ -395,6 +408,10 @@ public abstract class PlayerList { } } diff --git a/patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch index 112ee6f5a2..0f8f4ad353 100644 --- a/patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch +++ b/patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -10,10 +10,10 @@ Co-authored-by: Wyatt Childers <[email protected]> Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ed0ffff1cfc25f66e1947e40008c6c7259b17019..51426da5f3e7b9f8631880a04cef0a58b00233df 100644 +index dfc957d73ed966e1fc20586c978467267606d371..976fcf4f3f06805aeb9705b1f08f5621d32ac7a9 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -197,6 +197,7 @@ public abstract class PlayerList { +@@ -196,6 +196,7 @@ public abstract class PlayerList { } Optional<CompoundTag> optional = this.load(player); // CraftBukkit - decompile error @@ -21,7 +21,7 @@ index ed0ffff1cfc25f66e1947e40008c6c7259b17019..51426da5f3e7b9f8631880a04cef0a58 // CraftBukkit start - Better rename detection if (optional.isPresent()) { CompoundTag nbttagcompound = optional.get(); -@@ -206,19 +207,47 @@ public abstract class PlayerList { +@@ -205,19 +206,47 @@ public abstract class PlayerList { } } // CraftBukkit end @@ -72,7 +72,7 @@ index ed0ffff1cfc25f66e1947e40008c6c7259b17019..51426da5f3e7b9f8631880a04cef0a58 } else { worldserver1 = worldserver; } -@@ -226,6 +255,10 @@ public abstract class PlayerList { +@@ -225,6 +254,10 @@ public abstract class PlayerList { // Paper start - Entity#getEntitySpawnReason if (optional.isEmpty()) { player.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; // set Player SpawnReason to DEFAULT on first login @@ -84,7 +84,7 @@ index ed0ffff1cfc25f66e1947e40008c6c7259b17019..51426da5f3e7b9f8631880a04cef0a58 } // Paper end - Entity#getEntitySpawnReason diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 981b4d28f5f8c614b623f1482551d0f9281807f6..61ae5553a22adc84acbe2962632b8f564ed80d88 100644 +index 46ebb4158728311c6812485bc5080dadbd63585e..e61c92d4d510eeb93ad0d72f779f6ac9c3a722f1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2386,27 +2386,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch b/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch index eab3672167..cdf1ceb8a2 100644 --- a/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch +++ b/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 151f078ab6081637189d3d532718dac0ec5e46df..090b42aba7353d232a210d67936d024d00388047 100644 +index 6109ff50349a9054f319faf7bb28ee55dd40ee71..fef2cc3c5f1516792784820cff627e0fbb80236b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3058,16 +3058,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3054,16 +3054,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl 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/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 5da6c94c5d..ca2c87cb0f 100644 --- a/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -63,10 +63,10 @@ index 997a96a21440ae72696d68f8031ece4ba487d3ef..3d8584929cee000ae7df10c5bd94f358 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 d6dc8c983d26ce89f17a990be4284fdc78ad164b..2b1d7a2360a9ee7bca9d93a2dc8c61d1648a8348 100644 +index 1c8959a80ac76dc2fcb5fdaf8dbe064e592645e7..dc7be5f98913fc61c6ab83d9575bbb1f5c1ff893 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -350,7 +350,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -348,7 +348,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @Override public void forceDifficulty() { @@ -76,10 +76,10 @@ index d6dc8c983d26ce89f17a990be4284fdc78ad164b..2b1d7a2360a9ee7bca9d93a2dc8c61d1 @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 01def06cf90faaf67421b6e5a87f4c47dd4c1142..9f28c9f2e8f8323aa374c2ac5e7610b825890b18 100644 +index 569600def358c67cd6671d51af769f7dd00ade74..e5d8fed29d06ac9eb5b750eed9c5c50f86f3d774 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3261,7 +3261,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3257,7 +3257,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { diff --git a/patches/server/0381-Do-not-accept-invalid-client-settings.patch b/patches/server/0381-Do-not-accept-invalid-client-settings.patch index 5c428d433e..0ed6e0de4b 100644 --- a/patches/server/0381-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0381-Do-not-accept-invalid-client-settings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not accept invalid client settings diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9f28c9f2e8f8323aa374c2ac5e7610b825890b18..762998180eb7b10151f390ee79690c68d66622f2 100644 +index e5d8fed29d06ac9eb5b750eed9c5c50f86f3d774..edeea9ec3f83c46fd7b42f9817a6a97c20adf875 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3253,6 +3253,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3249,6 +3249,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index 37342b6ffe..7d5de1aa49 100644 --- a/patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 89e05d9316b012a5c8103682ff9dbeae757f4f57..9114ba1742a4fc8683848d431fa92046a85fe871 100644 +index 10c2ae20078895f9079f2a5cb825505176ff11c6..f9ed66aa106029acc28fe2cb0ad4199f5ee15d9d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1666,7 +1666,9 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1642,7 +1642,9 @@ public class ServerLevel extends Level implements WorldGenLevel { float f1 = this.levelData.getSpawnAngle(); if (!blockposition1.equals(pos) || f1 != angle) { diff --git a/patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch index 9cb478d120..a48c285dd2 100644 --- a/patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9114ba1742a4fc8683848d431fa92046a85fe871..c60967b7833a23cff0305219b02b308d92448109 100644 +index f9ed66aa106029acc28fe2cb0ad4199f5ee15d9d..ec524ff64659de67781bb92bab9bb847c672e5ec 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1228,6 +1228,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1204,6 +1204,12 @@ public class ServerLevel extends Level implements WorldGenLevel { // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { diff --git a/patches/server/0433-Add-API-for-quit-reason.patch b/patches/server/0433-Add-API-for-quit-reason.patch index 6a3fe2a2e8..b9e642933c 100644 --- a/patches/server/0433-Add-API-for-quit-reason.patch +++ b/patches/server/0433-Add-API-for-quit-reason.patch @@ -52,10 +52,10 @@ index a3c67bdc2c08b3550534f37d15b0db90b479e34f..24bf661e76fb421a8be565d9ea68edf7 this.connection.disconnect(disconnectiondetails); })); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 51426da5f3e7b9f8631880a04cef0a58b00233df..ec080eb8e3930b6c5cc08c3061535b379a99a7d1 100644 +index 976fcf4f3f06805aeb9705b1f08f5621d32ac7a9..f09052503fc17e651b8da7ea7dad9ef3eab43032 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -570,7 +570,7 @@ public abstract class PlayerList { +@@ -569,7 +569,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason } diff --git a/patches/server/0444-Limit-recipe-packets.patch b/patches/server/0444-Limit-recipe-packets.patch index f880991f70..6db7164642 100644 --- a/patches/server/0444-Limit-recipe-packets.patch +++ b/patches/server/0444-Limit-recipe-packets.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7a743d81c387179218c519a7e27702605069caeb..a0bac2fe6222964b098cfaf9470f09c43328fcf5 100644 +index eed1f126921f25b15cbb66734f38909ae5d7a69a..9229e9e7eee12806c3929b55243d5ea66ce7e6a1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -24,7 +24,7 @@ index 7a743d81c387179218c519a7e27702605069caeb..a0bac2fe6222964b098cfaf9470f09c4 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -3070,6 +3072,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3066,6 +3068,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch index 50b8b7414c..fa7bb067d9 100644 --- a/patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a0bac2fe6222964b098cfaf9470f09c43328fcf5..09e40d6e50b7c1ddd1451981d05ecbbef43cfed2 100644 +index 9229e9e7eee12806c3929b55243d5ea66ce7e6a1..e005d1cff2d2bfef78843062390fce5dc32689f7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1771,7 +1771,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -23,7 +23,7 @@ index a0bac2fe6222964b098cfaf9470f09c43328fcf5..09e40d6e50b7c1ddd1451981d05ecbbe this.player.swing(enumhand, true); } } -@@ -2392,13 +2392,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2388,13 +2388,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d3 = Math.max(this.player.blockInteractionRange(), this.player.entityInteractionRange()); // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities diff --git a/patches/server/0471-Remove-stale-POIs.patch b/patches/server/0471-Remove-stale-POIs.patch index 02c2f1843b..bc94dd6925 100644 --- a/patches/server/0471-Remove-stale-POIs.patch +++ b/patches/server/0471-Remove-stale-POIs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c60967b7833a23cff0305219b02b308d92448109..373560fc82e491e6c8b755fecfe78d49a2fc3e2f 100644 +index ec524ff64659de67781bb92bab9bb847c672e5ec..b6f2f9c05b15d0d8f66208da47d3e265747f3103 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1741,6 +1741,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1717,6 +1717,11 @@ public class ServerLevel extends Level implements WorldGenLevel { }); optional1.ifPresent((holder) -> { this.getServer().execute(() -> { diff --git a/patches/server/0472-Fix-villager-boat-exploit.patch b/patches/server/0472-Fix-villager-boat-exploit.patch index 8f9249892b..42d62049c3 100644 --- a/patches/server/0472-Fix-villager-boat-exploit.patch +++ b/patches/server/0472-Fix-villager-boat-exploit.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix villager boat exploit diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ec080eb8e3930b6c5cc08c3061535b379a99a7d1..846132dad557b04a3d52184cfb1c0dd35673f8c6 100644 +index f09052503fc17e651b8da7ea7dad9ef3eab43032..c0db13dfe63841819e62962e8328369914a0ea2d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -595,6 +595,14 @@ public abstract class PlayerList { +@@ -594,6 +594,14 @@ public abstract class PlayerList { PlayerList.LOGGER.debug("Removing player mount"); entityplayer.stopRiding(); entity.getPassengersAndSelf().forEach((entity1) -> { diff --git a/patches/server/0473-Add-sendOpLevel-API.patch b/patches/server/0473-Add-sendOpLevel-API.patch index 25dff52343..18d32eb4c1 100644 --- a/patches/server/0473-Add-sendOpLevel-API.patch +++ b/patches/server/0473-Add-sendOpLevel-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 846132dad557b04a3d52184cfb1c0dd35673f8c6..5100b2d00452f97849239ca32164eed4345e4024 100644 +index c0db13dfe63841819e62962e8328369914a0ea2d..42acf1c7a16725def4f721149c64cc4a93e5110a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1062,6 +1062,11 @@ public abstract class PlayerList { +@@ -1061,6 +1061,11 @@ public abstract class PlayerList { } private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) { @@ -20,7 +20,7 @@ index 846132dad557b04a3d52184cfb1c0dd35673f8c6..5100b2d00452f97849239ca32164eed4 if (player.connection != null) { byte b0; -@@ -1076,8 +1081,10 @@ public abstract class PlayerList { +@@ -1075,8 +1080,10 @@ public abstract class PlayerList { player.connection.send(new ClientboundEntityEventPacket(player, b0)); } @@ -32,7 +32,7 @@ index 846132dad557b04a3d52184cfb1c0dd35673f8c6..5100b2d00452f97849239ca32164eed4 public boolean isWhiteListed(GameProfile profile) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 766242aa6930b37630be77e421b4b5675c5feb0d..7652da85170cd5a64d1b443430b85c388e2939a9 100644 +index a3b1a19fb28dfba93ae04ea0859f744ede1579f6..963ae66acc25602e15134d30d3e496802b17dc41 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -677,6 +677,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0488-Add-EntityMoveEvent.patch b/patches/server/0488-Add-EntityMoveEvent.patch index 2992bc3199..e58a49d8a9 100644 --- a/patches/server/0488-Add-EntityMoveEvent.patch +++ b/patches/server/0488-Add-EntityMoveEvent.patch @@ -17,10 +17,10 @@ index 84028b8ad189407f89fbdd63d3e185c86335b596..d38cc3e642eb33759175227fbf86ed25 this.profiler.push(() -> { String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 373560fc82e491e6c8b755fecfe78d49a2fc3e2f..644341b8bc3079c6f092226acd11667f64bd55a1 100644 +index b6f2f9c05b15d0d8f66208da47d3e265747f3103..421e38846465dc8cc3487206f26661fa88ef7e7b 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -226,6 +226,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public final LevelStorageSource.LevelStorageAccess convertable; public final UUID uuid; public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent diff --git a/patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch index e40ef31e16..a667780460 100644 --- a/patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch @@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 644341b8bc3079c6f092226acd11667f64bd55a1..1fe013b94cf1b5332f1e4645dd35df01e11fe0d9 100644 +index 421e38846465dc8cc3487206f26661fa88ef7e7b..9c54d611b41a5ee3c86f181bae1219452b93b0a3 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1374,6 +1374,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1350,6 +1350,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.getChunkSource().blockChanged(pos); this.pathTypesByPosCache.invalidate(pos); @@ -16,7 +16,7 @@ index 644341b8bc3079c6f092226acd11667f64bd55a1..1fe013b94cf1b5332f1e4645dd35df01 VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); -@@ -1415,6 +1416,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1391,6 +1392,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } diff --git a/patches/server/0498-fix-converting-txt-to-json-file.patch b/patches/server/0498-fix-converting-txt-to-json-file.patch index efc09dd833..fd9d57e2aa 100644 --- a/patches/server/0498-fix-converting-txt-to-json-file.patch +++ b/patches/server/0498-fix-converting-txt-to-json-file.patch @@ -21,10 +21,10 @@ index 929f59bce01c8e6ed4b0b551744d42e131b8fc80..22c4f8dea99f92a1eb3da2baf0a15bf9 this.saveUserBanList(); this.loadIpBanList(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 2b1d7a2360a9ee7bca9d93a2dc8c61d1648a8348..d5153f804cfcfd1a70c46975e3fb1e50c8a82999 100644 +index dc7be5f98913fc61c6ab83d9575bbb1f5c1ff893..9294d7e9d3056e1680de65385df1ed89b5c2b77a 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -216,6 +216,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -214,6 +214,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Paper end - initialize global and world-defaults configuration @@ -37,7 +37,7 @@ index 2b1d7a2360a9ee7bca9d93a2dc8c61d1648a8348..d5153f804cfcfd1a70c46975e3fb1e50 org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics -@@ -270,9 +276,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -268,9 +274,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file."); } @@ -48,10 +48,10 @@ index 2b1d7a2360a9ee7bca9d93a2dc8c61d1648a8348..d5153f804cfcfd1a70c46975e3fb1e50 if (!OldUsersConverter.serverReadyAfterUserconversion(this)) { return false; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5100b2d00452f97849239ca32164eed4345e4024..6ef0e5c607c1b7ef9ba6a9f5c7bc452ce9a84250 100644 +index 42acf1c7a16725def4f721149c64cc4a93e5110a..ba7994c074f9a44940024964f138aadaabc36e26 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -179,6 +179,7 @@ public abstract class PlayerList { +@@ -178,6 +178,7 @@ public abstract class PlayerList { this.maxPlayers = maxPlayers; this.playerIo = saveHandler; } diff --git a/patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch index 757cfd681e..5e81b64e2f 100644 --- a/patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch +++ b/patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch @@ -7,10 +7,10 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro Closes #5036 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 6ef0e5c607c1b7ef9ba6a9f5c7bc452ce9a84250..7ef760cb1c88f557947e9b88409a2935666f86f0 100644 +index ba7994c074f9a44940024964f138aadaabc36e26..8221db7d0440e0f30208a5bc9245b14b0509a654 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -588,6 +588,14 @@ public abstract class PlayerList { +@@ -587,6 +587,14 @@ public abstract class PlayerList { } // Paper end - Configurable player collision diff --git a/patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch index 701ba9042a..2dc6c82e99 100644 --- a/patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch +++ b/patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch @@ -208,10 +208,10 @@ index 0000000000000000000000000000000000000000..dd9d77d7c7f1a5a130a1f4c15e5b1e68 + public void setErrorIndex(final int errorIndex) {} +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index d5153f804cfcfd1a70c46975e3fb1e50c8a82999..764395fe8e49d811294ca82887fee91ca6cd01fc 100644 +index 9294d7e9d3056e1680de65385df1ed89b5c2b77a..c8e88e83063bbd9d0b4e6facdf76faf67affb0bd 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -190,7 +190,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -188,7 +188,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface thread.setDaemon(true); thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER)); @@ -220,7 +220,7 @@ index d5153f804cfcfd1a70c46975e3fb1e50c8a82999..764395fe8e49d811294ca82887fee91c DedicatedServer.LOGGER.info("Starting minecraft server version {}", SharedConstants.getCurrentVersion().getName()); if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); -@@ -223,6 +223,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -221,6 +221,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames // Paper end - fix converting txt to json file org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread diff --git a/patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch index 614386ecde..2432e685fd 100644 --- a/patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch +++ b/patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch @@ -42,10 +42,10 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 764395fe8e49d811294ca82887fee91ca6cd01fc..4057ade698a227b4f6efd3aa30b16d78c777be83 100644 +index c8e88e83063bbd9d0b4e6facdf76faf67affb0bd..7fe509f14b39ac6f52ae2a9267921aead2d9af73 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -227,6 +227,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -225,6 +225,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now diff --git a/patches/server/0535-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0535-Expand-PlayerGameModeChangeEvent.patch index ca358f5250..17be930a28 100644 --- a/patches/server/0535-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0535-Expand-PlayerGameModeChangeEvent.patch @@ -134,10 +134,10 @@ index 5de472df78940d1b8320f73d18b2edf3a796227e..073cf184a0e7af41048ae67a9b17b4cd } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 699658bd80eb88907041efb01d31e4051edb91de..58e5acbd00c4f8c0fcafa4f2c21b6a9f4dcc4151 100644 +index 0437a0ab7525671cfae26c5bf981fdecd5da0cc7..f171e4441033ab8d81b45e8c1fd7a0d6ca89e268 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2732,7 +2732,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2728,7 +2728,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit if (this.server.isHardcore()) { diff --git a/patches/server/0541-Add-Unix-domain-socket-support.patch b/patches/server/0541-Add-Unix-domain-socket-support.patch index 7def3d56ce..531bc298df 100644 --- a/patches/server/0541-Add-Unix-domain-socket-support.patch +++ b/patches/server/0541-Add-Unix-domain-socket-support.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Unix domain socket support diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 4057ade698a227b4f6efd3aa30b16d78c777be83..adbd61c41cc30afa89c6ee3544c562b351304a01 100644 +index 7fe509f14b39ac6f52ae2a9267921aead2d9af73..6e895a0458031f0ad18615fe49368d34af70ad27 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -236,6 +236,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -234,6 +234,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist); // this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode); @@ -29,7 +29,7 @@ index 4057ade698a227b4f6efd3aa30b16d78c777be83..adbd61c41cc30afa89c6ee3544c562b3 InetAddress inetaddress = null; if (!this.getLocalIp().isEmpty()) { -@@ -245,12 +259,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -243,12 +257,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (this.getPort() < 0) { this.setPort(dedicatedserverproperties.serverPort); } @@ -87,10 +87,10 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e713a2abca824e92a4922c34fca8c1f0bfdcdf68..ada5016ee354e799a8241a0706ea04e236efd1eb 100644 +index 96e7cd653bd9655f4fe70d4ca7f396aae6c603fa..ce0b0e1483f4c142d3316ba8c2899f6ed85f4b75 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2551,6 +2551,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2547,6 +2547,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start public SocketAddress getRawAddress() { diff --git a/patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch index 2807ad861f..66f6c430c0 100644 --- a/patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch +++ b/patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1fe013b94cf1b5332f1e4645dd35df01e11fe0d9..055650b315d53b56798ded7af2054c3e8e3ee319 100644 +index 9c54d611b41a5ee3c86f181bae1219452b93b0a3..7d8b3673ad03396a10e272edcae57227451cbbb5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -441,8 +441,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -439,8 +439,8 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setClearWeatherTime(clearDuration); this.serverLevelData.setRainTime(rainDuration); this.serverLevelData.setThunderTime(rainDuration); @@ -19,7 +19,7 @@ index 1fe013b94cf1b5332f1e4645dd35df01e11fe0d9..055650b315d53b56798ded7af2054c3e } @Override -@@ -875,8 +875,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -865,8 +865,8 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setThunderTime(j); this.serverLevelData.setRainTime(k); this.serverLevelData.setClearWeatherTime(i); @@ -30,7 +30,7 @@ index 1fe013b94cf1b5332f1e4645dd35df01e11fe0d9..055650b315d53b56798ded7af2054c3e } this.oThunderLevel = this.thunderLevel; -@@ -943,14 +943,14 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -933,14 +933,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public void resetWeatherCycle() { // CraftBukkit start diff --git a/patches/server/0547-Add-PlayerKickEvent-causes.patch b/patches/server/0547-Add-PlayerKickEvent-causes.patch index 261ceab74d..f5117a5673 100644 --- a/patches/server/0547-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0547-Add-PlayerKickEvent-causes.patch @@ -218,7 +218,7 @@ index 24bf661e76fb421a8be565d9ea68edf7205254d2..feb529adf2168025c785ab92d95a3246 if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8fba97228 100644 +index ce0b0e1483f4c142d3316ba8c2899f6ed85f4b75..851440862e29e3666e4270577287edcc43fb56a8 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -355,7 +355,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 } return optional; -@@ -2363,7 +2363,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2359,7 +2359,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // this.chatSpamTickCount += 20; if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // CraftBukkit end @@ -364,7 +364,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 } } -@@ -2375,7 +2375,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2371,7 +2371,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl synchronized (this.lastSeenMessages) { if (!this.lastSeenMessages.applyOffset(packet.offset())) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -373,7 +373,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 } } -@@ -2523,7 +2523,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2519,7 +2519,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (i > 4096) { @@ -382,7 +382,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 } } -@@ -2581,7 +2581,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2577,7 +2577,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start if ( entity == this.player && !this.player.isSpectator() ) { @@ -391,7 +391,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 return; } // Spigot End -@@ -2695,7 +2695,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2691,7 +2691,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } @@ -400,7 +400,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); } }); -@@ -3092,7 +3092,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3088,7 +3088,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start - auto recipe limit if (!org.bukkit.Bukkit.isPrimaryThread()) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -409,7 +409,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 return; } } -@@ -3334,7 +3334,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3330,7 +3330,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) { if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) { @@ -418,7 +418,7 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 } else { try { SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator(); -@@ -3347,7 +3347,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3343,7 +3343,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); } catch (ProfilePublicKey.ValidationException profilepublickey_b) { ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); @@ -428,10 +428,10 @@ index ada5016ee354e799a8241a0706ea04e236efd1eb..70b215dfbe53bd475192ca1d021032c8 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0cbd4e6bc9b3695fd2ff0b943a69b8fd393e0f36..46f46685081c3c164bd4ba306dfb1220a4e13e52 100644 +index 8221db7d0440e0f30208a5bc9245b14b0509a654..b4161803c5513927ae222027e5a49b6201c17659 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -675,7 +675,7 @@ public abstract class PlayerList { +@@ -674,7 +674,7 @@ public abstract class PlayerList { while (iterator.hasNext()) { entityplayer = (ServerPlayer) iterator.next(); this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved @@ -440,7 +440,7 @@ index 0cbd4e6bc9b3695fd2ff0b943a69b8fd393e0f36..46f46685081c3c164bd4ba306dfb1220 } // Instead of kicking then returning, we need to store the kick reason -@@ -1273,7 +1273,7 @@ public abstract class PlayerList { +@@ -1270,7 +1270,7 @@ public abstract class PlayerList { // Paper end // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { diff --git a/patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch index 0fb834902a..088cb13b2d 100644 --- a/patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 055650b315d53b56798ded7af2054c3e8e3ee319..c72687fb23e8d01639cce7d79e3f97805d51e01f 100644 +index 7d8b3673ad03396a10e272edcae57227451cbbb5..e18d21d910d1ef285d55fca98ee55899db29c36a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -231,7 +231,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -229,7 +229,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent public LevelChunk getChunkIfLoaded(int x, int z) { @@ -21,7 +21,7 @@ index 055650b315d53b56798ded7af2054c3e8e3ee319..c72687fb23e8d01639cce7d79e3f9780 @Override diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index cfd5d3e50197b38d0ffef6debbb7f5b4b208382a..ed1fc466151ebebf7c3ac135c6893f4ea9a55a52 100644 +index 144d243e0d6ba3ae3f0b0bf457fa516e2b4f416f..20a14b4163807b806bf2ce5a88d3c35098bed929 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -180,6 +180,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0565-Add-PlayerArmSwingEvent.patch b/patches/server/0565-Add-PlayerArmSwingEvent.patch index 080029d23f..834b10c1d7 100644 --- a/patches/server/0565-Add-PlayerArmSwingEvent.patch +++ b/patches/server/0565-Add-PlayerArmSwingEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmSwingEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 70b215dfbe53bd475192ca1d021032c8fba97228..0a5cad166e852888208125a80b5e2d5e7e9a3a82 100644 +index 851440862e29e3666e4270577287edcc43fb56a8..60e37011a6dcf9a2942b3e66016b00e64fcb309b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2413,7 +2413,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2409,7 +2409,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper end - Call interact event // Arm swing animation diff --git a/patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch b/patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch index 7b01621edd..4abbffc48b 100644 --- a/patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch @@ -55,7 +55,7 @@ index feb529adf2168025c785ab92d95a3246e73c0236..b43f87ff4b9853b5d4bbea5ff9686d64 MinecraftServer minecraftserver = this.server; Connection networkmanager = this.connection; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0a5cad166e852888208125a80b5e2d5e7e9a3a82..dd728c297335581ad69c94f768ec5201b7879264 100644 +index 60e37011a6dcf9a2942b3e66016b00e64fcb309b..efa60d1b6e16e53e0d490f82aa53a126ff75024e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1895,6 +1895,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -101,10 +101,10 @@ index 0a5cad166e852888208125a80b5e2d5e7e9a3a82..dd728c297335581ad69c94f768ec5201 this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0474b88416e0d016da38909196d32fe992b37d00..5b449dd681390eb7aee229a3b6366dcbb96ce2d7 100644 +index b4161803c5513927ae222027e5a49b6201c17659..68efe36118e95c84c469a92f069e1ec8624cbc14 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -561,6 +561,11 @@ public abstract class PlayerList { +@@ -560,6 +560,11 @@ public abstract class PlayerList { } public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component diff --git a/patches/server/0574-Add-PlayerSetSpawnEvent.patch b/patches/server/0574-Add-PlayerSetSpawnEvent.patch index 4b9bd3eb51..702fabb904 100644 --- a/patches/server/0574-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0574-Add-PlayerSetSpawnEvent.patch @@ -154,10 +154,10 @@ index e9eec0e4e2e533e4ddc7f52a16a1b2b1ce21d6da..db4bdce4eae9a91babe95c28cb0f6c96 public SectionPos getLastSectionPos() { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5b449dd681390eb7aee229a3b6366dcbb96ce2d7..2eced5d3b539dfd072b8b4eafb34f21f849b1bd5 100644 +index 68efe36118e95c84c469a92f069e1ec8624cbc14..e2dd64e0b3e24c30869efb438287930c1d595f9e 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -841,7 +841,7 @@ public abstract class PlayerList { +@@ -840,7 +840,7 @@ public abstract class PlayerList { // CraftBukkit end if (dimensiontransition.missingRespawnBlock()) { entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F)); diff --git a/patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch index ca096b9dd9..71d07f7f22 100644 --- a/patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch +++ b/patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c72687fb23e8d01639cce7d79e3f97805d51e01f..778d3f3ea2247be5bd6edd382b872f6de5bc359c 100644 +index e18d21d910d1ef285d55fca98ee55899db29c36a..d9677c4306f7efe302388f10289751f37b2e82b5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -764,6 +764,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -754,6 +754,11 @@ public class ServerLevel extends Level implements WorldGenLevel { } protected BlockPos findLightningTargetAround(BlockPos pos) { @@ -22,7 +22,7 @@ index c72687fb23e8d01639cce7d79e3f97805d51e01f..778d3f3ea2247be5bd6edd382b872f6d BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos); Optional<BlockPos> optional = this.findLightningRod(blockposition1); -@@ -778,6 +783,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -768,6 +773,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!list.isEmpty()) { return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition(); } else { diff --git a/patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index eb56ff1385..41fc0d846d 100644 --- a/patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/ state desync POV because the TE is getting unloaded anyways. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 778d3f3ea2247be5bd6edd382b872f6de5bc359c..de154106419d57a6b6c410fedc29cec1dbe532de 100644 +index d9677c4306f7efe302388f10289751f37b2e82b5..7eb5d2163a98e2b622bdceea04b0fd8a5b129377 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1274,9 +1274,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1250,9 +1250,13 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot Start for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) { if (tileentity instanceof net.minecraft.world.Container) { diff --git a/patches/server/0610-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0610-Oprimise-map-impl-for-tracked-players.patch index 4d3810ad06..050645f3fa 100644 --- a/patches/server/0610-Oprimise-map-impl-for-tracked-players.patch +++ b/patches/server/0610-Oprimise-map-impl-for-tracked-players.patch @@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have better lookups than HashMap. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 86fb188ae93b9ebfea49c4d683ff015a3b42abaa..b0fd8751d0c76ee95b19bf19a7d023a4658b15db 100644 +index 1964737c16ffcc1b1d751172f9a1dcd7caf7c812..a7056adac02027c2892b02702020a227f05e43d7 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1458,7 +1458,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1456,7 +1456,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider final Entity entity; private final int range; SectionPos lastSectionPos; diff --git a/patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch index 2cd406fbc0..a0bfd86ebd 100644 --- a/patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch +++ b/patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index de154106419d57a6b6c410fedc29cec1dbe532de..3c947dc0aea06d66a00aeca51355ea41e8d98f88 100644 +index 7eb5d2163a98e2b622bdceea04b0fd8a5b129377..e849b92133ec4832bc476bfaf15e97febecc128d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2245,6 +2245,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2221,6 +2221,11 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot end // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message diff --git a/patches/server/0629-Add-root-admin-user-detection.patch b/patches/server/0629-Add-root-admin-user-detection.patch index abe2f3b5ae..14dd5d37b7 100644 --- a/patches/server/0629-Add-root-admin-user-detection.patch +++ b/patches/server/0629-Add-root-admin-user-detection.patch @@ -40,10 +40,10 @@ index 0000000000000000000000000000000000000000..68098dfe716e93aafcca4d8d5b5a81d8 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index adbd61c41cc30afa89c6ee3544c562b351304a01..585d3e51b4af87327fc2bc64a49f09732a8c61ab 100644 +index 6e895a0458031f0ad18615fe49368d34af70ad27..a4f52e4efcf4d169a690b12a1a6d610bffca4adb 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -196,6 +196,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -194,6 +194,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } diff --git a/patches/server/0648-Validate-usernames.patch b/patches/server/0648-Validate-usernames.patch index 08d6e377eb..277bdb9353 100644 --- a/patches/server/0648-Validate-usernames.patch +++ b/patches/server/0648-Validate-usernames.patch @@ -32,10 +32,10 @@ index baedae23865ea80c6546d1f6f439e1d7712258b9..e9cd90b6bb2f57d605323add43f12962 GameProfile gameprofile = this.server.getSingleplayerProfile(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2eced5d3b539dfd072b8b4eafb34f21f849b1bd5..97257e44163ed565b5f1152f0738649b1adbeb07 100644 +index e2dd64e0b3e24c30869efb438287930c1d595f9e..95a02b081d60f9ea45cc49faa0b0da8d5d88c0e6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -670,7 +670,7 @@ public abstract class PlayerList { +@@ -669,7 +669,7 @@ public abstract class PlayerList { for (int i = 0; i < this.players.size(); ++i) { entityplayer = (ServerPlayer) this.players.get(i); diff --git a/patches/server/0674-Force-close-world-loading-screen.patch b/patches/server/0674-Force-close-world-loading-screen.patch index 83d9e2f203..06e8370733 100644 --- a/patches/server/0674-Force-close-world-loading-screen.patch +++ b/patches/server/0674-Force-close-world-loading-screen.patch @@ -10,10 +10,10 @@ so we do not need that. The client only needs the chunk it is currently in to be loaded to close the loading screen, so we just send an empty one. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 97257e44163ed565b5f1152f0738649b1adbeb07..d21d9a66ab7197ea4fa324a9af64a1457d8e602b 100644 +index 95a02b081d60f9ea45cc49faa0b0da8d5d88c0e6..6c75c2baab97ed58dbda3143bf06f7366b72bebe 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -394,6 +394,16 @@ public abstract class PlayerList { +@@ -393,6 +393,16 @@ public abstract class PlayerList { this.sendActivePlayerEffects(player); // Paper start - Fire PlayerJoinEvent when Player is actually ready; move vehicle into method so it can be called above - short circuit around that code this.onPlayerJoinFinish(player, worldserver1, s1); diff --git a/patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch index 41eee9f92e..beee5c12d8 100644 --- a/patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity copies loading chunks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f26d092e50e5f1e320ba2e3a264573ad862aca26..c87e243744166fb736ca8db65ac268072e353e16 100644 +index adbadcf844835a80c03dcdda6595adf52c127fbf..5a154059bcb60f3567c71f2afcd9a8130e8566a6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3202,7 +3202,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3198,7 +3198,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl BlockPos blockposition = BlockEntity.getPosFromTag(customdata.getUnsafe()); if (this.player.level().isLoaded(blockposition)) { diff --git a/patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch index d98876142b..180aac24e8 100644 --- a/patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch +++ b/patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2916328a5b94783e68688756b5ad7685f180e27f..b0a1f6cf2cc96a2ddc8232f929c134501d99411e 100644 +index 6c75c2baab97ed58dbda3143bf06f7366b72bebe..ceb1cb12f179790dfb1d42c0e585ad39d98df6ad 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1389,7 +1389,7 @@ public abstract class PlayerList { +@@ -1386,7 +1386,7 @@ public abstract class PlayerList { // CraftBukkit start public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) { ServerStatsCounter serverstatisticmanager = entityhuman.getStats(); diff --git a/patches/server/0703-Don-t-tick-markers.patch b/patches/server/0703-Don-t-tick-markers.patch index 98a89bf35d..70f6e8813a 100644 --- a/patches/server/0703-Don-t-tick-markers.patch +++ b/patches/server/0703-Don-t-tick-markers.patch @@ -23,10 +23,10 @@ index 67fcba634f8183bb33834ac3b2c3dcfb8d87129e..777b789fdcdf297309cfb36fc7f77e3f } }); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 3c947dc0aea06d66a00aeca51355ea41e8d98f88..ec2996d306d3466867e94bb6e4707f2b5fe13af2 100644 +index e849b92133ec4832bc476bfaf15e97febecc128d..1b1f36e8d94861ee69e1461947fef65e7cb725dd 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2160,6 +2160,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2136,6 +2136,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void onTickingStart(Entity entity) { diff --git a/patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch index c9e7ae9955..4b9a001ba2 100644 --- a/patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch +++ b/patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch @@ -7,10 +7,10 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca Just simply prevent them from being added to the world instead. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index ec2996d306d3466867e94bb6e4707f2b5fe13af2..43d54a7fab4b5d46bf4ca319519a39fda1fc264f 100644 +index 1b1f36e8d94861ee69e1461947fef65e7cb725dd..3e3dbb2cea4a5cf832ad1708cde1a56b22970833 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1235,6 +1235,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1211,6 +1211,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { diff --git a/patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index 6a05adf6b7..3fe9fb6ff1 100644 --- a/patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c87e243744166fb736ca8db65ac268072e353e16..8f65943161a6621f8f7926c48322e26a854ae139 100644 +index 5a154059bcb60f3567c71f2afcd9a8130e8566a6..dcf8be9abf4d7c2f58a28b8a64a02aff4661a599 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2384,7 +2384,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2380,7 +2380,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Spigot end // this.chatSpamTickCount += 20; diff --git a/patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch index ef2c3507a8..b3585979eb 100644 --- a/patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch @@ -106,10 +106,10 @@ index 0000000000000000000000000000000000000000..1b797955357612a4319452de7461ba04 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 585d3e51b4af87327fc2bc64a49f09732a8c61ab..aa39bdb0a4ba8fedf5052ea9700afa7d4d2a4300 100644 +index a4f52e4efcf4d169a690b12a1a6d610bffca4adb..13ca70fe330d5e48d38c2035ea346b34e6bd3ea1 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -291,13 +291,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -289,13 +289,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP); // CraftBukkit end diff --git a/patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch index 074c1a9d45..ac4a559da1 100644 --- a/patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch @@ -85,10 +85,10 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520 } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index b953def299faf1a13e1893d17a476f36e2d6337a..d409791325771909faaef0dffb0f7f02d1bf71af 100644 +index a7056adac02027c2892b02702020a227f05e43d7..8c68b17299dd301e98c4141081d3df9299d22cc4 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1027,7 +1027,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1025,7 +1025,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // CraftBukkit end } @@ -98,10 +98,10 @@ index b953def299faf1a13e1893d17a476f36e2d6337a..d409791325771909faaef0dffb0f7f02 return this.anyPlayerCloseEnoughForSpawning(pos, false); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 43d54a7fab4b5d46bf4ca319519a39fda1fc264f..4924e19c3fdafb3bb3f0550b16f8acf08e436c67 100644 +index 3e3dbb2cea4a5cf832ad1708cde1a56b22970833..5dbb1abf11b107bd71f9637faa8e22308e0bcf03 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -777,7 +777,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -767,7 +767,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } else { AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D); List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> { @@ -124,10 +124,10 @@ index 6abecaac8407b992d208a9108e11fd4954a4106f..03d89f326d320c5d778c3d1e2db7d6b8 this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit this.level.updateSleepingPlayerList(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d430e6c08bae0a630e71c11c9eae26bef85bde36..a929b8f1c452db08a64e4be53b488cf2676e0a94 100644 +index ceb1cb12f179790dfb1d42c0e585ad39d98df6ad..add3db3bbe908d564c7fbad1750a74660cb71502 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -260,7 +260,7 @@ public abstract class PlayerList { +@@ -259,7 +259,7 @@ public abstract class PlayerList { } if (optional.isEmpty() || invalidPlayerWorld[0]) { // Paper end - reset to main world spawn if first spawn or invalid world @@ -136,7 +136,7 @@ index d430e6c08bae0a630e71c11c9eae26bef85bde36..a929b8f1c452db08a64e4be53b488cf2 } // Paper end - Entity#getEntitySpawnReason player.setServerLevel(worldserver1); -@@ -703,8 +703,10 @@ public abstract class PlayerList { +@@ -702,8 +702,10 @@ public abstract class PlayerList { Player player = entity.getBukkitEntity(); PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress()); diff --git a/patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch index bbff07c888..6751144f03 100644 --- a/patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch +++ b/patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4924e19c3fdafb3bb3f0550b16f8acf08e436c67..66f795168d3e120506aafa3cade78e6e8dcd8619 100644 +index 5dbb1abf11b107bd71f9637faa8e22308e0bcf03..bd808b87c9bd780a046f1d1395028c9f50bbf358 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2184,7 +2184,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2160,7 +2160,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } if (entity instanceof Mob entityinsentient) { @@ -17,7 +17,7 @@ index 4924e19c3fdafb3bb3f0550b16f8acf08e436c67..66f795168d3e120506aafa3cade78e6e String s = "onTrackingStart called during navigation iteration"; Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration")); -@@ -2264,7 +2264,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2240,7 +2240,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } if (entity instanceof Mob entityinsentient) { diff --git a/patches/server/0772-check-global-player-list-where-appropriate.patch b/patches/server/0772-check-global-player-list-where-appropriate.patch index 3afedde0df..0119ddbdda 100644 --- a/patches/server/0772-check-global-player-list-where-appropriate.patch +++ b/patches/server/0772-check-global-player-list-where-appropriate.patch @@ -7,10 +7,10 @@ Makes certain entities check all players when searching for a player instead of just checking players in their world. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 66f795168d3e120506aafa3cade78e6e8dcd8619..cff225eab588248f1e6487a4a33da006672b3ba4 100644 +index bd808b87c9bd780a046f1d1395028c9f50bbf358..84c441051a224b7c39ba85b03376dbefdff9c74f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2300,4 +2300,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2276,4 +2276,12 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.updateDynamicGameEventListener(DynamicGameEventListener::move); } } diff --git a/patches/server/0779-Player-Entity-Tracking-Events.patch b/patches/server/0779-Player-Entity-Tracking-Events.patch index 79e25c5ae3..f72e3c979c 100644 --- a/patches/server/0779-Player-Entity-Tracking-Events.patch +++ b/patches/server/0779-Player-Entity-Tracking-Events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player Entity Tracking Events diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 182d50c422e506859a6eecdb71d33038142406d9..233bb6263fbae1ba79cecf72c637b0e515b39656 100644 +index 8c68b17299dd301e98c4141081d3df9299d22cc4..cd67227df14124c2edeab28725c626cbf35e7e8c 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1530,7 +1530,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1528,7 +1528,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // CraftBukkit end if (flag) { if (this.seenBy.add(player.connection)) { diff --git a/patches/server/0786-Improve-logging-and-errors.patch b/patches/server/0786-Improve-logging-and-errors.patch index 243a962373..194bf90ad2 100644 --- a/patches/server/0786-Improve-logging-and-errors.patch +++ b/patches/server/0786-Improve-logging-and-errors.patch @@ -40,10 +40,10 @@ index 3255578c8c37d977bb6e89d27194a4dbff822014..2172e23b22b411fe79e930128bd43ac0 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index aa39bdb0a4ba8fedf5052ea9700afa7d4d2a4300..b4af03c4bdd1ce0861f36c3b75fc7e89d701c46a 100644 +index 13ca70fe330d5e48d38c2035ea346b34e6bd3ea1..1c94b78cb23e44762fc99bb916484c1b334b6b10 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -282,6 +282,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -280,6 +280,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!"); DedicatedServer.LOGGER.warn("The exception was: {}", ioexception.toString()); DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?"); @@ -52,10 +52,10 @@ index aa39bdb0a4ba8fedf5052ea9700afa7d4d2a4300..b4af03c4bdd1ce0861f36c3b75fc7e89 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3b1e231c637750821a756c877c9c6b7150b184b8..e5b466f71d4c65eb31210ccad05a9fb603d53098 100644 +index 5c3682fb662ac19750a00de24d74e3ebe73f2982..f9402016da77ebb01ce457f6c3486eb7c234c136 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3400,7 +3400,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3396,7 +3396,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); } catch (ProfilePublicKey.ValidationException profilepublickey_b) { diff --git a/patches/server/0794-Use-single-player-info-update-packet-on-join.patch b/patches/server/0794-Use-single-player-info-update-packet-on-join.patch index 4552daec45..9d22a0e68a 100644 --- a/patches/server/0794-Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/0794-Use-single-player-info-update-packet-on-join.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use single player info update packet on join diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1b486d09bd1a84835183a6c8181933fcabb3373f..62b022a72954eeecfa141f4ec93ccb44d955e54b 100644 +index d20cbb46bdbaed693007d4928b41efa95e68f70a..deacb39405beeb68b945c7ee53db2a2728d12a51 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3438,7 +3438,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3434,7 +3434,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID()); this.chatMessageChain.append(() -> { this.player.setChatSession(session); @@ -18,10 +18,10 @@ index 1b486d09bd1a84835183a6c8181933fcabb3373f..62b022a72954eeecfa141f4ec93ccb44 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a929b8f1c452db08a64e4be53b488cf2676e0a94..2ea29c9491186d7a25ed3eed99ee4a488bcaa272 100644 +index add3db3bbe908d564c7fbad1750a74660cb71502..cf09aa30744d78425c43ae84e68e4d217e94aab8 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -361,6 +361,7 @@ public abstract class PlayerList { +@@ -360,6 +360,7 @@ public abstract class PlayerList { // CraftBukkit start - sendAll above replaced with this loop ClientboundPlayerInfoUpdatePacket packet = ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player)); @@ -29,7 +29,7 @@ index a929b8f1c452db08a64e4be53b488cf2676e0a94..2ea29c9491186d7a25ed3eed99ee4a48 for (int i = 0; i < this.players.size(); ++i) { ServerPlayer entityplayer1 = (ServerPlayer) this.players.get(i); -@@ -368,12 +369,17 @@ public abstract class PlayerList { +@@ -367,12 +368,17 @@ public abstract class PlayerList { entityplayer1.connection.send(packet); } diff --git a/patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch index d08f848c6e..a63c9aed71 100644 --- a/patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch +++ b/patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch @@ -26,7 +26,7 @@ index 68c062cbaa030d62d97c9c003651f8fc17a00a6b..6247a21c9c391abf1f6db3482c659593 UPDATE_GAME_MODE((serialized, buf) -> serialized.gameMode = GameType.byId(buf.readVarInt()), (buf, entry) -> buf.writeVarInt(entry.gameMode().getId())), UPDATE_LISTED((serialized, buf) -> serialized.listed = buf.readBoolean(), (buf, entry) -> buf.writeBoolean(entry.listed())), diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 664d9cfacb87b1d9193376261f7102b64c906ddc..977af8887ac331576a1c4441fcfad681f69a9929 100644 +index 064cda8a10cfcd4036dcdbd9f2e9f599cf982da8..05fb7f13c23c49465fe1bf71bdb9c656f390a03e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -295,6 +295,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -51,7 +51,7 @@ index 664d9cfacb87b1d9193376261f7102b64c906ddc..977af8887ac331576a1c4441fcfad681 } private int getMaximumFlyingTicks(Entity vehicle) { -@@ -3436,6 +3444,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3432,6 +3440,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void resetPlayerChatState(RemoteChatSession session) { this.chatSession = session; diff --git a/patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch index b0096b0c97..efb3cb2ef8 100644 --- a/patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch +++ b/patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index cff225eab588248f1e6487a4a33da006672b3ba4..a27fd023e4f9b6ee113f6b3ed21b4c5aeb7ce15d 100644 +index 84c441051a224b7c39ba85b03376dbefdff9c74f..a86fbb9e5c4f4f89efc0e910535ccb4e181a3be6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1372,6 +1372,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1348,6 +1348,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void gameEvent(Holder<GameEvent> event, Vec3 emitterPos, GameEvent.Context emitter) { diff --git a/patches/server/0848-Implement-PlayerFailMoveEvent.patch b/patches/server/0848-Implement-PlayerFailMoveEvent.patch index e222dfa6e2..ba89332155 100644 --- a/patches/server/0848-Implement-PlayerFailMoveEvent.patch +++ b/patches/server/0848-Implement-PlayerFailMoveEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerFailMoveEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 977af8887ac331576a1c4441fcfad681f69a9929..46bb2031141b88416f2df1fb8bca76638ef66dae 100644 +index 05fb7f13c23c49465fe1bf71bdb9c656f390a03e..3ec809e2a8da71da646ab80f9aefcc7f1829963b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1261,8 +1261,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -91,7 +91,7 @@ index 977af8887ac331576a1c4441fcfad681f69a9929..46bb2031141b88416f2df1fb8bca7663 this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet. this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround()); } else { -@@ -3467,4 +3497,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3463,4 +3493,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl InteractionResult run(ServerPlayer player, Entity entity, InteractionHand hand); } diff --git a/patches/server/0849-Folia-scheduler-and-owned-region-API.patch b/patches/server/0849-Folia-scheduler-and-owned-region-API.patch index 6657e8e33f..9fd28bbaa2 100644 --- a/patches/server/0849-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0849-Folia-scheduler-and-owned-region-API.patch @@ -1173,10 +1173,10 @@ index a72b278826be1d0da79ca619ea9a9a437fa9c54b..2dfa9c4c0c2ef489649944eed89d8c77 this.profiler.push("commandFunctions"); MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2ea29c9491186d7a25ed3eed99ee4a488bcaa272..de96d7df65713f2fa7b8f2dd068856bb5fa45a45 100644 +index cf09aa30744d78425c43ae84e68e4d217e94aab8..962fa2281fa7a52a2f7b3fd8f1d7d49f243698f5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -640,6 +640,7 @@ public abstract class PlayerList { +@@ -639,6 +639,7 @@ public abstract class PlayerList { entityplayer.unRide(); worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER); @@ -1185,7 +1185,7 @@ index 2ea29c9491186d7a25ed3eed99ee4a488bcaa272..de96d7df65713f2fa7b8f2dd068856bb this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c266b752b 100644 +index b3123e363bca10fa225acf365b1f48d935f14a20..d2ef0e7a977aae9a5a7cf138f8fc6ff6314dac3f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -255,11 +255,23 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1251,7 +1251,7 @@ index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c public void setLevelCallback(EntityInLevelCallback changeListener) { this.levelCallback = changeListener; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..6d373fb254225aa92a10181d8dd21e2dd7fb063a 100644 +index ed6210d2490f8584c21537eaa380d990fb73e03d..3e78a420ea183f4044873bb1fd89e9b9749032b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -310,6 +310,76 @@ public final class CraftServer implements Server { diff --git a/patches/server/0851-API-for-updating-recipes-on-clients.patch b/patches/server/0851-API-for-updating-recipes-on-clients.patch index 373578055d..c461999663 100644 --- a/patches/server/0851-API-for-updating-recipes-on-clients.patch +++ b/patches/server/0851-API-for-updating-recipes-on-clients.patch @@ -5,10 +5,10 @@ Subject: [PATCH] API for updating recipes on clients diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f9dcbf7d51680e8dfdda1350e0632dec675f3d44..1b83d8f723410c405746faa59783e6ba7a66fd56 100644 +index 962fa2281fa7a52a2f7b3fd8f1d7d49f243698f5..bb4547bc73318289561390bc9fc291fe3fc1f837 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1485,6 +1485,13 @@ public abstract class PlayerList { +@@ -1482,6 +1482,13 @@ public abstract class PlayerList { } public void reloadResources() { @@ -22,7 +22,7 @@ index f9dcbf7d51680e8dfdda1350e0632dec675f3d44..1b83d8f723410c405746faa59783e6ba // CraftBukkit start /*Iterator iterator = this.advancements.values().iterator(); -@@ -1500,7 +1507,15 @@ public abstract class PlayerList { +@@ -1497,7 +1504,15 @@ public abstract class PlayerList { } // CraftBukkit end diff --git a/patches/server/0867-Configurable-entity-tracking-range-by-Y-coordinate.patch b/patches/server/0867-Configurable-entity-tracking-range-by-Y-coordinate.patch index 1d5996e07f..42cb398fba 100644 --- a/patches/server/0867-Configurable-entity-tracking-range-by-Y-coordinate.patch +++ b/patches/server/0867-Configurable-entity-tracking-range-by-Y-coordinate.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate Options to configure entity tracking by Y coordinate, also for each entity category. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 233bb6263fbae1ba79cecf72c637b0e515b39656..6e15348c364dbe90905ae7a7ef8c1107ebaece14 100644 +index cd67227df14124c2edeab28725c626cbf35e7e8c..235a49ff7e6e7f1f839fee9110a2c5d5ce7ca2a5 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1522,6 +1522,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1520,6 +1520,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z; double d2 = d0 * d0; boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z); diff --git a/patches/server/0868-Add-Listing-API-for-Player.patch b/patches/server/0868-Add-Listing-API-for-Player.patch index bb270bf016..12d846f5bf 100644 --- a/patches/server/0868-Add-Listing-API-for-Player.patch +++ b/patches/server/0868-Add-Listing-API-for-Player.patch @@ -82,10 +82,10 @@ index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdca static class EntryBuilder { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index be6bf7afa3cea4ed48f363e89ccd079062edc8d9..9b1a6d8351fb473eec75a2fd08fb892b770e3586 100644 +index bb4547bc73318289561390bc9fc291fe3fc1f837..d607859d1e4150e1d70ef6201b3c82e81c82e7d0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -359,14 +359,22 @@ public abstract class PlayerList { +@@ -358,14 +358,22 @@ public abstract class PlayerList { // CraftBukkit end // CraftBukkit start - sendAll above replaced with this loop @@ -109,7 +109,7 @@ index be6bf7afa3cea4ed48f363e89ccd079062edc8d9..9b1a6d8351fb473eec75a2fd08fb892b } if (entityplayer1 == player || !bukkitPlayer.canSee(entityplayer1.getBukkitEntity())) { // Paper - Use single player info update packet on join; Don't include joining player -@@ -377,7 +385,7 @@ public abstract class PlayerList { +@@ -376,7 +384,7 @@ public abstract class PlayerList { } // Paper start - Use single player info update packet on join if (!onlinePlayers.isEmpty()) { @@ -119,7 +119,7 @@ index be6bf7afa3cea4ed48f363e89ccd079062edc8d9..9b1a6d8351fb473eec75a2fd08fb892b // Paper end - Use single player info update packet on join player.sentListPacket = true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cb41fad4b94c4da64a699dc1b0848fc08ff2c456..c80cbc9dece765091b2ad9281bdc061df8b491dc 100644 +index 9cf67deacf9d01e3835705260a358513987fc3ba..78dcc656807cafa52707ef4139fe6176f6f16021 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -201,6 +201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch b/patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch index 00c27f3999..6386b2632a 100644 --- a/patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch +++ b/patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add slot sanity checks in container clicks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0ed03a8ec85d8491d96c7b3ac3feff805a773539..5d7b443173c3f11fc402e96db109e4382466d182 100644 +index 9187410ddc39273a393946f2f18626b30dd8f870..649a3cd9db7748df1831397709ab2e43d57399b6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2987,6 +2987,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2983,6 +2983,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl break; case SWAP: if ((packet.getButtonNum() >= 0 && packet.getButtonNum() < 9) || packet.getButtonNum() == 40) { diff --git a/patches/server/0895-Fix-missing-map-initialize-event-call.patch b/patches/server/0895-Fix-missing-map-initialize-event-call.patch index 1ee21864ad..d4b19b8e16 100644 --- a/patches/server/0895-Fix-missing-map-initialize-event-call.patch +++ b/patches/server/0895-Fix-missing-map-initialize-event-call.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Fix missing map initialize event call public net.minecraft.world.level.storage.DimensionDataStorage readSavedData(Ljava/util/function/Function;Lnet/minecraft/util/datafix/DataFixTypes;Ljava/lang/String;)Lnet/minecraft/world/level/saveddata/SavedData; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a27fd023e4f9b6ee113f6b3ed21b4c5aeb7ce15d..c5e404dcdab14dc0b972aa3286b05e21d9ea67e0 100644 +index a86fbb9e5c4f4f89efc0e910535ccb4e181a3be6..045b0fbe9ff1db13ece18723d2ff0e9b7d950209 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1662,13 +1662,24 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1638,13 +1638,24 @@ public class ServerLevel extends Level implements WorldGenLevel { @Nullable @Override public MapItemSavedData getMapData(MapId id) { diff --git a/patches/server/0899-Don-t-check-if-we-can-see-non-visible-entities.patch b/patches/server/0899-Don-t-check-if-we-can-see-non-visible-entities.patch index af411edde1..35563c5d5d 100644 --- a/patches/server/0899-Don-t-check-if-we-can-see-non-visible-entities.patch +++ b/patches/server/0899-Don-t-check-if-we-can-see-non-visible-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check if we can see non-visible entities diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 6e15348c364dbe90905ae7a7ef8c1107ebaece14..e153e42ef50ba7c5b5674c3e1524e332425e813a 100644 +index 235a49ff7e6e7f1f839fee9110a2c5d5ce7ca2a5..3b2d5fdc8cafbc12fa863a26af0bbeb0cf42e662 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1533,7 +1533,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1531,7 +1531,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end - Configurable entity tracking range by Y // CraftBukkit start - respect vanish API diff --git a/patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch index 9ee1999a85..56f9ec5d92 100644 --- a/patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch +++ b/patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch @@ -19,10 +19,10 @@ where generation happened directly to a ServerLevel and the entity still has the flag set. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c5e404dcdab14dc0b972aa3286b05e21d9ea67e0..aaaf5b91402a1562311dfdc287193a1aefbaf9a7 100644 +index 045b0fbe9ff1db13ece18723d2ff0e9b7d950209..7a2877ca23573a62327af212bfac236c7bb8b582 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1224,6 +1224,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1200,6 +1200,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // CraftBukkit start private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -31,7 +31,7 @@ index c5e404dcdab14dc0b972aa3286b05e21d9ea67e0..aaaf5b91402a1562311dfdc287193a1a if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 23442e0f887cec3c3a65b3dd3d0f4f40db0e54b1..24aacf9997c9ea0bd68ef3803f4a3ee4a920ab44 100644 +index 94b2844adeeca9694dafe7ae79d6c751ac06e794..c199de89f5a3a54684800a3aa9043c0f2a511c8f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -625,7 +625,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index e74acbd64b..f4c61edb90 100644 --- a/patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -18,10 +18,10 @@ index a043ac10834562d357ef0b5aded2e916e2a0d056..74276c368016fcc4dbf9579b2ecbadc9 @VisibleForTesting static long encode(double value) { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index e153e42ef50ba7c5b5674c3e1524e332425e813a..34d7f79237c23111a91f7c5960799e4034de0352 100644 +index 3b2d5fdc8cafbc12fa863a26af0bbeb0cf42e662..8f4112bf0db3e60a20d8eb0041957423fc5b51c8 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1516,10 +1516,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1514,10 +1514,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void updatePlayer(ServerPlayer player) { org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot if (player != this.entity) { diff --git a/patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch b/patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch index 3e5409551e..f2f0a03863 100644 --- a/patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch +++ b/patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockBreakProgressUpdateEvent diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index aaaf5b91402a1562311dfdc287193a1aefbaf9a7..fd6e0f1a67f56e3b5fe97894919c7e4e1b90c4e8 100644 +index 7a2877ca23573a62327af212bfac236c7bb8b582..ed8b2391a8671361b5f0055c6b4e6fb756972c37 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1320,6 +1320,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1296,6 +1296,17 @@ public class ServerLevel extends Level implements WorldGenLevel { if (entity instanceof Player) entityhuman = (Player) entity; // CraftBukkit end diff --git a/patches/server/0941-Add-CartographyItemEvent.patch b/patches/server/0941-Add-CartographyItemEvent.patch index 2d775d4172..9c64d653c5 100644 --- a/patches/server/0941-Add-CartographyItemEvent.patch +++ b/patches/server/0941-Add-CartographyItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add CartographyItemEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5d7b443173c3f11fc402e96db109e4382466d182..449fd298293f4fb996b7ddae6b174d6a28e95eb6 100644 +index 649a3cd9db7748df1831397709ab2e43d57399b6..1129a00b6a438e2cf49365fecdcce27eead26349 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3109,6 +3109,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3105,6 +3105,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/server/0944-Configurable-max-block-fluid-ticks.patch b/patches/server/0944-Configurable-max-block-fluid-ticks.patch index 780b696029..f48d1ed916 100644 --- a/patches/server/0944-Configurable-max-block-fluid-ticks.patch +++ b/patches/server/0944-Configurable-max-block-fluid-ticks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable max block/fluid ticks diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index fd6e0f1a67f56e3b5fe97894919c7e4e1b90c4e8..c97292f22a3402dbd59cef4af554954dc1d4f91a 100644 +index ed8b2391a8671361b5f0055c6b4e6fb756972c37..43b15f7c0b4713f2f85dc32da71cceedea6547bb 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -501,9 +501,9 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -498,9 +498,9 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!this.isDebug() && flag) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); @@ -19,4 +19,4 @@ index fd6e0f1a67f56e3b5fe97894919c7e4e1b90c4e8..c97292f22a3402dbd59cef4af554954d + this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks gameprofilerfiller.pop(); } - this.timings.scheduledBlocks.stopTiming(); // Paper + diff --git a/patches/server/0972-Brigadier-based-command-API.patch b/patches/server/0972-Brigadier-based-command-API.patch index f139f76f3a..e0b22efdba 100644 --- a/patches/server/0972-Brigadier-based-command-API.patch +++ b/patches/server/0972-Brigadier-based-command-API.patch @@ -2316,10 +2316,10 @@ index ec29e95d796305b8d44c2075629a8147a05f48c1..9cd4f7c6910727c849ac7f5d675dc610 public void tick() { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index b4af03c4bdd1ce0861f36c3b75fc7e89d701c46a..0761d5bc5f2813bb4a9f664ac7a05b9744d0a778 100644 +index 1c94b78cb23e44762fc99bb916484c1b334b6b10..7db17eabd88d9b8d2cc9b5c870c1980357e33f32 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -237,7 +237,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -235,7 +235,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now @@ -2328,17 +2328,16 @@ index b4af03c4bdd1ce0861f36c3b75fc7e89d701c46a..0761d5bc5f2813bb4a9f664ac7a05b97 this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 134f31cce8d8eca669948a784e2766216fb91ab5..60c65af218d533d53b765ba2175fed163c32c126 100644 +index 0b60898c8239c4518025d1b37689ae2d02d68e3c..60c65af218d533d53b765ba2175fed163c32c126 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2408,33 +2408,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2408,29 +2408,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } + @Deprecated // Paper public void handleCommand(String s) { // Paper - private -> public - org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher -- co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper - if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot - this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); - @@ -2348,7 +2347,6 @@ index 134f31cce8d8eca669948a784e2766216fb91ab5..60c65af218d533d53b765ba2175fed16 - this.cserver.getPluginManager().callEvent(event); - - if (event.isCancelled()) { -- co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper - return; - } - @@ -2360,8 +2358,6 @@ index 134f31cce8d8eca669948a784e2766216fb91ab5..60c65af218d533d53b765ba2175fed16 - player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command"); - java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - return; -- } finally { -- co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper + // Paper start - Remove all this old duplicated logic + if (s.startsWith("/")) { + s = s.substring(1); diff --git a/patches/server/0988-Moonrise-optimisation-patches.patch b/patches/server/0988-Moonrise-optimisation-patches.patch index e5e18378ed..d6d59a255d 100644 --- a/patches/server/0988-Moonrise-optimisation-patches.patch +++ b/patches/server/0988-Moonrise-optimisation-patches.patch @@ -22657,10 +22657,10 @@ index c97fb8eec949c693d4e822d8cf2e666a0858f20c..4a4ce372dd105d07f58d7d93d856cb39 public boolean isDebugging() { return false; diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 22519b6f5bbf0e29e204b3c8bed5b9f81f44417a..ccfd2c6df3657ff53187a377f573d5f0a182ae4f 100644 +index 7db17eabd88d9b8d2cc9b5c870c1980357e33f32..f4c6d670e6d88c444a37ce8b08321d373cad3bee 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -476,7 +476,33 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -474,7 +474,33 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface return world.dimension() == net.minecraft.world.level.Level.NETHER ? this.getProperties().allowNether : true; } @@ -23191,10 +23191,10 @@ index d9ad32acdf46a43a649334a3b736aeb7b3af21d1..fae17a075d7efaf24d916877dd5968eb public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius(); public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK; diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734cd8c8fc3 100644 +index 8f4112bf0db3e60a20d8eb0041957423fc5b51c8..f2b6a15c78a91823190a60406b95aac03d976e75 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -122,10 +122,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -120,10 +120,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public static final int MIN_VIEW_DISTANCE = 2; public static final int MAX_VIEW_DISTANCE = 32; public static final int FORCED_TICKET_LEVEL = ChunkLevel.byStatus(FullChunkStatus.ENTITY_TICKING); @@ -23206,7 +23206,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 public final ServerLevel level; private final ThreadedLevelLightEngine lightEngine; private final BlockableEventLoop<Runnable> mainThreadExecutor; -@@ -135,21 +132,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -133,21 +130,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final PoiManager poiManager; public final LongSet toDrop; private boolean modified; @@ -23232,7 +23232,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); -@@ -174,22 +169,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -172,22 +167,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper start public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) { @@ -23258,7 +23258,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 Path path = session.getDimensionPath(world.dimension()); this.storageName = path.getFileName().toString(); -@@ -220,15 +213,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -218,15 +211,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.chunkStatusListener = chunkStatusChangeListener; ProcessorMailbox<Runnable> threadedmailbox1 = ProcessorMailbox.create(executor, "light"); @@ -23277,7 +23277,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } // Paper start -@@ -259,23 +250,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -257,23 +248,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } boolean isChunkTracked(ServerPlayer player, int chunkX, int chunkZ) { @@ -23303,7 +23303,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } protected ThreadedLevelLightEngine getLightEngine() { -@@ -284,20 +263,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -282,20 +261,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Nullable protected ChunkHolder getUpdatingChunkIfPresent(long pos) { @@ -23333,7 +23333,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } public String getChunkDebugData(ChunkPos chunkPos) { -@@ -326,55 +307,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -324,55 +305,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private CompletableFuture<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture(ChunkHolder centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) { @@ -23390,7 +23390,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } public ReportedException debugFuturesAndCreateReportedException(IllegalStateException exception, String details) { -@@ -404,90 +337,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -402,90 +335,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public CompletableFuture<ChunkResult<LevelChunk>> prepareEntityTickingChunk(ChunkHolder holder) { @@ -23487,7 +23487,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } protected void tick(BooleanSupplier shouldKeepTicking) { -@@ -504,133 +370,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -502,133 +368,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public boolean hasWork() { @@ -23627,7 +23627,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } private static boolean isChunkDataValid(CompoundTag nbt) { -@@ -690,137 +448,44 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -688,137 +446,44 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Override public GenerationChunkHolder acquireGeneration(long pos) { @@ -23774,7 +23774,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } public int getTickingGenerated() { -@@ -828,135 +493,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -826,135 +491,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) { @@ -23962,7 +23962,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 @Nullable public LevelChunk getChunkToSend(long pos) { ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos); -@@ -1022,7 +636,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1020,7 +634,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } // CraftBukkit start @@ -23971,7 +23971,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 return this.upgradeChunkTag(this.level.getTypeKey(), this.overworldDataStorage, nbttagcompound, this.generator().getTypeNameForDataFixer(), chunkcoordintpair, this.level); // CraftBukkit end } -@@ -1113,19 +727,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1111,19 +725,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.updatePlayerPos(player); if (!flag1) { this.distanceManager.addPlayer(SectionPos.of((EntityAccess) player), player); @@ -23995,7 +23995,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } } -@@ -1137,17 +753,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1135,17 +751,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public void move(ServerPlayer player) { @@ -24014,7 +24014,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 SectionPos sectionposition = player.getLastSectionPos(); SectionPos sectionposition1 = SectionPos.of((EntityAccess) player); -@@ -1157,6 +763,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1155,6 +761,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (flag2 || flag != flag1) { this.updatePlayerPos(player); @@ -24022,7 +24022,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 if (!flag) { this.distanceManager.removePlayer(sectionposition, player); } -@@ -1173,70 +780,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1171,70 +778,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.playerMap.unIgnorePlayer(player); } @@ -24104,7 +24104,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } public void addEntity(Entity entity) { -@@ -1264,6 +831,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1262,6 +829,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); @@ -24117,7 +24117,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 playerchunkmap_entitytracker.updatePlayers(this.level.players()); if (entity instanceof ServerPlayer) { ServerPlayer entityplayer = (ServerPlayer) entity; -@@ -1304,16 +877,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1302,16 +875,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker1.broadcastRemoved(); } entity.tracker = null; // Paper - We're no longer tracked @@ -24172,7 +24172,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 List<ServerPlayer> list = Lists.newArrayList(); List<ServerPlayer> list1 = this.level.players(); -@@ -1416,27 +1022,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1414,27 +1020,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public void waitForLightBeforeSending(ChunkPos centerPos, int radius) { @@ -24210,7 +24210,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 } @Nullable -@@ -1452,7 +1056,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1450,7 +1054,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -24219,7 +24219,7 @@ index 34d7f79237c23111a91f7c5960799e4034de0352..9d38391720537fc114a00d5f5c34f734 public final ServerEntity serverEntity; final Entity entity; -@@ -1460,6 +1064,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1458,6 +1062,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider SectionPos lastSectionPos; public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl @@ -25573,10 +25573,10 @@ index 1d849ce4e2c85f149af25318b8ffb6dcef6c6788..12d86f27d04bffed8c3844e36b42fbc2 if (!list.equals(this.lastPassengers)) { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341a54477f2 100644 +index 43b15f7c0b4713f2f85dc32da71cceedea6547bb..f96f8f786cf36a41b50bb2f18014d7ad184e2b72 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -184,7 +184,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; +@@ -182,7 +182,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; import org.bukkit.event.world.TimeSkipEvent; // CraftBukkit end @@ -25585,7 +25585,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 public static final BlockPos END_SPAWN_POINT = new BlockPos(100, 50, 0); public static final IntProvider RAIN_DELAY = UniformInt.of(12000, 180000); -@@ -200,7 +200,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -198,7 +198,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public final PrimaryLevelData serverLevelData; // CraftBukkit - type private int lastSpawnChunkRadius; final EntityTickList entityTickList; @@ -25594,7 +25594,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 private final GameEventDispatcher gameEventDispatcher; public boolean noSave; private final SleepStatus sleepStatus; -@@ -339,6 +339,195 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -337,6 +337,195 @@ public class ServerLevel extends Level implements WorldGenLevel { return player != null && player.level() == this ? player : null; } // Paper end - optimise getPlayerByUUID @@ -25790,7 +25790,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 // Add env and gen to constructor, IWorldDataServer -> WorldDataServer public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { -@@ -385,14 +574,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -383,14 +572,13 @@ public class ServerLevel extends Level implements WorldGenLevel { DataFixer datafixer = minecraftserver.getFixerUpper(); EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(new SimpleRegionStorage(new RegionStorageInfo(convertable_conversionsession.getLevelId(), resourcekey, "entities"), convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, DataFixTypes.ENTITY_CHUNK), this, minecraftserver); @@ -25808,7 +25808,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 return minecraftserver.overworld().getDataStorage(); }); this.chunkSource.getGeneratorState().ensureStructuresGenerated(); -@@ -420,6 +608,19 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -418,6 +606,19 @@ public class ServerLevel extends Level implements WorldGenLevel { this.randomSequences = (RandomSequences) Objects.requireNonNullElseGet(randomsequences, () -> { return (RandomSequences) this.getDataStorage().computeIfAbsent(RandomSequences.factory(l), "random_sequences"); }); @@ -25828,7 +25828,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit } -@@ -553,7 +754,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -545,7 +746,7 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.push("checkDespawn"); entity.checkDespawn(); gameprofilerfiller.pop(); @@ -25837,7 +25837,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 Entity entity1 = entity.getVehicle(); if (entity1 != null) { -@@ -578,13 +779,16 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -570,13 +771,16 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.push("entityManagement"); @@ -25856,7 +25856,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } protected void tickTime() { -@@ -626,6 +830,63 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -618,6 +822,63 @@ public class ServerLevel extends Level implements WorldGenLevel { }); } @@ -25920,9 +25920,9 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 public void tickChunk(LevelChunk chunk, int randomTickSpeed) { ChunkPos chunkcoordintpair = chunk.getPos(); boolean flag = this.isRaining(); -@@ -675,35 +936,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -666,35 +927,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + gameprofilerfiller.popPush("tickBlocks"); - timings.chunkTicksBlocks.startTiming(); // Paper if (randomTickSpeed > 0) { - LevelChunkSection[] achunksection = chunk.getSections(); - @@ -25956,8 +25956,8 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 + this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking } - timings.chunkTicksBlocks.stopTiming(); // Paper -@@ -976,6 +1209,11 @@ public class ServerLevel extends Level implements WorldGenLevel { + gameprofilerfiller.pop(); +@@ -966,6 +1199,11 @@ public class ServerLevel extends Level implements WorldGenLevel { if (fluid1.is(fluid)) { fluid1.tick(this, pos); } @@ -25969,7 +25969,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } -@@ -985,6 +1223,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -975,6 +1213,11 @@ public class ServerLevel extends Level implements WorldGenLevel { if (iblockdata.is(block)) { iblockdata.tick(this, pos, this.random); } @@ -25981,7 +25981,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } -@@ -1061,6 +1304,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1041,6 +1284,11 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) { @@ -25993,19 +25993,17 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 ServerChunkCache chunkproviderserver = this.getChunkSource(); if (!savingDisabled) { -@@ -1076,16 +1324,21 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1054,14 +1302,19 @@ public class ServerLevel extends Level implements WorldGenLevel { + progressListener.progressStage(Component.translatable("menu.savingChunks")); } - timings.worldSaveChunks.startTiming(); // Paper - chunkproviderserver.save(flush); -+ if (!close) { chunkproviderserver.save(flush); } // Paper - add close param - timings.worldSaveChunks.stopTiming(); // Paper - }// Paper - if (flush) { - this.entityManager.saveAll(); - } else { - this.entityManager.autoSave(); - } ++ if (!close) { chunkproviderserver.save(flush); } // Paper - add close param + // Paper - rewrite chunk system } @@ -26021,7 +26019,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 // CraftBukkit start - moved from MinecraftServer.saveChunks ServerLevel worldserver1 = this; -@@ -1218,7 +1471,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1194,7 +1447,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED); } @@ -26030,7 +26028,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } // CraftBukkit start -@@ -1249,7 +1502,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1225,7 +1478,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } // CraftBukkit end @@ -26039,7 +26037,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } } -@@ -1260,11 +1513,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1236,11 +1489,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public boolean tryAddFreshEntityWithPassengers(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { // CraftBukkit end @@ -26052,7 +26050,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 return false; } else { this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit -@@ -1850,7 +2099,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1826,7 +2075,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -26061,7 +26059,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 bufferedwriter.write(String.format(Locale.ROOT, "block_entity_tickers: %d\n", this.blockEntityTickers.size())); bufferedwriter.write(String.format(Locale.ROOT, "block_ticks: %d\n", this.getBlockTicks().count())); bufferedwriter.write(String.format(Locale.ROOT, "fluid_ticks: %d\n", this.getFluidTicks().count())); -@@ -1899,7 +2148,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1875,7 +2124,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1); try { @@ -26070,7 +26068,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } catch (Throwable throwable4) { if (bufferedwriter2 != null) { try { -@@ -1920,7 +2169,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1896,7 +2145,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2); try { @@ -26079,7 +26077,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } catch (Throwable throwable6) { if (bufferedwriter3 != null) { try { -@@ -2062,7 +2311,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2038,7 +2287,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public String getWatchdogStats() { @@ -26088,7 +26086,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); }), this.blockEntityTickers.size(), ServerLevel.getTypeCount(this.blockEntityTickers, TickingBlockEntity::getType), this.getBlockTicks().count(), this.getFluidTicks().count(), this.gatherChunkSourceStats()); } -@@ -2092,15 +2341,25 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2068,15 +2317,25 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public LevelEntityGetter<Entity> getEntities() { org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot @@ -26117,7 +26115,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } public void startTickingChunk(LevelChunk chunk) { -@@ -2120,34 +2379,47 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2096,34 +2355,47 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void close() throws IOException { super.close(); @@ -26172,7 +26170,7 @@ index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341 } @Override -@@ -2173,7 +2445,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2149,7 +2421,7 @@ public class ServerLevel extends Level implements WorldGenLevel { CrashReportCategory crashreportsystemdetails = super.fillReportDetails(report); crashreportsystemdetails.setDetail("Loaded entity count", () -> { diff --git a/patches/server/0990-disable-forced-empty-world-ticks.patch b/patches/server/0990-disable-forced-empty-world-ticks.patch index 747f78f9fd..c1b6e28546 100644 --- a/patches/server/0990-disable-forced-empty-world-ticks.patch +++ b/patches/server/0990-disable-forced-empty-world-ticks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] disable forced empty world ticks diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c759555241649cf5b355268066375341a54477f2..7da9729a6ac0684624f900a9e47f24e35bd3f3d9 100644 +index f96f8f786cf36a41b50bb2f18014d7ad184e2b72..c8a7c8b5eac10b182a1cab7f8c21c863b5b758fa 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -729,7 +729,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -721,7 +721,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. this.handlingTick = false; gameprofilerfiller.pop(); diff --git a/patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index fe409f5c40..54acc72c1f 100644 --- a/patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 7da9729a6ac0684624f900a9e47f24e35bd3f3d9..978208f74b6f1d3f859165e951d41013a5f00256 100644 +index c8a7c8b5eac10b182a1cab7f8c21c863b5b758fa..a391ace656077cc1df48c07890f4eabd06a75143 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2537,6 +2537,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -2513,6 +2513,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. { if ( iter.next().player == entity ) { diff --git a/patches/server/0997-Entity-Activation-Range-2.0.patch b/patches/server/0997-Entity-Activation-Range-2.0.patch index 4710fe8474..f181d771a3 100644 --- a/patches/server/0997-Entity-Activation-Range-2.0.patch +++ b/patches/server/0997-Entity-Activation-Range-2.0.patch @@ -17,62 +17,37 @@ Adds villagers as separate config public net.minecraft.world.entity.Entity isInsidePortal diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 978208f74b6f1d3f859165e951d41013a5f00256..1196eb573317ad01b6df0ae2d38aa17a72da2535 100644 +index a391ace656077cc1df48c07890f4eabd06a75143..fb1d88f7501e9b94249c0262c00ecf12c600ce99 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2,7 +2,6 @@ package net.minecraft.server.level; +@@ -1223,12 +1223,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - import com.google.common.annotations.VisibleForTesting; - import co.aikar.timings.TimingHistory; // Paper --import co.aikar.timings.Timings; // Paper - import com.google.common.collect.Lists; - import com.mojang.datafixers.DataFixer; - import com.mojang.datafixers.util.Pair; -@@ -1235,17 +1234,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - ++TimingHistory.entityTicks; // Paper - timings + public void tickNonPassenger(Entity entity) { // Spigot start - co.aikar.timings.Timing timer; // Paper - if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { + /*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below entity.tickCount++; - timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings entity.inactiveTick(); - } finally { timer.stopTiming(); } // Paper return; - } + }*/ // Paper - comment out EAR 2 // Spigot end - // Paper start- timings -- TimingHistory.activatedEntityTicks++; -- timer = entity.getVehicle() != null ? entity.getType().passengerTickTimer.startTiming() : entity.getType().tickTimer.startTiming(); + final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); -+ timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper - try { - // Paper end - timings entity.setOldPosAndRot(); -@@ -1256,9 +1255,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. + ProfilerFiller gameprofilerfiller = this.getProfiler(); + +@@ -1237,8 +1238,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); }); gameprofilerfiller.incrementCounter("tickNonPassenger"); + if (isActive) { // Paper - EAR 2 -+ TimingHistory.activatedEntityTicks++; entity.tick(); entity.postTick(); // CraftBukkit + } else { entity.inactiveTick(); } // Paper - EAR 2 this.getProfiler().pop(); -+ } finally { timer.stopTiming(); } // Paper - timings Iterator iterator = entity.getPassengers().iterator(); - while (iterator.hasNext()) { -@@ -1266,13 +1269,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - - this.tickPassenger(entity, entity1); - } -- } finally { timer.stopTiming(); } // Paper - timings -+ // } finally { timer.stopTiming(); } // Paper - timings - move up - - } - +@@ -1253,6 +1256,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. private void tickPassenger(Entity vehicle, Entity passenger) { if (!passenger.isRemoved() && passenger.getVehicle() == vehicle) { if (passenger instanceof Player || this.entityTickList.contains(passenger)) { @@ -84,7 +59,7 @@ index 978208f74b6f1d3f859165e951d41013a5f00256..1196eb573317ad01b6df0ae2d38aa17a passenger.setOldPosAndRot(); ++passenger.tickCount; ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -1281,8 +1289,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1261,8 +1269,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString(); }); gameprofilerfiller.incrementCounter("tickPassenger"); @@ -102,7 +77,7 @@ index 978208f74b6f1d3f859165e951d41013a5f00256..1196eb573317ad01b6df0ae2d38aa17a gameprofilerfiller.pop(); Iterator iterator = passenger.getPassengers().iterator(); -@@ -1292,6 +1309,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1272,6 +1289,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. this.tickPassenger(passenger, entity2); } diff --git a/patches/server/0998-Optional-per-player-mob-spawns.patch b/patches/server/0998-Optional-per-player-mob-spawns.patch index b32b71becd..08132e9d2a 100644 --- a/patches/server/0998-Optional-per-player-mob-spawns.patch +++ b/patches/server/0998-Optional-per-player-mob-spawns.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optional per player mob spawns diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 9d38391720537fc114a00d5f5c34f734cd8c8fc3..57122c884fe4d7b5d8e483d9d50226ce046d10f7 100644 +index f2b6a15c78a91823190a60406b95aac03d976e75..746e9f9e77303bbc3b61ab817f3b1546767190b4 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -223,8 +223,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -221,8 +221,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } // Paper start diff --git a/patches/server/0999-Anti-Xray.patch b/patches/server/0999-Anti-Xray.patch index 9efe1e1c24..6343769725 100644 --- a/patches/server/0999-Anti-Xray.patch +++ b/patches/server/0999-Anti-Xray.patch @@ -1104,10 +1104,10 @@ index 183b2191fa1c1b27adedf39593e1b5a223fb1279..8ead66c134688b11dca15f6509147e72 private ClientboundLevelChunkWithLightPacket(RegistryFriendlyByteBuf buf) { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1196eb573317ad01b6df0ae2d38aa17a72da2535..a5320b96148d79f8d2493060718688786466e6dd 100644 +index fb1d88f7501e9b94249c0262c00ecf12c600ce99..a4e6f53abd0411ce02fbb6f983106a10ea77fc75 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -534,7 +534,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -533,7 +533,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. // Holder holder = worlddimension.type(); // CraftBukkit - decompile error // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error @@ -1155,10 +1155,10 @@ index 32634e45ac8433648e49e47e20081e15ad41ff15..dafa2cf7d3c49fc5bdcd68d2a9528127 if (io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0) { new io.papermc.paper.event.packet.PlayerChunkLoadEvent(new org.bukkit.craftbukkit.CraftChunk(chunk), handler.getPlayer().getBukkitEntity()).callEvent(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9b1a6d8351fb473eec75a2fd08fb892b770e3586..0d0b07c9199be9ca0d5ac3feb1d44f149ba69283 100644 +index d607859d1e4150e1d70ef6201b3c82e81c82e7d0..142151ce827fe124211561bd8311691385d29554 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -414,7 +414,7 @@ public abstract class PlayerList { +@@ -413,7 +413,7 @@ public abstract class PlayerList { .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS); player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket( new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains), diff --git a/patches/server/1001-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1001-Add-Alternate-Current-redstone-implementation.patch index 17df7da36c..87654d1581 100644 --- a/patches/server/1001-Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/1001-Add-Alternate-Current-redstone-implementation.patch @@ -2009,10 +2009,10 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a5320b96148d79f8d2493060718688786466e6dd..472655c55b1f5c213da9b6c1940a353bafdac509 100644 +index a4e6f53abd0411ce02fbb6f983106a10ea77fc75..1ff7739206dd2b39b4ceade67bc6dbe2f891e23d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -227,6 +227,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. public final UUID uuid; public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent @@ -2020,7 +2020,7 @@ index a5320b96148d79f8d2493060718688786466e6dd..472655c55b1f5c213da9b6c1940a353b public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately -@@ -2468,6 +2469,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -2444,6 +2445,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. return crashreportsystemdetails; } @@ -2035,7 +2035,7 @@ index a5320b96148d79f8d2493060718688786466e6dd..472655c55b1f5c213da9b6c1940a353b EntityCallbacks() {} diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ae7cd8df617dba09abb9ca1108aff719a9c3304f..9501a2527bb0db91dd5494ccb4066b9629993e59 100644 +index 87cde688976a45aa8848586b5371b3ab493813ea..5c4eaa6bcf20b0fcec14bd5ef76ea6f29a8613a2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -2013,4 +2013,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch index 4ac057a35a..aa0e55b117 100644 --- a/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch +++ b/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Improve cancelling PreCreatureSpawnEvent with per player mob diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 57122c884fe4d7b5d8e483d9d50226ce046d10f7..23b14afcb5f651a64fd572e49518a7ca36622ec6 100644 +index 746e9f9e77303bbc3b61ab817f3b1546767190b4..d8b9fdfa87fc0021fce520989a9008d0e683b50e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -240,8 +240,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -238,8 +238,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ++(backingSet[i].mobCounts[index]); } } diff --git a/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch index d48dec5878..22169793d6 100644 --- a/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch @@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..1aa8b914e79c0d48094cc22df60ee9750ec3ccd6 100644 +index 142151ce827fe124211561bd8311691385d29554..b548cd98be0f195599cca91b2cfc9258028e1589 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -865,6 +865,7 @@ public abstract class PlayerList { +@@ -864,6 +864,7 @@ public abstract class PlayerList { Vec3 vec3d = dimensiontransition.pos(); entityplayer1.forceSetPositionRotation(vec3d.x, vec3d.y, vec3d.z, dimensiontransition.yRot(), dimensiontransition.xRot()); @@ -26,7 +26,7 @@ index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..1aa8b914e79c0d48094cc22df60ee975 if (dimensiontransition.missingRespawnBlock()) { entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F)); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index abc217e9166bce12590f37aa0e21d6202596e786..1a3932aad22be42997c52ac91e19aad06a868526 100644 +index b3e0c8c63eda497fc868f5691b585d5092eb169d..80a77c7e38ce31a4960cf601ae3d3e997bc8f88f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -250,6 +250,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/1020-Properly-resend-entities.patch b/patches/server/1020-Properly-resend-entities.patch index 6e61a43375..04aa154f48 100644 --- a/patches/server/1020-Properly-resend-entities.patch +++ b/patches/server/1020-Properly-resend-entities.patch @@ -102,10 +102,10 @@ index a8debfad8c8e66099f8a9aedc6f1971a8576dade..7796e191747be545e744564a2b0b6579 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 1aa8b914e79c0d48094cc22df60ee9750ec3ccd6..369b3485f452ac157b3ebf88b4f1970605d302d2 100644 +index b548cd98be0f195599cca91b2cfc9258028e1589..e0feae8ac761213221f233eb1a3a0db00f19f902 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -393,7 +393,7 @@ public abstract class PlayerList { +@@ -392,7 +392,7 @@ public abstract class PlayerList { ((ServerLevel)player.level()).getChunkSource().chunkMap.addEntity(player); // Paper - Fire PlayerJoinEvent when Player is actually ready; track entity now // CraftBukkit end @@ -115,7 +115,7 @@ index 1aa8b914e79c0d48094cc22df60ee9750ec3ccd6..369b3485f452ac157b3ebf88b4f19706 this.sendLevelInfo(player, worldserver1); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1a3932aad22be42997c52ac91e19aad06a868526..5608576f461ce9dec9827f9f581adc5d5757baf1 100644 +index 80a77c7e38ce31a4960cf601ae3d3e997bc8f88f..bd8dc3c90f4f5bb31d21f7518b5988c05ecd9f30 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -685,13 +685,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/1023-Improved-Watchdog-Support.patch b/patches/server/1023-Improved-Watchdog-Support.patch index b427707197..43faef7a15 100644 --- a/patches/server/1023-Improved-Watchdog-Support.patch +++ b/patches/server/1023-Improved-Watchdog-Support.patch @@ -220,10 +220,10 @@ index fb3dcce4e1888f96fdd260740d9d955962d879fc..6313726359a1c15ee1d4d93b872849a1 this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index ccfd2c6df3657ff53187a377f573d5f0a182ae4f..b3ead72a2aca870fc607a340df4fc54c5866ac4b 100644 +index f4c6d670e6d88c444a37ce8b08321d373cad3bee..2eb10c11383f40bc80de19542df0379434133c31 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -328,7 +328,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -326,7 +326,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface long j = Util.getNanos() - i; String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D); @@ -232,7 +232,7 @@ index ccfd2c6df3657ff53187a377f573d5f0a182ae4f..b3ead72a2aca870fc607a340df4fc54c if (dedicatedserverproperties.announcePlayerAchievements != null) { ((GameRules.BooleanValue) this.getGameRules().getRule(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)).set(dedicatedserverproperties.announcePlayerAchievements, this.overworld()); // CraftBukkit - per-world } -@@ -462,7 +462,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -460,7 +460,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // this.remoteStatusListener.stop(); // Paper - don't wait for remote connections } @@ -242,7 +242,7 @@ index ccfd2c6df3657ff53187a377f573d5f0a182ae4f..b3ead72a2aca870fc607a340df4fc54c } @Override -@@ -808,7 +809,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -806,7 +807,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @Override public void stopServer() { super.stopServer(); @@ -252,10 +252,10 @@ index ccfd2c6df3657ff53187a377f573d5f0a182ae4f..b3ead72a2aca870fc607a340df4fc54c } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ca9b909a783733f2af1e36f4ac2fd463362b9685..c38c688417f769a6022dd40d6652b00e14c4df94 100644 +index e0feae8ac761213221f233eb1a3a0db00f19f902..1645a40c8ea0f141474549a6d90554478a538087 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -604,7 +604,7 @@ public abstract class PlayerList { +@@ -603,7 +603,7 @@ public abstract class PlayerList { this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); diff --git a/patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch b/patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch index 873271a692..b26d8662e0 100644 --- a/patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch +++ b/patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch @@ -48,10 +48,10 @@ index 1a5e73fd97781f3903e5ef13aa0352c64fbc2cc1..4126d82e83810126eb4a41b4587dc993 entityTrackerEntry.getLastSentYRot(), entity.getType(), diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 23b14afcb5f651a64fd572e49518a7ca36622ec6..530f54a16d853f417e5b5c7cf85d528313364452 100644 +index d8b9fdfa87fc0021fce520989a9008d0e683b50e..d41e9fc71104813a2a9699dff341c0d286b62e81 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1265,6 +1265,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1263,6 +1263,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.serverEntity.addPairing(player); } // Paper end - entity tracking events diff --git a/patches/server/1034-Lag-compensation-ticks.patch b/patches/server/1034-Lag-compensation-ticks.patch index 4b0756516c..02d45887c5 100644 --- a/patches/server/1034-Lag-compensation-ticks.patch +++ b/patches/server/1034-Lag-compensation-ticks.patch @@ -28,10 +28,10 @@ index 6313726359a1c15ee1d4d93b872849a1535539e1..7e5adfddced650cf227b540f3b40573c this.profiler.push(() -> { String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 472655c55b1f5c213da9b6c1940a353bafdac509..86288143a54e1d786672a81c05698b37fa5d8de2 100644 +index 1ff7739206dd2b39b4ceade67bc6dbe2f891e23d..45632568942039e8a8fcc475ba37b2b90ae4845d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -528,6 +528,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -527,6 +527,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. return this.entityTickingChunks; } // Paper end - rewrite chunk system diff --git a/patches/server/1035-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1035-Detail-more-information-in-watchdog-dumps.patch index 56bc2138fb..f678a01069 100644 --- a/patches/server/1035-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/1035-Detail-more-information-in-watchdog-dumps.patch @@ -76,10 +76,10 @@ index f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233..1f7f68aad97ee73763c042837f239bdc }); throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 86288143a54e1d786672a81c05698b37fa5d8de2..1d74a728c03e2c6ffe0e795a5f24eac471a75157 100644 +index 45632568942039e8a8fcc475ba37b2b90ae4845d..35ed192a99154ebc70b426407d20def7e0b9bd2f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1242,7 +1242,26 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1233,7 +1233,26 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } @@ -103,14 +103,14 @@ index 86288143a54e1d786672a81c05698b37fa5d8de2..1d74a728c03e2c6ffe0e795a5f24eac4 + currentlyTickingEntity.lazySet(entity); + } + // Paper end - log detailed entity tick information - ++TimingHistory.entityTicks; // Paper - timings // Spigot start - co.aikar.timings.Timing timer; // Paper -@@ -1282,7 +1301,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. + /*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below + entity.tickCount++; +@@ -1263,6 +1282,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. this.tickPassenger(entity, entity1); } - // } finally { timer.stopTiming(); } // Paper - timings - move up -- + ++ // } finally { timer.stopTiming(); } // Paper - timings - move up + // Paper start - log detailed entity tick information + } finally { + if (currentlyTickingEntity.get() == entity) { diff --git a/patches/server/1036-Write-SavedData-IO-async.patch b/patches/server/1036-Write-SavedData-IO-async.patch index 2227ee2520..09bc177d46 100644 --- a/patches/server/1036-Write-SavedData-IO-async.patch +++ b/patches/server/1036-Write-SavedData-IO-async.patch @@ -24,10 +24,10 @@ index 9e282fabc6815393e4183aebefe112305bf2ff2c..74c39ffd7add898d8604cd2338181125 // CraftBukkit start - modelled on below diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1d74a728c03e2c6ffe0e795a5f24eac471a75157..46e8dd8dae25e1b2124e9c8031844fbe96eb6e1a 100644 +index 35ed192a99154ebc70b426407d20def7e0b9bd2f..36e062d52cda00ef47ae01f9ebcd0e592be52f30 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1373,7 +1373,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1354,7 +1354,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } @@ -36,7 +36,7 @@ index 1d74a728c03e2c6ffe0e795a5f24eac471a75157..46e8dd8dae25e1b2124e9c8031844fbe if (progressListener != null) { progressListener.progressStage(Component.translatable("menu.savingChunks")); } -@@ -1404,12 +1404,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1382,12 +1382,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. // CraftBukkit end } diff --git a/patches/server/1039-Incremental-chunk-and-player-saving.patch b/patches/server/1039-Incremental-chunk-and-player-saving.patch index 7e4b6dd229..d1e518c623 100644 --- a/patches/server/1039-Incremental-chunk-and-player-saving.patch +++ b/patches/server/1039-Incremental-chunk-and-player-saving.patch @@ -56,10 +56,10 @@ index 7e5adfddced650cf227b540f3b40573cdf5b0f7c..8160c35368fc2c52d6f4a42df27adb2e try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { this.runAllTasks(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 46e8dd8dae25e1b2124e9c8031844fbe96eb6e1a..2766ec28f028c0bd672009928bf64c1a6e5d07d6 100644 +index 36e062d52cda00ef47ae01f9ebcd0e592be52f30..25a031c749d737cbe45cc16ad3a09cb5e46778d1 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1358,6 +1358,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1340,6 +1340,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos); } @@ -108,10 +108,10 @@ index dddd4fcdcd08e0221693071894818c7d3bae531b..5980b70e2d7273239245237189b2debc private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; private static final int FLY_STAT_RECORDING_SPEED = 25; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d4d21bea5 100644 +index 1645a40c8ea0f141474549a6d90554478a538087..f9141e1997ef88ff5478d4a01b6bc719125631f2 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -569,6 +569,7 @@ public abstract class PlayerList { +@@ -568,6 +568,7 @@ public abstract class PlayerList { protected void save(ServerPlayer player) { if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit @@ -119,7 +119,7 @@ index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d this.playerIo.save(player); ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit -@@ -1183,10 +1184,22 @@ public abstract class PlayerList { +@@ -1182,9 +1183,21 @@ public abstract class PlayerList { } public void saveAll() { @@ -129,7 +129,6 @@ index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d + + public void saveAll(int interval) { io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main - MinecraftTimings.savePlayers.startTiming(); // Paper + int numSaved = 0; + long now = MinecraftServer.currentTick; for (int i = 0; i < this.players.size(); ++i) { @@ -141,5 +140,5 @@ index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d + } + // Paper end - Incremental chunk and player saving } - MinecraftTimings.savePlayers.stopTiming(); // Paper return null; }); // Paper - ensure main + } diff --git a/patches/server/1043-Bundle-spark.patch b/patches/server/1043-Bundle-spark.patch index 67b496a88c..f81d34c1e1 100644 --- a/patches/server/1043-Bundle-spark.patch +++ b/patches/server/1043-Bundle-spark.patch @@ -313,10 +313,10 @@ index 8160c35368fc2c52d6f4a42df27adb2ef6eb87f3..9325d6f95165a7cee00d7de736af7236 this.profiler.push("tallying"); long j = Util.getNanos() - i; diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index d43b98bdfcb00603737a309c0fb7793d42289b8c..dd56c8e041116ef3602a9f89c998c8208ab89b51 100644 +index 2eb10c11383f40bc80de19542df0379434133c31..cf0fc4bfcbae8fb152f4548b6a17becce702bde6 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -226,6 +226,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -224,6 +224,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Paper end - initialize global and world-defaults configuration @@ -324,7 +324,7 @@ index d43b98bdfcb00603737a309c0fb7793d42289b8c..dd56c8e041116ef3602a9f89c998c820 // Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save if (this.convertOldUsers()) { this.getProfileCache().save(false); // Paper -@@ -235,6 +236,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -233,6 +234,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command |