diff options
author | Nassim Jahnke <[email protected]> | 2024-01-25 10:54:46 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-01-25 12:10:23 +0100 |
commit | b03f255532bba5a1398f03207756f42e5597ccb8 (patch) | |
tree | a420815beecbcd8bdd4dbb4ca2275ac7827c0033 | |
parent | 1831240d1c48086fc0199584787cd2013d4d4b5f (diff) | |
download | Paper-b03f255532bba5a1398f03207756f42e5597ccb8.tar.gz Paper-b03f255532bba5a1398f03207756f42e5597ccb8.zip |
Finish moving patches back and improving compilable state
163 files changed, 466 insertions, 411 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 26b152ecfd..1bdd52c2e4 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -10,6 +10,7 @@ public org.bukkit.craftbukkit.inventory.CraftItemStack handle public net.minecraft.server.level.ChunkMap getVisibleChunkIfPresent(J)Lnet/minecraft/server/level/ChunkHolder; public net.minecraft.server.level.ServerChunkCache mainThreadProcessor public net.minecraft.server.level.ServerChunkCache$MainThreadExecutor +public net.minecraft.world.level.chunk.LevelChunkSection states diff --git a/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java b/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java new file mode 100644 diff --git a/patches/server/0017-Add-TickThread.patch b/patches/server/0015-Add-TickThread.patch index bf8c922243..bf8c922243 100644 --- a/patches/server/0017-Add-TickThread.patch +++ b/patches/server/0015-Add-TickThread.patch diff --git a/patches/server/1041-Further-improve-server-tick-loop.patch b/patches/server/0016-Further-improve-server-tick-loop.patch index 902156f89f..1e0b03efb3 100644 --- a/patches/server/1041-Further-improve-server-tick-loop.patch +++ b/patches/server/0016-Further-improve-server-tick-loop.patch @@ -12,28 +12,29 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 709698179e8da694c447221f0449e33ebd9b3c9f..23d2264dfc4f763a7198eb543e7f86a5a5aa85c3 100644 +index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..f32aa4e03ae02d1449101c4aa89c8e0c0fa26ba5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -292,7 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - public org.bukkit.craftbukkit.CraftServer server; +@@ -283,7 +283,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public OptionSet options; public org.bukkit.command.ConsoleCommandSender console; + public ConsoleReader reader; - public static int currentTick = (int) (System.currentTimeMillis() / 50); -+ public static int currentTick = 0; // Paper - Further improve tick loop ++ public static int currentTick; // Paper - improve tick loop public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -301,7 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -292,7 +292,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Spigot start public static final int TPS = 20; public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS; - private static final int SAMPLE_INTERVAL = 100; -+ private static final int SAMPLE_INTERVAL = 20; // Paper ++ private static final int SAMPLE_INTERVAL = 20; // Paper - improve server tick loop ++ @Deprecated(forRemoval = true) // Paper public final double[] recentTps = new double[ 3 ]; // Spigot end public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files -@@ -1068,6 +1068,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -998,6 +999,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa { return ( avg * exp ) + ( tps * ( 1 - exp ) ); } @@ -90,61 +91,65 @@ index 709698179e8da694c447221f0449e33ebd9b3c9f..23d2264dfc4f763a7198eb543e7f86a5 + // Paper end // Spigot End - public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system -@@ -1098,7 +1149,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - org.spigotmc.WatchdogThread.tick(); // Paper - org.spigotmc.WatchdogThread.hasStarted = true; // Paper + protected void runServer() { +@@ -1012,7 +1064,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + + // Spigot start Arrays.fill( this.recentTps, 20 ); - long tickSection = Util.getMillis(), tickCount = 1; -+ long tickSection = Util.getNanos(), curTime, tickCount = 1; // Paper ++ // Paper start - further improve server tick loop ++ long tickSection = Util.getNanos(); ++ long currentTime; ++ // Paper end - further improve server tick loop while (this.running) { - // Paper start - rewrite chunk system - // guarantee that nothing can stop the server from halting if it can at least still tick -@@ -1127,15 +1178,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + long i; + +@@ -1035,15 +1090,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } // Spigot start ++MinecraftServer.currentTickLong; // Paper - track current tick as a long - if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) -+ if ( ++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0 ) // Paper - { +- { - long curTime = Util.getMillis(); - double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL; - this.recentTps[0] = MinecraftServer.calcTps( this.recentTps[0], 0.92, currentTps ); // 1/exp(5sec/1min) - this.recentTps[1] = MinecraftServer.calcTps( this.recentTps[1], 0.9835, currentTps ); // 1/exp(5sec/5min) - this.recentTps[2] = MinecraftServer.calcTps( this.recentTps[2], 0.9945, currentTps ); // 1/exp(5sec/15min) -+ // Paper start -+ curTime = Util.getNanos(); -+ final long diff = curTime - tickSection; -+ java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); +- tickSection = curTime; ++ // Paper start - further improve server tick loop ++ currentTime = Util.getNanos(); ++ if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) { ++ final long diff = currentTime - tickSection; ++ final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); + tps1.add(currentTps, diff); + tps5.add(currentTps, diff); + tps15.add(currentTps, diff); ++ + // Backwards compat with bad plugins + this.recentTps[0] = tps1.getAverage(); + this.recentTps[1] = tps5.getAverage(); + this.recentTps[2] = tps15.getAverage(); -+ // Paper end - tickSection = curTime; -- } -+ } else curTime = Util.getNanos(); // Paper ++ tickSection = currentTime; + } ++ // Paper end - further improve server tick loop // Spigot end boolean flag = i == 0L; -@@ -1145,7 +1203,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1053,7 +1115,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount); } - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time -+ lastTick = curTime; ++ lastTick = currentTime; this.nextTickTimeNanos += i; this.startMetricsRecordingTick(); this.profiler.push("tick"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index afb4fa8fa124ed0154762962a3fe59164e968c7c..25f41119bcc19bab7cd2fdb044147b3f78a8ef1c 100644 +index b1d0e9caed38b6a264b7ea8e508be103d3d0664e..33b6605d1139e83a09054b6ed140e129e65a954d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -3026,7 +3026,11 @@ public final class CraftServer implements Server { +@@ -2600,7 +2600,11 @@ public final class CraftServer implements Server { @Override public double[] getTPS() { diff --git a/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch index 7f6e9cc1b9..5dc280deb7 100644 --- a/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/server/0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b1d0e9caed38b6a264b7ea8e508be103d3d0664e..cfac91359e6084082fffd769fc8ce91f75717b1d 100644 +index 33b6605d1139e83a09054b6ed140e129e65a954d..3b2f99617a519c2c2f60b88a4679064c01e5d958 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -422,6 +422,35 @@ public final class CraftServer implements Server { diff --git a/patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch b/patches/server/0018-Keep-previous-behavior-for-setResourcePack.patch index 75e35125d1..66ef197e55 100644 --- a/patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch +++ b/patches/server/0018-Keep-previous-behavior-for-setResourcePack.patch @@ -10,10 +10,10 @@ packs before sending the new pack. Other API exists for adding a new pack to the existing packs on a client. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 838ea7a08df425adac7986d1bc6bf13ca8ce956b..51a63de2e0bb43c35cd9b8e6c431ec81fc9aecd1 100644 +index 86802dee856ec0a5342c35ace716b6d66b093ccd..6802d5a06741f8e71d8a042993e364557a62b20e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2309,8 +2309,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1788,8 +1788,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (hash != null) { Preconditions.checkArgument(hash.length == 20, "Resource pack hash should be 20 bytes long but was %s", hash.length); diff --git a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index d395a0f02a..139de64984 100644 --- a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..de8b12b5014e653cb96d422c74307c7fbfd1b5b5 100644 +index c99da8c4810385600470a0c3b4c03670edd0759b..107a04f6c5889e98c183a932ad158fb5b6591a10 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1552,7 +1552,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1615,7 +1615,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @DontObfuscate public String getServerModName() { @@ -19,7 +19,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..de8b12b5014e653cb96d422c74307c7f public SystemReport fillSystemReport(SystemReport details) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cfac91359e6084082fffd769fc8ce91f75717b1d..4fbc98bc2fe808a15f974b0abf614781fe66e1c4 100644 +index 3b2f99617a519c2c2f60b88a4679064c01e5d958..9b85ec9e9a66a5bc0c98598531102f01e597f525 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -261,7 +261,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; diff --git a/patches/server/0030-Player-affects-spawning-API.patch b/patches/server/0030-Player-affects-spawning-API.patch index d20d31285c..3bd3c2e637 100644 --- a/patches/server/0030-Player-affects-spawning-API.patch +++ b/patches/server/0030-Player-affects-spawning-API.patch @@ -135,10 +135,10 @@ index b6a3c75b84d9f768afee33aa0f226207b307c1c0..07e7851ca27ea0f8166be52b086a6504 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cf8a5b3ba642d4829725bc488c074b1b3b142867..aefd38e71c7c664e3eaa366b5546bb1999c2f2c8 100644 +index 6802d5a06741f8e71d8a042993e364557a62b20e..243c4ab34922171e67fe9dfd3307c71910c9d082 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2270,6 +2270,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2272,6 +2272,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().language; } diff --git a/patches/server/0031-Only-refresh-abilities-if-needed.patch b/patches/server/0031-Only-refresh-abilities-if-needed.patch index 227e06994d..e37473a715 100644 --- a/patches/server/0031-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0031-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index aefd38e71c7c664e3eaa366b5546bb1999c2f2c8..eb021cd3d2eb1d4c3f4f2f42b9dbb69572fe98de 100644 +index 243c4ab34922171e67fe9dfd3307c71910c9d082..3479728bc4dc1df00e207feb1a5494d9997582ea 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1942,12 +1942,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1944,12 +1944,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch b/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch index 302f19b864..857d78d6c7 100644 --- a/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch +++ b/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch @@ -44,10 +44,10 @@ index b300d12e9e00519028b53aca9c3fb01f589eaa91..66757716b401d4f5b690c895effbbaa4 } } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..e7cfac251ebef4eda9105c4f64783a9bc3e0e59e 100644 +index c2179ea2a16ae0fac0b59d81a57abf13f563843f..e764eecfb2eea62d641c9444831daae6d50c687e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -1069,11 +1069,11 @@ public class LevelChunk extends ChunkAccess { +@@ -1063,11 +1063,11 @@ public class LevelChunk extends ChunkAccess { gameprofilerfiller.pop(); } catch (Throwable throwable) { diff --git a/patches/server/0040-Optimize-explosions.patch b/patches/server/0040-Optimize-explosions.patch index aba69e531a..7ecbc0cda4 100644 --- a/patches/server/0040-Optimize-explosions.patch +++ b/patches/server/0040-Optimize-explosions.patch @@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index de8b12b5014e653cb96d422c74307c7fbfd1b5b5..cb7dcb4dc310f1857600b340e4101e2829fcf6b6 100644 +index 107a04f6c5889e98c183a932ad158fb5b6591a10..455f72f2a653154d4528c53d39866d3cd85b6862 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1426,6 +1426,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1489,6 +1489,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.profiler.pop(); this.profiler.pop(); diff --git a/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch index f91b88be6f..5936a7c31a 100644 --- a/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch @@ -39,10 +39,10 @@ index c1006a1991e294fa69b1eb35f4224154b064671b..b0a548ed0abbe08df2cae771248a811f // CraftBukkit end this.language = clientOptions.language(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index eb021cd3d2eb1d4c3f4f2f42b9dbb69572fe98de..70a5ced9e39d6ce0e38f9ee04883584f40d49971 100644 +index 3479728bc4dc1df00e207feb1a5494d9997582ea..2de311e8c9bc37bf8c1fb1234a9fc6df30d5aaab 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2268,7 +2268,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2270,7 +2270,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/server/0060-Add-exception-reporting-event.patch b/patches/server/0060-Add-exception-reporting-event.patch index ce97e0a5ba..9406646b7d 100644 --- a/patches/server/0060-Add-exception-reporting-event.patch +++ b/patches/server/0060-Add-exception-reporting-event.patch @@ -131,7 +131,7 @@ index 5d65baba605dd83e5f74d526aeda36d8ede8c014..604766a286d00bb4b40c20482376fe80 } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index e7cfac251ebef4eda9105c4f64783a9bc3e0e59e..30c0f59d521de5e7c9d5bbc0a7f1f272e165f389 100644 +index e764eecfb2eea62d641c9444831daae6d50c687e..53c10ed58451c317e6d45f34d6eca3072155b814 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1,6 +1,7 @@ @@ -142,7 +142,7 @@ index e7cfac251ebef4eda9105c4f64783a9bc3e0e59e..30c0f59d521de5e7c9d5bbc0a7f1f272 import com.google.common.collect.Maps; import com.google.common.collect.UnmodifiableIterator; import com.mojang.logging.LogUtils; -@@ -580,10 +581,16 @@ public class LevelChunk extends ChunkAccess { +@@ -574,10 +575,16 @@ public class LevelChunk extends ChunkAccess { // CraftBukkit start } else { @@ -163,7 +163,7 @@ index e7cfac251ebef4eda9105c4f64783a9bc3e0e59e..30c0f59d521de5e7c9d5bbc0a7f1f272 // CraftBukkit end } } -@@ -1072,6 +1079,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1066,6 +1073,7 @@ public class LevelChunk extends ChunkAccess { // Paper start - Prevent block entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); diff --git a/patches/server/0064-Complete-resource-pack-API.patch b/patches/server/0064-Complete-resource-pack-API.patch index 0e8f9bbf86..d3daf2b722 100644 --- a/patches/server/0064-Complete-resource-pack-API.patch +++ b/patches/server/0064-Complete-resource-pack-API.patch @@ -22,7 +22,7 @@ index c8041492b7b2a1ff67b95d9944cfccd476b3ee1d..66497960995dc30abe60d26200979a78 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2de70507a03e662afa45dd9f2e3c28c857a8037c..5042d57ae8bf8cadcb22c89f6bb80724a0480f96 100644 +index 02cb029b436850456daea7bcf646ff754e0aada2..610fcc99098780608afede7ed4a59cef36daaffa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -189,6 +189,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -33,7 +33,7 @@ index 2de70507a03e662afa45dd9f2e3c28c857a8037c..5042d57ae8bf8cadcb22c89f6bb80724 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -1955,6 +1956,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1957,6 +1958,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end - adventure diff --git a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch index cff5149940..9e511f0e9e 100644 --- a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9bec3b0d5c7eaccb334e2663bb1fdc42cd6eb367..d2d2cc70eac66d503efe89ded205f1a904c95a26 100644 +index b473527d5ccfa4ab196b4c94601dea5b694034b1..dc98b67f462e6d055d9098903a3ee59ff1e04000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2714,5 +2714,23 @@ public final class CraftServer implements Server { +@@ -2718,5 +2718,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 89e4f5707b..2eaca84cd9 100644 --- a/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -44,10 +44,10 @@ index 3179fc1b33f503b0cdd462ad160edee760b5a7eb..428a9d21b24e9c349bf766c16172ffd9 protected void internalSetAbsorptionAmount(float absorptionAmount) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5042d57ae8bf8cadcb22c89f6bb80724a0480f96..bfbd69635c4a2565cc9a72147ff9585efe40e861 100644 +index 610fcc99098780608afede7ed4a59cef36daaffa..1b7010f4d191ee08e250cdf27f5fd9e9bfa0abdd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2190,6 +2190,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2192,6 +2192,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 004b7f442f..2d055497e4 100644 --- a/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cb7dcb4dc310f1857600b340e4101e2829fcf6b6..07bd44752a8af3e44577484416b89c9acaa3769b 100644 +index 455f72f2a653154d4528c53d39866d3cd85b6862..36de11970c3cb605357ec5c49d0654a43263bc00 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1394,6 +1394,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1457,6 +1457,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); @@ -18,7 +18,7 @@ index cb7dcb4dc310f1857600b340e4101e2829fcf6b6..07bd44752a8af3e44577484416b89c9a this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 22f6260ffa7b9fb2f5f226e505e81b3e29760437..b4fdcfa28347beafe75339782d6e0cd7fc0b6256 100644 +index a127acc6c44bfd078e06c74b408d62df6e85d1fe..5975cc2fa72609ea5f3e6f99155d6e5bc321a321 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch index 4e2e1411a2..e803f0aa2e 100644 --- a/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch +++ b/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch @@ -11,10 +11,10 @@ For people who want all chunks to be treated equally, you can chose a fixed valu This allows to fine-tune vanilla gameplay. diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 30c0f59d521de5e7c9d5bbc0a7f1f272e165f389..8288be49fc0fbedefef799cb1038d5f79b7cf0a3 100644 +index 53c10ed58451c317e6d45f34d6eca3072155b814..82b59b7c791216aaaaaaf2972f47bd21dac7a202 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -276,6 +276,13 @@ public class LevelChunk extends ChunkAccess { +@@ -270,6 +270,13 @@ public class LevelChunk extends ChunkAccess { return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks); } diff --git a/patches/server/0086-Configurable-Player-Collision.patch b/patches/server/0086-Configurable-Player-Collision.patch index 2ba0e44020..481f34f9ff 100644 --- a/patches/server/0086-Configurable-Player-Collision.patch +++ b/patches/server/0086-Configurable-Player-Collision.patch @@ -18,10 +18,10 @@ index 3d2a689d11bfa230bab61a2a65c6051328f6b78d..cf31771648549ab6d7e4e38b30409ca4 buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerSuffix); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 07bd44752a8af3e44577484416b89c9acaa3769b..8d81dcd07a5a9d32d19ff5b4d246dae503651ebd 100644 +index 36de11970c3cb605357ec5c49d0654a43263bc00..2ce3a54a63b207940690508a277fae39baa032c3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -621,6 +621,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -622,6 +622,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); } diff --git a/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch index 161ba56244..5d83e9eede 100644 --- a/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch +++ b/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8d81dcd07a5a9d32d19ff5b4d246dae503651ebd..635fdf6f809667d3981ca88e1c71bdeff4c80030 100644 +index 2ce3a54a63b207940690508a277fae39baa032c3..712157ed10bff3ea5bc348623c4539990dbfc6fa 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -190,6 +190,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -17,7 +17,7 @@ index 8d81dcd07a5a9d32d19ff5b4d246dae503651ebd..635fdf6f809667d3981ca88e1c71bdef public static final Logger LOGGER = LogUtils.getLogger(); public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper public static final String VANILLA_BRAND = "vanilla"; -@@ -320,6 +321,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -321,6 +322,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { super("Server"); @@ -25,7 +25,7 @@ index 8d81dcd07a5a9d32d19ff5b4d246dae503651ebd..635fdf6f809667d3981ca88e1c71bdef this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.profiler = this.metricsRecorder.getProfiler(); this.onMetricsRecordingStopped = (methodprofilerresults) -> { -@@ -2367,9 +2369,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2430,9 +2432,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa return false; } diff --git a/patches/server/0095-Async-GameProfileCache-saving.patch b/patches/server/0095-Async-GameProfileCache-saving.patch index 1ee3311398..a2b1d603c0 100644 --- a/patches/server/0095-Async-GameProfileCache-saving.patch +++ b/patches/server/0095-Async-GameProfileCache-saving.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Async GameProfileCache saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 635fdf6f809667d3981ca88e1c71bdeff4c80030..730dab49d8216ed458a8d75e873cf5e949b4e4c0 100644 +index 712157ed10bff3ea5bc348623c4539990dbfc6fa..1429dd8ca37e0b268304b92596fea316706e5c01 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -979,7 +979,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -980,7 +980,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } catch (java.lang.InterruptedException ignored) {} // Paper if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { MinecraftServer.LOGGER.info("Saving usercache.json"); diff --git a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch index 88538b7546..5647fd9d54 100644 --- a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 040d5fa985f746d90e144b668ebb2adb79c33daa..d2fe67471259738a1008460d3364fb8650fe3811 100644 +index 49a0cb59ae1ad6b5f45c15c71ccf9680e2d2b764..f120e614ab3d4e646ddc675f76f0a637deae598a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2740,5 +2740,24 @@ public final class CraftServer implements Server { +@@ -2744,5 +2744,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch index d7fb293ae3..b9529845fa 100644 --- a/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch @@ -30,7 +30,7 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 730dab49d8216ed458a8d75e873cf5e949b4e4c0..0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4 100644 +index 1429dd8ca37e0b268304b92596fea316706e5c01..5ec728f6000753d517d943562efb55ad2541b01c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -236,6 +236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -41,7 +41,7 @@ index 730dab49d8216ed458a8d75e873cf5e949b4e4c0..0b4b9b0dc80db7cc0287ccdfcdc0cb73 private boolean stopped; private int tickCount; private int ticksUntilAutosave; -@@ -918,7 +919,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -919,7 +920,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.playerList != null) { MinecraftServer.LOGGER.info("Saving players"); this.playerList.saveAll(); @@ -50,7 +50,7 @@ index 730dab49d8216ed458a8d75e873cf5e949b4e4c0..0b4b9b0dc80db7cc0287ccdfcdc0cb73 try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets } -@@ -998,6 +999,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -999,6 +1000,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } public void halt(boolean waitForShutdown) { diff --git a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch index 2a670523e4..371cc6b752 100644 --- a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d2fe67471259738a1008460d3364fb8650fe3811..e1403914e740f8fa9edc5381593926af99dfb5aa 100644 +index f120e614ab3d4e646ddc675f76f0a637deae598a..30ef05974f5645e0769cb1604290a4c8045501c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2759,5 +2759,10 @@ public final class CraftServer implements Server { +@@ -2763,5 +2763,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch index 982c6a87c8..3912c54586 100644 --- a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -250,7 +250,7 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4..e63fc78259cc802251450e6d73f9837ebcd2f4e6 100644 +index 5ec728f6000753d517d943562efb55ad2541b01c..dad61777658cafaaae56928f3492075067149fd8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -155,7 +155,7 @@ import org.slf4j.Logger; @@ -267,10 +267,10 @@ index 0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4..e63fc78259cc802251450e6d73f9837e public OptionSet options; public org.bukkit.command.ConsoleCommandSender console; - public ConsoleReader reader; - public static int currentTick = (int) (System.currentTimeMillis() / 50); + public static int currentTick; // Paper - improve tick loop public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public int autosavePeriod; -@@ -370,7 +369,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -371,7 +370,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.options = options; this.worldLoader = worldLoader; this.vanillaCommandDispatcher = worldstem.dataPackResources().commands; // CraftBukkit @@ -280,7 +280,7 @@ index 0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4..e63fc78259cc802251450e6d73f9837e if (System.console() == null && System.getProperty("jline.terminal") == null) { System.setProperty("jline.terminal", "jline.UnsupportedTerminal"); Main.useJline = false; -@@ -391,6 +392,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -392,6 +393,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftServer.LOGGER.warn((String) null, ex); } } @@ -289,7 +289,7 @@ index 0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4..e63fc78259cc802251450e6d73f9837e Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); // CraftBukkit end this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files -@@ -1124,7 +1127,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1187,7 +1190,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa org.spigotmc.WatchdogThread.doStop(); // Spigot // CraftBukkit start - Restore terminal to original settings try { @@ -298,7 +298,7 @@ index 0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4..e63fc78259cc802251450e6d73f9837e } catch (Exception ignored) { } // CraftBukkit end -@@ -1622,7 +1625,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1685,7 +1688,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public void sendSystemMessage(Component message) { @@ -386,7 +386,7 @@ index 40af2325afea3e4831a9d8795ce1932a6a5663bf..db4480778e4b917a073c61f29cd45663 this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e1403914e740f8fa9edc5381593926af99dfb5aa..924dac8bc6b35c834e64512f036503b0ac365579 100644 +index 30ef05974f5645e0769cb1604290a4c8045501c8..883c053baea5968a978f1619ebb170647fe15eef 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -42,7 +42,7 @@ import java.util.logging.Level; diff --git a/patches/server/0135-Basic-PlayerProfile-API.patch b/patches/server/0135-Basic-PlayerProfile-API.patch index f23495f9fb..1793add7cc 100644 --- a/patches/server/0135-Basic-PlayerProfile-API.patch +++ b/patches/server/0135-Basic-PlayerProfile-API.patch @@ -612,7 +612,7 @@ index adb472c175cc6f6ced7075a37423d6c898fd5ccb..1ec0f3a7148c2f412421772f6e1dff0b String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 924dac8bc6b35c834e64512f036503b0ac365579..7678b7eb8561bca272bdb26de5a9f96bd18d005d 100644 +index 883c053baea5968a978f1619ebb170647fe15eef..22f5ff1e6f03fc46eb05eaf95ca6f8e2bac1f894 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -260,6 +260,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -633,7 +633,7 @@ index 924dac8bc6b35c834e64512f036503b0ac365579..7678b7eb8561bca272bdb26de5a9f96b CraftItemFactory.instance(); } -@@ -2768,5 +2772,42 @@ public final class CraftServer implements Server { +@@ -2772,5 +2776,42 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch index cfcace7005..c345e2ae2a 100644 --- a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch @@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e63fc78259cc802251450e6d73f9837ebcd2f4e6..1f5f8c7398e974fc8771265b1bc27f68065f944a 100644 +index dad61777658cafaaae56928f3492075067149fd8..eb305e3e4e6574637cd20f99ca979be8acd09e9b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,6 +3,9 @@ package net.minecraft.server; @@ -194,7 +194,7 @@ index e63fc78259cc802251450e6d73f9837ebcd2f4e6..1f5f8c7398e974fc8771265b1bc27f68 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1370,7 +1373,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1433,7 +1436,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.hidesOnlinePlayers()) { return new ServerStatus.Players(i, list.size(), List.of()); } else { diff --git a/patches/server/0182-Flag-to-disable-the-channel-limit.patch b/patches/server/0182-Flag-to-disable-the-channel-limit.patch index d721760e58..eb174b84df 100644 --- a/patches/server/0182-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0182-Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0f78ff8b4a7143388416563d964c467d29617b36..e0ce56ab1a1980800402e55ee49df3b896afee60 100644 +index 7ca0b3661ec8f1e1060b8e6d93e8c5d5a98f4d23..5eef491a3081973edb64b31710099c736c6dcd4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -190,6 +190,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -20,7 +20,7 @@ index 0f78ff8b4a7143388416563d964c467d29617b36..e0ce56ab1a1980800402e55ee49df3b8 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2118,7 +2119,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2120,7 +2121,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch index a13023571d..61218d8b3c 100644 --- a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,17 +9,17 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1f5f8c7398e974fc8771265b1bc27f68065f944a..bfd405397f685021fdba7780e3709e29ccc89bec 100644 +index eb305e3e4e6574637cd20f99ca979be8acd09e9b..e1d8eae931f6eb7ddfca1d6dadcb28fec08ccede 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1040,6 +1040,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1092,6 +1092,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.status = this.buildServerStatus(); // Spigot start + org.spigotmc.WatchdogThread.hasStarted = true; // Paper Arrays.fill( this.recentTps, 20 ); - long tickSection = Util.getMillis(), tickCount = 1; - while (this.running) { + // 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 6aede562955799fae90a1234b6300ba3a91ba2f2..333647f4328c29afffdc2b0de5abeec731959c59 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -33,7 +33,7 @@ index 6aede562955799fae90a1234b6300ba3a91ba2f2..333647f4328c29afffdc2b0de5abeec7 com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d4c3d9a45c01d462513e5dbfa514afdde32c9ad7..4958a3715a3d09e6d956ca8cc8201f11e3ebc3a4 100644 +index 6bbbea27834c4f628fbd97fa282dc1a3a991f523..a880bc79f139633d5a6aa9a0fa290c691abdcf98 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -915,6 +915,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0238-Optimize-CraftBlockData-Creation.patch b/patches/server/0238-Optimize-CraftBlockData-Creation.patch index 6cf8e3c2f4..363405cffd 100644 --- a/patches/server/0238-Optimize-CraftBlockData-Creation.patch +++ b/patches/server/0238-Optimize-CraftBlockData-Creation.patch @@ -7,12 +7,12 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData and cloning it when one is needed. diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index a009fca54665cbc3f11cad776256fbf1fbbb18c7..7e4264f87a0f81db71d49dbede32a1bad87f7ca8 100644 +index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..6f60622f2dad5f82fb24505612e7e3a32722ab93 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -876,6 +876,14 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -875,6 +875,14 @@ public abstract class BlockBehaviour implements FeatureElement { + this.instrument = blockbase_info.instrument; this.replaceable = blockbase_info.replaceable; - this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper } + // Paper start - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time + private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; diff --git a/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch index 77a374f53f..aae8de7dec 100644 --- a/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 28b51b1ecf54f9a43678d21cd1b40da32a63d645..5f6c911cc2573be616f80faa609e372f9195ed81 100644 +index 57b5f5c13a5e397e153f06d7f60d3177ee59e91c..fff6d3d50df7bdf91a1fb48c97ee6ee4cf06a7e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2829,6 +2829,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2831,6 +2831,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0246-Improve-death-events.patch b/patches/server/0246-Improve-death-events.patch index e5c7c6d987..54d223ef8a 100644 --- a/patches/server/0246-Improve-death-events.patch +++ b/patches/server/0246-Improve-death-events.patch @@ -402,10 +402,10 @@ index ecce8036e58a9ed1408e110e75980bf77c18779a..ddd512e1d7608ec051fb5adf6ec2c6bb this.gameEvent(GameEvent.ENTITY_DIE); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5f6c911cc2573be616f80faa609e372f9195ed81..c3af502148a700892ac86d56bcb4f05703d98160 100644 +index fff6d3d50df7bdf91a1fb48c97ee6ee4cf06a7e8..4dce0bc472a7a210680d86e90828749766908afd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2366,7 +2366,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2368,7 +2368,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendHealthUpdate() { FoodData foodData = this.getHandle().getFoodData(); diff --git a/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index c8429932e8..a69c32f792 100644 --- a/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -92,10 +92,10 @@ index aa52b271bd556a29f774fde375b713d0d187521b..765e4bc00a0526aab6e263dae7233f63 return executorService; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bfd405397f685021fdba7780e3709e29ccc89bec..6cac85b9a05a522d71e2fd91b3d8486c06ee976b 100644 +index e1d8eae931f6eb7ddfca1d6dadcb28fec08ccede..be757de5b307bd8233c20f907f5d5d112761c362 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa thread.setUncaughtExceptionHandler((thread1, throwable) -> { MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable); }); diff --git a/patches/server/0269-Optimize-World-Time-Updates.patch b/patches/server/0269-Optimize-World-Time-Updates.patch index 663d4d1495..46bbe6ded4 100644 --- a/patches/server/0269-Optimize-World-Time-Updates.patch +++ b/patches/server/0269-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6cac85b9a05a522d71e2fd91b3d8486c06ee976b..2c2bdbdf7e4a27784d7b019accfe83987b4cf120 100644 +index be757de5b307bd8233c20f907f5d5d112761c362..fe0fde11e6d6bbe77a739c582a936c378b81a79c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1415,12 +1415,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1478,12 +1478,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper // Send time updates to everyone, it will get the right time from the world the player is in. diff --git a/patches/server/0273-Make-the-default-permission-message-configurable.patch b/patches/server/0273-Make-the-default-permission-message-configurable.patch index d78a479f47..98e585f560 100644 --- a/patches/server/0273-Make-the-default-permission-message-configurable.patch +++ b/patches/server/0273-Make-the-default-permission-message-configurable.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index de0e1ad2c78e5132651494f198703533847c84bd..830978f3409888302ab857161628cee5869efa8f 100644 +index 6d06b772ffb9d47d6a717462a4b2b494544e80ae..69ffd6ea2ce7c6d4f211c6081fcea79afd7eac6c 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -74,7 +74,7 @@ public final class PaperCommand extends Command { +@@ -73,7 +73,7 @@ public final class PaperCommand extends Command { if (sender.hasPermission(BASE_PERM + permission) || sender.hasPermission("bukkit.command.paper")) { return true; } @@ -18,10 +18,10 @@ index de0e1ad2c78e5132651494f198703533847c84bd..830978f3409888302ab857161628cee5 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4958a3715a3d09e6d956ca8cc8201f11e3ebc3a4..3ff493a3a0f679d894d8f60712811e20f5d986a0 100644 +index a880bc79f139633d5a6aa9a0fa290c691abdcf98..663ad8d391d81e7bbdf8b4ec4a8232b5b10954b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2801,6 +2801,16 @@ public final class CraftServer implements Server { +@@ -2805,6 +2805,16 @@ public final class CraftServer implements Server { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/server/0283-Async-command-map-building.patch b/patches/server/0283-Async-command-map-building.patch index 3a56e3ca42..7fc7c5d6a9 100644 --- a/patches/server/0283-Async-command-map-building.patch +++ b/patches/server/0283-Async-command-map-building.patch @@ -53,10 +53,10 @@ index 15a5059994371da4850adcf726034a715b80efba..af7cb518a32a4d550eae833fdd5bb17f event.getPlayer().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2c2bdbdf7e4a27784d7b019accfe83987b4cf120..71dc0ba14333f0e924dc61856799db94b0cd9651 100644 +index fe0fde11e6d6bbe77a739c582a936c378b81a79c..e5ef4cba08031f0e35f127fa661b071d7872e7db 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -915,6 +915,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -916,6 +916,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } MinecraftServer.LOGGER.info("Stopping server"); diff --git a/patches/server/0292-Server-Tick-Events.patch b/patches/server/0292-Server-Tick-Events.patch index f29930ff8e..97aeee8265 100644 --- a/patches/server/0292-Server-Tick-Events.patch +++ b/patches/server/0292-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 71dc0ba14333f0e924dc61856799db94b0cd9651..8d70cbc6e11656d170bde37b5f101902b0b6ee2e 100644 +index e5ef4cba08031f0e35f127fa661b071d7872e7db..1f23b277d5c1be48a3cfe7b6c9248a0b2bd95e4b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1294,6 +1294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1357,6 +1357,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); // Paper end @@ -17,7 +17,7 @@ index 71dc0ba14333f0e924dc61856799db94b0cd9651..8d70cbc6e11656d170bde37b5f101902 ++this.tickCount; this.tickRateManager.tick(); -@@ -1320,6 +1321,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1383,6 +1384,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.runAllTasks(); } // Paper end diff --git a/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch index 20e6d4fab5..8236a6ff1c 100644 --- a/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8d70cbc6e11656d170bde37b5f101902b0b6ee2e..e8b3755dec8149282a2fc55bf0a3fbb788df0b2b 100644 +index 1f23b277d5c1be48a3cfe7b6c9248a0b2bd95e4b..cecf238af5fd695baa623d7d09323a60b41512a5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -767,30 +767,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -768,30 +768,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // CraftBukkit start public void prepareLevels(ChunkProgressListener worldloadlistener, ServerLevel worldserver) { @@ -52,7 +52,7 @@ index 8d70cbc6e11656d170bde37b5f101902b0b6ee2e..e8b3755dec8149282a2fc55bf0a3fbb7 if (true) { ServerLevel worldserver1 = worldserver; -@@ -813,7 +816,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -814,7 +817,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // this.nextTickTimeNanos = SystemUtils.getNanos() + MinecraftServer.PREPARE_LEVELS_DEFAULT_DELAY_NANOS; this.executeModerately(); // CraftBukkit end @@ -62,7 +62,7 @@ index 8d70cbc6e11656d170bde37b5f101902b0b6ee2e..e8b3755dec8149282a2fc55bf0a3fbb7 // this.updateMobSpawningFlags(); worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals()); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c67ef9387f1d7ddfda89a096e764133118167175..bd41daf86f2a825a55ca685f4ea43a3df108b64a 100644 +index 4e7e3935a0040f48a1dc8f32e3da6d5a3ba154cb..514b3af4f8ac04744ae44cad7c01086a3f821d5f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1640,12 +1640,84 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -190,7 +190,7 @@ index 4d2348df25410a0b5364eec066880326d6667dad..3754cda7e7731935893359d84f3ae061 this.maxCount = i * i; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 44b65087ec6f0cf9e29c4f4de94ddf7b6a7a7836..92c19035e4e03530eb27d7dd96847f4546710d28 100644 +index be8b7d0fdcd0687b8ac742585cd09ca38241a0ea..6ab78bead1fd4e7c02c597b23824f5e4f80132c9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1378,15 +1378,21 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0301-Expose-the-internal-current-tick.patch b/patches/server/0301-Expose-the-internal-current-tick.patch index ec7cb5e019..eceeb010b1 100644 --- a/patches/server/0301-Expose-the-internal-current-tick.patch +++ b/patches/server/0301-Expose-the-internal-current-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3ff493a3a0f679d894d8f60712811e20f5d986a0..743e6d25ca5ef4745a723d3bbb2efd2d18741ded 100644 +index 663ad8d391d81e7bbdf8b4ec4a8232b5b10954b7..b26199cdd8a09cef6e873fd8ffccaec97f6bc7c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2847,5 +2847,10 @@ public final class CraftServer implements Server { +@@ -2851,5 +2851,10 @@ public final class CraftServer implements Server { profile.getProperties().putAll(((CraftPlayer) player).getHandle().getGameProfile().getProperties()); return new com.destroystokyo.paper.profile.CraftPlayerProfile(profile); } diff --git a/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch index 87113096c0..4ecb84bc71 100644 --- a/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch +++ b/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Guard against serializing mismatching chunk coordinate Should help if something dumb happens diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 24892ae367e19038625e243bcdf1bb694632ede5..b4ea37dfa90f0c19914ecd32ddedde586d9d5f78 100644 +index cc1d7626a82881c4410d65c6a33dadae7ab07172..5ef782ef14a9a880cb3db433bbee2d4a70d33718 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -94,8 +94,20 @@ public class ChunkSerializer { +@@ -86,8 +86,20 @@ public class ChunkSerializer { public ChunkSerializer() {} @@ -32,7 +32,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..b4ea37dfa90f0c19914ecd32ddedde58 if (!Objects.equals(chunkPos, chunkcoordintpair1)) { ChunkSerializer.LOGGER.error("Chunk file at {} is in the wrong location; relocating. (Expected {}, got {})", new Object[]{chunkPos, chunkPos, chunkcoordintpair1}); diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..ab6b4491d4278b3839b7363d9890bd12a757e4cc 100644 +index 25623dcd44edc475c5dce2756bf99fc18e142b63..eaf978d15618b80d23c443acbd42db926d570d01 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java @@ -157,6 +157,13 @@ public class ChunkStorage implements AutoCloseable { diff --git a/patches/server/0326-Add-debug-for-sync-chunk-loads.patch b/patches/server/0326-Add-debug-for-sync-chunk-loads.patch index 6862d9fe5b..b3e2d87143 100644 --- a/patches/server/0326-Add-debug-for-sync-chunk-loads.patch +++ b/patches/server/0326-Add-debug-for-sync-chunk-loads.patch @@ -194,13 +194,13 @@ index 0000000000000000000000000000000000000000..404a8fd128043527d23f22ee26f7c8c7 + } +} diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 830978f3409888302ab857161628cee5869efa8f..43573b5ef76c8bb42411c3707cb13d90d531b905 100644 +index 69ffd6ea2ce7c6d4f211c6081fcea79afd7eac6c..69d093d3450931038ac3d27d7874060d13dc2225 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -39,6 +39,7 @@ public final class PaperCommand extends Command { +@@ -38,6 +38,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("reload"), new ReloadCommand()); commands.put(Set.of("version"), new VersionCommand()); commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); - commands.put(Set.of("fixlight"), new FixLightCommand()); + commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); return commands.entrySet().stream() diff --git a/patches/server/0336-Optimise-Chunk-getFluid.patch b/patches/server/0336-Optimise-Chunk-getFluid.patch index e5f03ef740..58ba0e4e5d 100644 --- a/patches/server/0336-Optimise-Chunk-getFluid.patch +++ b/patches/server/0336-Optimise-Chunk-getFluid.patch @@ -8,10 +8,10 @@ faster on its own, however removing the try catch makes it easier to inline due to code size diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 8288be49fc0fbedefef799cb1038d5f79b7cf0a3..84036969971a72129f98d5f524eecd237658b81f 100644 +index 82b59b7c791216aaaaaaf2972f47bd21dac7a202..5403fc4fa2ed2526d2e67c230a46dd2a75e017be 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -376,18 +376,20 @@ public class LevelChunk extends ChunkAccess { +@@ -370,18 +370,20 @@ public class LevelChunk extends ChunkAccess { } public FluidState getFluidState(int x, int y, int z) { @@ -38,7 +38,7 @@ index 8288be49fc0fbedefef799cb1038d5f79b7cf0a3..84036969971a72129f98d5f524eecd23 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Getting fluid state"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block being got"); -@@ -397,6 +399,7 @@ public class LevelChunk extends ChunkAccess { +@@ -391,6 +393,7 @@ public class LevelChunk extends ChunkAccess { }); throw new ReportedException(crashreport); } diff --git a/patches/server/0338-Add-tick-times-API-and-mspt-command.patch b/patches/server/0338-Add-tick-times-API-and-mspt-command.patch index f840d72f89..2fe3cf6225 100644 --- a/patches/server/0338-Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/0338-Add-tick-times-API-and-mspt-command.patch @@ -125,7 +125,7 @@ index 72f2e81b9905a0d57ed8e2a88578f62d5235c456..7b58b2d6297800c2dcdbf7539e5ab8e7 public static void registerCommands(final MinecraftServer server) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e8b3755dec8149282a2fc55bf0a3fbb788df0b2b..fcb8708276a73ab61e004f0113650b0a7415041c 100644 +index cecf238af5fd695baa623d7d09323a60b41512a5..698601fc2c6e5d19a990bd3dcf0bc52e4c6efaea 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -252,6 +252,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -140,7 +140,7 @@ index e8b3755dec8149282a2fc55bf0a3fbb788df0b2b..fcb8708276a73ab61e004f0113650b0a @Nullable private KeyPair keyPair; @Nullable -@@ -1339,6 +1344,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1402,6 +1407,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) j / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F; long l = Util.getNanos(); @@ -152,7 +152,7 @@ index e8b3755dec8149282a2fc55bf0a3fbb788df0b2b..fcb8708276a73ab61e004f0113650b0a this.logTickTime(l - i); this.profiler.pop(); org.spigotmc.WatchdogThread.tick(); // Spigot -@@ -2615,4 +2625,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2678,4 +2688,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) { } @@ -184,7 +184,7 @@ index e8b3755dec8149282a2fc55bf0a3fbb788df0b2b..fcb8708276a73ab61e004f0113650b0a + // Paper end - Add tick times API and /mspt command } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 743e6d25ca5ef4745a723d3bbb2efd2d18741ded..7b30b180900d18074edf517c969f78bb1c10c241 100644 +index b26199cdd8a09cef6e873fd8ffccaec97f6bc7c4..d4231c9c22d3014702d856cb3b329ba3c4c6d0ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2619,6 +2619,16 @@ public final class CraftServer implements Server { diff --git a/patches/server/0339-Expose-MinecraftServer-isRunning.patch b/patches/server/0339-Expose-MinecraftServer-isRunning.patch index abe3bec443..d60a818124 100644 --- a/patches/server/0339-Expose-MinecraftServer-isRunning.patch +++ b/patches/server/0339-Expose-MinecraftServer-isRunning.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7b30b180900d18074edf517c969f78bb1c10c241..69e25f23322704d054bef119f3581eee08cff55f 100644 +index d4231c9c22d3014702d856cb3b329ba3c4c6d0ce..070fba9322c5f8dd4f217685d8157d05cc78c95b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2862,5 +2862,10 @@ public final class CraftServer implements Server { +@@ -2866,5 +2866,10 @@ public final class CraftServer implements Server { public int getCurrentTick() { return net.minecraft.server.MinecraftServer.currentTick; } diff --git a/patches/server/0340-Add-Raw-Byte-ItemStack-Serialization.patch b/patches/server/0340-Add-Raw-Byte-ItemStack-Serialization.patch index afd9646f91..d4d1597749 100644 --- a/patches/server/0340-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/patches/server/0340-Add-Raw-Byte-ItemStack-Serialization.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization Serializes using NBT which is safer for server data migrations than bukkits format. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e31ead0d99203a018757cb2e765b5d28dd373eef..2ff5d2c357a4832e2624ef53fb0110d61fddc6fc 100644 +index e31ead0d99203a018757cb2e765b5d28dd373eef..41fb303191783ad9e531331dc8468f95139432b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -458,6 +458,52 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -458,6 +458,53 @@ public final class CraftMagicNumbers implements UnsafeValues { public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { return new com.destroystokyo.paper.PaperVersionFetcher(); } @@ -28,8 +28,9 @@ index e31ead0d99203a018757cb2e765b5d28dd373eef..2ff5d2c357a4832e2624ef53fb0110d6 + Preconditions.checkArgument(data.length > 0, "cannot deserialize nothing"); + + CompoundTag compound = deserializeNbtFromBytes(data); -+ int dataVersion = compound.getInt("DataVersion"); -+ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, getDataVersion()))); ++ final int dataVersion = compound.getInt("DataVersion"); ++ compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); ++ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound)); + } + + private byte[] serializeNbtToBytes(CompoundTag compound) { diff --git a/patches/server/0365-misc-debugging-dumps.patch b/patches/server/0365-misc-debugging-dumps.patch index cbf65ca99a..ae8fbfc251 100644 --- a/patches/server/0365-misc-debugging-dumps.patch +++ b/patches/server/0365-misc-debugging-dumps.patch @@ -42,10 +42,10 @@ index 40ff3090fb17fb0f01a9b52639fb783ea57ce6b6..d39743d9626eb01c942194387dafb110 StackTraceElement[] astacktraceelement = exception.getStackTrace(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fcb8708276a73ab61e004f0113650b0a7415041c..4339a2cd0b2020b673ebdb6902ad0d0a53373a27 100644 +index 698601fc2c6e5d19a990bd3dcf0bc52e4c6efaea..4170f834c63807440c9bcda76cdcf93807de0eb1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -903,6 +903,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -904,6 +904,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // CraftBukkit start private boolean hasStopped = false; @@ -53,7 +53,7 @@ index fcb8708276a73ab61e004f0113650b0a7415041c..4339a2cd0b2020b673ebdb6902ad0d0a private final Object stopLock = new Object(); public final boolean hasStopped() { synchronized (this.stopLock) { -@@ -917,6 +918,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -918,6 +919,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.hasStopped) return; this.hasStopped = true; } @@ -61,7 +61,7 @@ index fcb8708276a73ab61e004f0113650b0a7415041c..4339a2cd0b2020b673ebdb6902ad0d0a // CraftBukkit end if (this.metricsRecorder.isRecording()) { this.cancelRecordingMetrics(); -@@ -1020,6 +1022,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1021,6 +1023,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } public void safeShutdown(boolean waitForShutdown, boolean isRestarting) { this.isRestarting = isRestarting; @@ -87,7 +87,7 @@ index 04a728a16bb629adbae1cd8586764a6dbc22b5dc..d130f843975236018df4fa2ccc3ca6aa this.connection.disconnect(ServerConfigurationPacketListenerImpl.DISCONNECT_REASON_INVALID_DATA); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 32833942d0383671a03463d07ed6e40171db53c6..51ae35b3edd651cc85aaab2cbf7d223c7563951a 100644 +index 3371c9282eb23377371db1dc42b4b80fe6ade7da..967627073ce7f7670cdfea4c54434e17b7648664 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1006,6 +1006,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index ee32969ce5..b2ce7a4822 100644 --- a/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -109,7 +109,7 @@ index 0000000000000000000000000000000000000000..66b6011ee3684695b2ab9292961c80bf + } +} diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java -index 0bb4aaa546939b67a5d22865190f30478a9337c1..d3e619655382e50e9ac9323ed942502d85c9599c 100644 +index 404a8fd128043527d23f22ee26f7c8c739f09089..9f24003fffee14592e5ef22e75ec9826428438e6 100644 --- a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java +++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java @@ -91,7 +91,7 @@ public class SyncLoadFinder { @@ -609,10 +609,10 @@ index e697b8f7b165d2394d8155cbee7453e23ac2bee4..6706ac701963fed4798247e6e835b06f } } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 84036969971a72129f98d5f524eecd237658b81f..73e682bb3ef3b2e450ec8c594b5365c7a340615e 100644 +index 5403fc4fa2ed2526d2e67c230a46dd2a75e017be..af757309cb46af6df07872f7596b66df6d6f18d7 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -598,7 +598,7 @@ public class LevelChunk extends ChunkAccess { +@@ -592,7 +592,7 @@ public class LevelChunk extends ChunkAccess { + " (" + getBlockState(blockposition) + ") where there was no entity tile!\n" + "Chunk coordinates: " + (this.chunkPos.x * 16) + "," + (this.chunkPos.z * 16) + "\nWorld: " + level.getLevel().dimension().location()); diff --git a/patches/server/0368-Implement-Mob-Goal-API.patch b/patches/server/0368-Implement-Mob-Goal-API.patch index 7a767ac051..e9cb82ebee 100644 --- a/patches/server/0368-Implement-Mob-Goal-API.patch +++ b/patches/server/0368-Implement-Mob-Goal-API.patch @@ -768,10 +768,10 @@ index 6667ecc4b7eded4e20a415cef1e1b1179e6710b8..16f9a98b8a939e5ca7e2dc04f87134a7 LOOK, JUMP, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 51ae35b3edd651cc85aaab2cbf7d223c7563951a..bbd3ceb2db482f32e939ccd99970fd7101f5a5ce 100644 +index 967627073ce7f7670cdfea4c54434e17b7648664..c8147b9481f79806ec64941169f2ef552c165baa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2875,5 +2875,11 @@ public final class CraftServer implements Server { +@@ -2879,5 +2879,11 @@ public final class CraftServer implements Server { public boolean isStopping() { return net.minecraft.server.MinecraftServer.getServer().hasStopped(); } diff --git a/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch index 14c170d5c2..90df74f85d 100644 --- a/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch +++ b/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4339a2cd0b2020b673ebdb6902ad0d0a53373a27..d983aec418603a470f640ace139572fd239a3393 100644 +index 4170f834c63807440c9bcda76cdcf93807de0eb1..1913eb3eb6a1ddc2d96240cbc50d4cf7325ebd3b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -930,6 +930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -931,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); @@ -22,7 +22,7 @@ index 4339a2cd0b2020b673ebdb6902ad0d0a53373a27..d983aec418603a470f640ace139572fd // CraftBukkit end this.getConnection().stop(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bbd3ceb2db482f32e939ccd99970fd7101f5a5ce..b0e5dc6b3c9a7e820e001cfe311a7414cea4c245 100644 +index c8147b9481f79806ec64941169f2ef552c165baa..045066f5ba6dd69259664c5bf9eafae41b708892 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1016,6 +1016,31 @@ public final class CraftServer implements Server { diff --git a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index aadb1f2698..4e6c0d9481 100644 --- a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -8,10 +8,10 @@ makes it so that the server keeps the last difficulty used instead of restoring the server.properties every single load. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d983aec418603a470f640ace139572fd239a3393..f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85 100644 +index 1913eb3eb6a1ddc2d96240cbc50d4cf7325ebd3b..9d41c8e93aa97a78da26bef5cfbed8412d4e1451 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -824,7 +824,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -825,7 +825,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper - Configurable Keep Spawn Loaded range per world // CraftBukkit start // this.updateMobSpawningFlags(); @@ -20,7 +20,7 @@ index d983aec418603a470f640ace139572fd239a3393..f3afc22e3c4fc792fa4ed5c3ee18d76c this.forceTicks = false; // CraftBukkit end -@@ -1705,11 +1705,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1768,11 +1768,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } } @@ -40,7 +40,7 @@ index d983aec418603a470f640ace139572fd239a3393..f3afc22e3c4fc792fa4ed5c3ee18d76c } } -@@ -1723,7 +1726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1786,7 +1789,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); @@ -102,7 +102,7 @@ index 6dbf7734b640dc9cd553dfd6afb4c9cd4e3d66da..48fca15cdc6b0bafc3d8ff13cc96b325 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b0e5dc6b3c9a7e820e001cfe311a7414cea4c245..7803075383cdde77444991e72f49ed67627f95ed 100644 +index 045066f5ba6dd69259664c5bf9eafae41b708892..dead1bc2a354a1433f10caf81bc0633fda947042 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -955,8 +955,8 @@ public final class CraftServer implements Server { diff --git a/patches/server/0393-Paper-dumpitem-command.patch b/patches/server/0393-Paper-dumpitem-command.patch index 92d411e39d..23f5287194 100644 --- a/patches/server/0393-Paper-dumpitem-command.patch +++ b/patches/server/0393-Paper-dumpitem-command.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Paper dumpitem command Let's you quickly view the item in your hands NBT data diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 43573b5ef76c8bb42411c3707cb13d90d531b905..a27c90ea7af63b0d42f202ed1a7dab6e42daed9f 100644 +index 69d093d3450931038ac3d27d7874060d13dc2225..27775df10a490ff75ca377e8373931738f1b817c 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -40,6 +40,7 @@ public final class PaperCommand extends Command { +@@ -39,6 +39,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("version"), new VersionCommand()); commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); - commands.put(Set.of("fixlight"), new FixLightCommand()); commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); + commands.put(Set.of("dumpitem"), new DumpItemCommand()); diff --git a/patches/server/0414-Brand-support.patch b/patches/server/0414-Brand-support.patch index a1db079b4f..a0b82b4c27 100644 --- a/patches/server/0414-Brand-support.patch +++ b/patches/server/0414-Brand-support.patch @@ -57,10 +57,10 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6 } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bcdb1cbb6e59681163c9800bf6576965ab331721..e34a954247488f3ba96ef354ff676d07fd36cb06 100644 +index febbb35077811c6cfd4101500aad24c447f4cae1..7e3f0cacbe1b562c73b5d62bfa81b832af5bbd93 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2988,6 +2988,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2990,6 +2990,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch index 1ed9987051..1c14f5e794 100644 --- a/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch +++ b/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch @@ -9,21 +9,21 @@ the game, immediately stop the server to prevent data corruption. You can override this functionality at your own peril. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..7ca4790d564846c1ab9560e349005eea8aef35b8 100644 +index 5ef782ef14a9a880cb3db433bbee2d4a70d33718..29aaedbe70901fdd98f15f2ca5ba382106091d1a 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -91,6 +91,10 @@ public class ChunkSerializer { - private static final String SKYLIGHT_STATE_TAG = "starlight.skylight_state"; - private static final String STARLIGHT_VERSION_TAG = "starlight.light_version"; - // Paper end - replace light engine impl +@@ -84,6 +84,10 @@ public class ChunkSerializer { + public static final String BLOCK_LIGHT_TAG = "BlockLight"; + public static final String SKY_LIGHT_TAG = "SkyLight"; + + // Paper start - Do not let the server load chunks from newer versions + private static final int CURRENT_DATA_VERSION = net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion(); + private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); + // Paper end - Do not let the server load chunks from newer versions - public ChunkSerializer() {} -@@ -107,6 +111,15 @@ public class ChunkSerializer { + // Paper start - guard against serializing mismatching coordinates +@@ -99,6 +103,15 @@ public class ChunkSerializer { } // Paper end - guard against serializing mismatching coordinates public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { diff --git a/patches/server/0429-Cache-block-data-strings.patch b/patches/server/0429-Cache-block-data-strings.patch index 4fe9c6d145..b814a2a2e4 100644 --- a/patches/server/0429-Cache-block-data-strings.patch +++ b/patches/server/0429-Cache-block-data-strings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85..dedaf6f93cc81275e318d8eee3f4f140ddfa7655 100644 +index 9d41c8e93aa97a78da26bef5cfbed8412d4e1451..dde00d50b28928e35e1f95ef3f0eb46828e9d4bc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2005,6 +2005,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2068,6 +2068,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getPlayerList().reloadResources(); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); diff --git a/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index f130e5af51..15d6357897 100644 --- a/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -21,10 +21,10 @@ index 9946f04c7e5877f094293c4c0976aeecf5c83c56..5dce8180a7ddfdd5fd32509010bdbaa6 + // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 2ff5d2c357a4832e2624ef53fb0110d61fddc6fc..88deea72f7456c178f54f6a245c84a64ffab6926 100644 +index 41fb303191783ad9e531331dc8468f95139432b9..fc6dee1d9eb47025e26fcc20eb15a36bfe090d9d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -504,6 +504,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -505,6 +505,11 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); return compound; } diff --git a/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 016f59cab0..fd15b22600 100644 --- a/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dedaf6f93cc81275e318d8eee3f4f140ddfa7655..546c8edcd53aab9ed38ef07291606d4765bcde25 100644 +index dde00d50b28928e35e1f95ef3f0eb46828e9d4bc..d1bd7ccd6e36497849837072c8f1326336409b42 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2088,13 +2088,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2151,13 +2151,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.isEnforceWhitelist()) { PlayerList playerlist = source.getServer().getPlayerList(); UserWhiteList whitelist = playerlist.getWhiteList(); diff --git a/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 2f830ee3a0..f1267bd9d4 100644 --- a/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7a10bdaf6b837738afb73e27fa970f9eff9bb196..1b9eeb31e2cea8a30640af4daa73f7a3b335a9c4 100644 +index 7e3f0cacbe1b562c73b5d62bfa81b832af5bbd93..bcbc4e0a820458733a45cdf65b30317d9a327ce4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2551,7 +2551,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2553,7 +2553,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null) { Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType()); } diff --git a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch index 73aaa48ba6..db864afdea 100644 --- a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch +++ b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 546c8edcd53aab9ed38ef07291606d4765bcde25..1d109679f5f16e8a4fb32020bc5d781b817f1ac8 100644 +index d1bd7ccd6e36497849837072c8f1326336409b42..4fd56dc6f1a9dc15b639d6aeba29e678354ee7f8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1973,7 +1973,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2036,7 +2036,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa return this.functionManager; } @@ -22,7 +22,7 @@ index 546c8edcd53aab9ed38ef07291606d4765bcde25..1d109679f5f16e8a4fb32020bc5d781b RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE); CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> { Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2006,6 +2012,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2069,6 +2075,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings; they can be defined by datapacks so refresh it here diff --git a/patches/server/0511-Add-EntityMoveEvent.patch b/patches/server/0511-Add-EntityMoveEvent.patch index ca49b77885..5f1afbe1b5 100644 --- a/patches/server/0511-Add-EntityMoveEvent.patch +++ b/patches/server/0511-Add-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1d109679f5f16e8a4fb32020bc5d781b817f1ac8..7ab3e35d4a6376f4c18c36ef1d6a29556d19f15f 100644 +index 4fd56dc6f1a9dc15b639d6aeba29e678354ee7f8..37c4245a30ee6a5f786364aa46dee832396ba4fd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1463,6 +1463,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1526,6 +1526,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent diff --git a/patches/server/0528-Expand-world-key-API.patch b/patches/server/0528-Expand-world-key-API.patch index 87afb65e1c..de0d6bde9f 100644 --- a/patches/server/0528-Expand-world-key-API.patch +++ b/patches/server/0528-Expand-world-key-API.patch @@ -20,7 +20,7 @@ index 0fb214ddd919b568da64541fd9b531c65caa5fad..9cd267f53505658d1c75187b662c4d9f // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 811c0f36bc314ca79e062fa149c6d19fc2734087..150013a0c62a057671cfad7f852c4439bd9051c6 100644 +index f027e405e4c80a66110d351961612faa8828bdb0..cf508b4ddd21d006b88eac6588a0f56eb20c5ec7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1137,9 +1137,15 @@ public final class CraftServer implements Server { @@ -67,10 +67,10 @@ index 811c0f36bc314ca79e062fa149c6d19fc2734087..150013a0c62a057671cfad7f852c4439 // Check if a World already exists with the UID. if (this.getWorld(world.getUID()) != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index f48702923beb6d99b23dfa2466396bf4d4e8fbc8..7629d3b375027ffe0656a21e4cb9315aabb62460 100644 +index 67c8e62c22f11ea4524e4229d2b89695313bf5d2..e0118a0c780cb60eb8545cb9c61f37c0986752b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -515,6 +515,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -516,6 +516,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/server/0530-Item-Rarity-API.patch b/patches/server/0530-Item-Rarity-API.patch index 1f69f50472..47ad27274a 100644 --- a/patches/server/0530-Item-Rarity-API.patch +++ b/patches/server/0530-Item-Rarity-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Item Rarity API public net.minecraft.world.item.Item rarity diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7629d3b375027ffe0656a21e4cb9315aabb62460..d714d420376d032d82ce6fc066fee3f775f0744d 100644 +index e0118a0c780cb60eb8545cb9c61f37c0986752b0..841e5887c455fafd826965e4f84180750f303eaa 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -520,6 +520,20 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -521,6 +521,20 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getMainLevelName() { return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName; } diff --git a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch index 843d16f8c9..da6064c246 100644 --- a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ab3e35d4a6376f4c18c36ef1d6a29556d19f15f..82ed16af2384c73560b66cb5a60d53fb940371c0 100644 +index 37c4245a30ee6a5f786364aa46dee832396ba4fd..b3b78ad64c5cd9bde4756c5e619d0188ec8f2608 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2104,7 +2104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2167,7 +2167,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa ServerPlayer entityplayer = (ServerPlayer) iterator.next(); if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) diff --git a/patches/server/0534-Expose-protocol-version.patch b/patches/server/0534-Expose-protocol-version.patch index 707f3fc177..789c4e233c 100644 --- a/patches/server/0534-Expose-protocol-version.patch +++ b/patches/server/0534-Expose-protocol-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index d714d420376d032d82ce6fc066fee3f775f0744d..24a19034ff30020db9ef817b91400dbf25f87599 100644 +index 841e5887c455fafd826965e4f84180750f303eaa..584ea52824c17b3008204df2480a2bf9f14acb82 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -534,6 +534,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -535,6 +535,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public io.papermc.paper.inventory.ItemRarity getItemStackRarity(org.bukkit.inventory.ItemStack itemStack) { return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } diff --git a/patches/server/0558-Add-basic-Datapack-API.patch b/patches/server/0558-Add-basic-Datapack-API.patch index c9445f7642..a2d0553b24 100644 --- a/patches/server/0558-Add-basic-Datapack-API.patch +++ b/patches/server/0558-Add-basic-Datapack-API.patch @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 150013a0c62a057671cfad7f852c4439bd9051c6..5bf8d8de30f69e2eed92400bc75c36231a4631fe 100644 +index cf508b4ddd21d006b88eac6588a0f56eb20c5ec7..eb9c34864a3ad86f79b344211864429f13c3b06f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -301,6 +301,7 @@ public final class CraftServer implements Server { @@ -111,7 +111,7 @@ index 150013a0c62a057671cfad7f852c4439bd9051c6..5bf8d8de30f69e2eed92400bc75c3623 } public boolean getCommandBlockOverride(String command) { -@@ -2943,5 +2945,11 @@ public final class CraftServer implements Server { +@@ -2947,5 +2949,11 @@ public final class CraftServer implements Server { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return mobGoals; } diff --git a/patches/server/0561-ItemStack-repair-check-API.patch b/patches/server/0561-ItemStack-repair-check-API.patch index ea0bb0f0ae..b4a6192069 100644 --- a/patches/server/0561-ItemStack-repair-check-API.patch +++ b/patches/server/0561-ItemStack-repair-check-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 24a19034ff30020db9ef817b91400dbf25f87599..c0b9bc288b7ce65a5eafe2a75c120de0855a705b 100644 +index 584ea52824c17b3008204df2480a2bf9f14acb82..b0f365fe009be57cdf64983d9975c6bd873a33b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -535,6 +535,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -536,6 +536,14 @@ public final class CraftMagicNumbers implements UnsafeValues { return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } diff --git a/patches/server/0568-Attributes-API-for-item-defaults.patch b/patches/server/0568-Attributes-API-for-item-defaults.patch index 8c86dbc96b..395e09608d 100644 --- a/patches/server/0568-Attributes-API-for-item-defaults.patch +++ b/patches/server/0568-Attributes-API-for-item-defaults.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Attributes API for item defaults diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index c0b9bc288b7ce65a5eafe2a75c120de0855a705b..833e66adf24a80e6ba30eff7b6abbb0f613bfb0d 100644 +index b0f365fe009be57cdf64983d9975c6bd873a33b5..fd35c5102aa4e14f5eb707884be64120c2b13276 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -543,6 +543,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -544,6 +544,19 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); } diff --git a/patches/server/0572-Add-PlayerKickEvent-causes.patch b/patches/server/0572-Add-PlayerKickEvent-causes.patch index d2a09684a0..08a0322556 100644 --- a/patches/server/0572-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0572-Add-PlayerKickEvent-causes.patch @@ -48,10 +48,10 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..ba12919c3f9aec34a9e64993b143ae92 public boolean shouldDisconnect() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 82ed16af2384c73560b66cb5a60d53fb940371c0..19158fae4c8ebd9f5cd136795723771e23dba23c 100644 +index b3b78ad64c5cd9bde4756c5e619d0188ec8f2608..2535f33e1ee5f1bac3247231138966fe070615cd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2104,7 +2104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2167,7 +2167,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa ServerPlayer entityplayer = (ServerPlayer) iterator.next(); if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) @@ -491,7 +491,7 @@ index 6724d0a1af13e97bc1d3bd94fd43fef742a0deab..20ba0a0c9eae28658888a77dd2170f62 } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 55fec85c4adb6e92e371547b5c3d58e5adc53ce8..490e84e1b0bc72a5953ac540dc60640814ecc64a 100644 +index d626d5c836724bcfe61c0580a266d7b1e6f4af65..37295ee7451d62ee59e6449bf7635007eb43ac10 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -549,7 +549,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0620-Get-entity-default-attributes.patch b/patches/server/0620-Get-entity-default-attributes.patch index a496ab0535..3fffa91394 100644 --- a/patches/server/0620-Get-entity-default-attributes.patch +++ b/patches/server/0620-Get-entity-default-attributes.patch @@ -81,10 +81,10 @@ index 0000000000000000000000000000000000000000..68044b8439c302114240d0ae4da93ab3 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 833e66adf24a80e6ba30eff7b6abbb0f613bfb0d..ef6bf5026a8b5bbd65968faa33401bd98f10fe4c 100644 +index fd35c5102aa4e14f5eb707884be64120c2b13276..c9be954c94adbc982e2ef9d406be4290e75bc892 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -560,6 +560,18 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -561,6 +561,18 @@ public final class CraftMagicNumbers implements UnsafeValues { public int getProtocolVersion() { return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); } diff --git a/patches/server/0626-Add-isCollidable-methods-to-various-places.patch b/patches/server/0626-Add-isCollidable-methods-to-various-places.patch index 2f54e71398..fa5484bbdc 100644 --- a/patches/server/0626-Add-isCollidable-methods-to-various-places.patch +++ b/patches/server/0626-Add-isCollidable-methods-to-various-places.patch @@ -39,10 +39,10 @@ index 928a301627134b49915b0ceaeabb7dc350605dc2..08716e757b2e100f7bc47a046f02db66 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index ef6bf5026a8b5bbd65968faa33401bd98f10fe4c..df57a3be211017e2ba7bd28571adaea59d0be969 100644 +index c9be954c94adbc982e2ef9d406be4290e75bc892..35bc0c3bfda51e3eec2ee1fc68d207ddba4239ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -572,6 +572,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -573,6 +573,12 @@ public final class CraftMagicNumbers implements UnsafeValues { var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); } diff --git a/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch index 04b2562669..77fee154d0 100644 --- a/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch @@ -47,11 +47,11 @@ index a6492b6a9f66d8bcda8928fadf0a5920ff7f0dab..71845027ba1b755ead76cf75d011547d // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index df57a3be211017e2ba7bd28571adaea59d0be969..fd1ec07ada04de98d0a4f1ca4c93ec53771f88d7 100644 +index 35bc0c3bfda51e3eec2ee1fc68d207ddba4239ef..34c19a422de27cd6aa08159186a0180215c0837d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -483,6 +483,29 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, getDataVersion()))); +@@ -484,6 +484,32 @@ public final class CraftMagicNumbers implements UnsafeValues { + return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound)); } + @Override @@ -71,8 +71,11 @@ index df57a3be211017e2ba7bd28571adaea59d0be969..fd1ec07ada04de98d0a4f1ca4c93ec53 + + CompoundTag compound = deserializeNbtFromBytes(data); + int dataVersion = compound.getInt("DataVersion"); -+ compound = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY, compound, dataVersion, getDataVersion()); -+ if (!preserveUUID) compound.remove("UUID"); // Generate a new UUID so we don't have to worry about deserializing the same entity twice ++ compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ENTITY, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); ++ if (!preserveUUID) { ++ // Generate a new UUID so we don't have to worry about deserializing the same entity twice ++ compound.remove("UUID"); ++ } + return net.minecraft.world.entity.EntityType.create(compound, ((org.bukkit.craftbukkit.CraftWorld) world).getHandle()) + .orElseThrow(() -> new IllegalArgumentException("An ID was not found for the data. Did you downgrade?")).getBukkitEntity(); + } diff --git a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch index 9ca6f8dd8e..d90f1f9ab8 100644 --- a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -10,11 +10,11 @@ Also has a hover text on each mob category listing what entity types are in said category diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index a27c90ea7af63b0d42f202ed1a7dab6e42daed9f..1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf 100644 +index 27775df10a490ff75ca377e8373931738f1b817c..c9bb2df0d884227576ed8d2e72219bbbd7ba827e 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("fixlight"), new FixLightCommand()); +@@ -40,6 +40,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); diff --git a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index 3d3d4f1d89..c7af2ee421 100644 --- a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 19158fae4c8ebd9f5cd136795723771e23dba23c..249c3e0724a0f85cd3bae9ae67cc787d3eedfbfc 100644 +index 2535f33e1ee5f1bac3247231138966fe070615cd..1df847164796c0992e677e0db45a9be223c8dc4a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -596,7 +596,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -597,7 +597,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); @@ -18,7 +18,7 @@ index 19158fae4c8ebd9f5cd136795723771e23dba23c..249c3e0724a0f85cd3bae9ae67cc787d biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7a5fd6fb4ddcf1ba555725f1bb956333a0450d7c..5161f6d2fdd7cbf30b52089ecfda56b3d480ecda 100644 +index d8f4a433d5072e849eb883eb8e54831325c4c5ef..dd62f8ccca6a6c08876af1595bc274c9151055b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1260,7 +1260,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0704-Implement-regenerateChunk.patch b/patches/server/0704-Implement-regenerateChunk.patch index 5cf21d70a4..20bcc8001b 100644 --- a/patches/server/0704-Implement-regenerateChunk.patch +++ b/patches/server/0704-Implement-regenerateChunk.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement regenerateChunk Co-authored-by: Jason Penilla <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1eef3d5da 100644 +index 391f546e44080293fd94ff240d7809e3f471bb14..ef942e75ed1aefbc9175f99113cdfeada58e8a50 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -144,6 +144,7 @@ import org.jetbrains.annotations.NotNull; @@ -17,7 +17,7 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 private final ServerLevel world; private WorldBorder worldBorder; -@@ -414,27 +415,61 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -414,27 +415,68 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean regenerateChunk(int x, int z) { org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot @@ -25,10 +25,6 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 - /* - if (!unloadChunk0(x, z, false)) { - return false; -- } -- -- final long chunkKey = ChunkCoordIntPair.pair(x, z); -- world.getChunkProvider().unloadQueue.remove(chunkKey); + // Paper start - implement regenerateChunk method + final ServerLevel serverLevel = this.world; + final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); @@ -53,11 +49,7 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 + list.add(chunkAccess); + } + } - -- net.minecraft.server.Chunk chunk = world.getChunkProvider().generateChunk(x, z); -- PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z); -- if (playerChunk != null) { -- playerChunk.chunk = chunk; ++ + final java.util.concurrent.CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> future = chunkStatus.generate( + Runnable::run, + serverLevel, @@ -75,21 +67,34 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 + } } -- if (chunk != null) { -- refreshChunk(x, z); +- final long chunkKey = ChunkCoordIntPair.pair(x, z); +- world.getChunkProvider().unloadQueue.remove(chunkKey); + for (final BlockPos blockPos : BlockPos.betweenClosed(chunkPos.getMinBlockX(), serverLevel.getMinBuildHeight(), chunkPos.getMinBlockZ(), chunkPos.getMaxBlockX(), serverLevel.getMaxBuildHeight() - 1, chunkPos.getMaxBlockZ())) { + serverChunkCache.blockChanged(blockPos); - } ++ } -- return chunk != null; -- */ +- net.minecraft.server.Chunk chunk = world.getChunkProvider().generateChunk(x, z); +- PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z); +- if (playerChunk != null) { +- playerChunk.chunk = chunk; + final Set<ChunkPos> chunksToRelight = new HashSet<>(9); + for (int chunkX = chunkPos.x - 1; chunkX <= chunkPos.x + 1 ; chunkX++) { + for (int chunkZ = chunkPos.z - 1; chunkZ <= chunkPos.z + 1 ; chunkZ++) { + chunksToRelight.add(new ChunkPos(chunkX, chunkZ)); + } -+ } -+ serverChunkCache.getLightEngine().relight(chunksToRelight, pos -> {}, relit -> {}); + } + +- if (chunk != null) { +- refreshChunk(x, z); ++ for (final ChunkPos pos : chunksToRelight) { ++ final ChunkAccess chunk = serverChunkCache.getChunk(pos.x, pos.z, false); ++ if (chunk != null) { ++ serverChunkCache.getLightEngine().lightChunk(chunk, false); ++ } + } + +- return chunk != null; +- */ + return true; + // Paper end - implement regenerate chunk method } diff --git a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index 18ec46d112..f4cd07d2d7 100644 --- a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d5436fd2037e510ccbcb195036c5056bbc1b374f..0207c7f3cc3a3bc130011325a592483531e8c949 100644 +index 1df847164796c0992e677e0db45a9be223c8dc4a..6a321f5d8dd8278d01e154f64a1685403255978c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1233,6 +1233,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1296,6 +1296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (super.pollTask()) { return true; } else { @@ -20,7 +20,7 @@ index d5436fd2037e510ccbcb195036c5056bbc1b374f..0207c7f3cc3a3bc130011325a5924835 if (this.tickRateManager.isSprinting() || this.haveTime()) { Iterator iterator = this.getAllLevels().iterator(); -@@ -1240,12 +1241,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1303,12 +1304,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa ServerLevel worldserver = (ServerLevel) iterator.next(); if (worldserver.getChunkSource().pollTask()) { diff --git a/patches/server/0712-Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/0712-Option-to-have-default-CustomSpawners-in-custom-worl.patch index e2aef231fc..07a86c6066 100644 --- a/patches/server/0712-Option-to-have-default-CustomSpawners-in-custom-worl.patch +++ b/patches/server/0712-Option-to-have-default-CustomSpawners-in-custom-worl.patch @@ -10,10 +10,10 @@ just looking at the LevelStem key, look at the DimensionType key which is one level below that. Defaults to off to keep vanilla behavior. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0207c7f3cc3a3bc130011325a592483531e8c949..28d8f777edcb83623ff07f2bdf1c29ac94effb90 100644 +index 6a321f5d8dd8278d01e154f64a1685403255978c..0190a51f4b63bb98dda55b6acbea002fc91d3bbe 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -616,7 +616,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -617,7 +617,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.commandStorage = new CommandStorage(worldpersistentdata); } else { ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11); diff --git a/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch index 2255896043..299eb0a886 100644 --- a/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch +++ b/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch @@ -7,10 +7,10 @@ Some parts of legacy conversion will need the overworld to get the legacy structure data storage diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3e11543218196ee55387d86dafd2a381e64cddd5..c96e2cb5201b21142cf0ac18b5d78f28ef965b07 100644 +index 0190a51f4b63bb98dda55b6acbea002fc91d3bbe..831594402c2c7d6aa72b303fb73fde62160c95e3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -628,9 +628,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -629,9 +629,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified()); @@ -23,7 +23,7 @@ index 3e11543218196ee55387d86dafd2a381e64cddd5..c96e2cb5201b21142cf0ac18b5d78f28 if (worlddata.getCustomBossEvents() != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9cfc4422aa772889db06a3bb450d18c7aa0b4dcb..f0f87074fe9303dde499728e71b428ec4f16a336 100644 +index bc2dc3d7b316360beb522a9d8e00ffdad5745d46..b578f3666291bf0ec9b9620e6212d39c33399a9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1283,10 +1283,11 @@ public final class CraftServer implements Server { diff --git a/patches/server/0715-Custom-Potion-Mixes.patch b/patches/server/0715-Custom-Potion-Mixes.patch index bc6c0d24c6..c879f50bfb 100644 --- a/patches/server/0715-Custom-Potion-Mixes.patch +++ b/patches/server/0715-Custom-Potion-Mixes.patch @@ -32,10 +32,10 @@ index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c96e2cb5201b21142cf0ac18b5d78f28ef965b07..7bb06b95c116eae425ab53f340f75c2e68da1081 100644 +index 831594402c2c7d6aa72b303fb73fde62160c95e3..c0353463f59ae4d3fe94ee15feb95a4ec1a064f4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2018,6 +2018,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2081,6 +2081,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.worldData.setDataConfiguration(worlddataconfiguration); this.resources.managers.updateRegistryTags(this.registryAccess()); @@ -172,7 +172,7 @@ index 424406d2692856cfd82b6f3b7b6228fa3bd20c2f..bc01481ac5990ad1cfd1def5a16dd0ed @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f0f87074fe9303dde499728e71b428ec4f16a336..a2eb5ca693d0239e9cf43f6bda78d9fd9e653e98 100644 +index b578f3666291bf0ec9b9620e6212d39c33399a9e..506145875fae3da90662315a71eddda9aaabb0c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -304,6 +304,7 @@ public final class CraftServer implements Server { @@ -192,7 +192,7 @@ index f0f87074fe9303dde499728e71b428ec4f16a336..a2eb5ca693d0239e9cf43f6bda78d9fd // Ugly hack :( if (!Main.useConsole) { -@@ -3065,5 +3066,10 @@ public final class CraftServer implements Server { +@@ -3069,5 +3070,10 @@ public final class CraftServer implements Server { return datapackManager; } diff --git a/patches/server/0717-Fix-falling-block-spawn-methods.patch b/patches/server/0717-Fix-falling-block-spawn-methods.patch index a29730e3d5..a05c6e641f 100644 --- a/patches/server/0717-Fix-falling-block-spawn-methods.patch +++ b/patches/server/0717-Fix-falling-block-spawn-methods.patch @@ -11,10 +11,10 @@ Restores the API behavior from previous versions of the server public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1ae13f0a320160210bd830f990f44de1eef3d5da..923782e94dfbac8a3270c15538e6b85bcaf8e8f2 100644 +index ef942e75ed1aefbc9175f99113cdfeada58e8a50..5e2a1a4bd047b6eb1581ce6e6d9b0f78be64c448 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1374,7 +1374,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1381,7 +1381,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(material != null, "Material cannot be null"); Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material); @@ -28,7 +28,7 @@ index 1ae13f0a320160210bd830f990f44de1eef3d5da..923782e94dfbac8a3270c15538e6b85b return (FallingBlock) entity.getBukkitEntity(); } -@@ -1383,7 +1388,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1390,7 +1395,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(location != null, "Location cannot be null"); Preconditions.checkArgument(data != null, "BlockData cannot be null"); diff --git a/patches/server/0727-Buffer-OOB-setBlock-calls.patch b/patches/server/0727-Buffer-OOB-setBlock-calls.patch index cc1368326b..ae47164389 100644 --- a/patches/server/0727-Buffer-OOB-setBlock-calls.patch +++ b/patches/server/0727-Buffer-OOB-setBlock-calls.patch @@ -13,10 +13,10 @@ we'll also only gen a trace for the first one, I see no real pressing need to generate more, given that that would *massively* negate this patch otherwise diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 23dfc741b31cdc25265fb5daffcae63417102a41..d6a9a6bd95307837ea76c0cb07666641c5e942a6 100644 +index d11741d2618976bdb51f75d823f260f32d5bafc9..ff94af5be8de374f5cde2607eebbb23e65705581 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -296,6 +296,7 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -275,6 +275,7 @@ public class WorldGenRegion implements WorldGenLevel { } } @@ -24,7 +24,7 @@ index 23dfc741b31cdc25265fb5daffcae63417102a41..d6a9a6bd95307837ea76c0cb07666641 @Override public boolean ensureCanWrite(BlockPos pos) { int i = SectionPos.blockToSectionCoord(pos.getX()); -@@ -315,7 +316,15 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -294,7 +295,15 @@ public class WorldGenRegion implements WorldGenLevel { return true; } else { diff --git a/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch index 3541c15f4c..103ec25d48 100644 --- a/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -167,10 +167,10 @@ index f3cdf1fa7731eb7bb1cb89aa6a37204d81257cb0..0112ef51815c4fab38b95d5e917d335e this.onChanged(server); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 923782e94dfbac8a3270c15538e6b85bcaf8e8f2..c35f5a1a42b76b154bfbb161d23348e76f676090 100644 +index 5e2a1a4bd047b6eb1581ce6e6d9b0f78be64c448..12013237e7b00f47d2a8660fd09ee3d52fdf084c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1959,7 +1959,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1966,7 +1966,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end - Add WorldGameRuleChangeEvent GameRules.Value<?> handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule)); handle.deserialize(event.getValue()); // Paper - Add WorldGameRuleChangeEvent @@ -179,7 +179,7 @@ index 923782e94dfbac8a3270c15538e6b85bcaf8e8f2..c35f5a1a42b76b154bfbb161d23348e7 return true; } -@@ -2000,7 +2000,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2007,7 +2007,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end - Add WorldGameRuleChangeEvent GameRules.Value<?> handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule.getName())); handle.deserialize(event.getValue()); // Paper - Add WorldGameRuleChangeEvent diff --git a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch index 954f93c541..bac0af6ad6 100644 --- a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch @@ -7,10 +7,10 @@ There are no plans to support creating worlds while worlds are being ticked themselvess. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c93008426 100644 +index c0353463f59ae4d3fe94ee15feb95a4ec1a064f4..6e7e8aa26a60d774d51148bc8dca5e5c901f81e7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -307,6 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Spigot end public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files public static long currentTickLong = 0L; // Paper - track current tick as a long @@ -18,7 +18,7 @@ index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); -@@ -1438,7 +1439,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1501,7 +1502,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getFunctions().tick(); MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper this.profiler.popPush("levels"); @@ -27,7 +27,7 @@ index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c // CraftBukkit start // Run tasks that are waiting on processing -@@ -1470,6 +1471,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1533,6 +1534,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Paper end - Perf: Optimize time updates MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper @@ -36,7 +36,7 @@ index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent -@@ -1508,6 +1511,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1571,6 +1574,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.profiler.pop(); worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions } @@ -45,7 +45,7 @@ index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c this.profiler.popPush("connection"); MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 62cecfbc3bf8f52078e18273d7c1ca940cff4105..3261c8715aee966d6e7234e60074ad59a841294f 100644 +index 006aa818b2985a129954390b878298deb6109981..3e002b7d9acdb05817b84641dfba75584fc6ed11 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -874,6 +874,11 @@ public final class CraftServer implements Server { diff --git a/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch index dce7d457e6..40008ff5ba 100644 --- a/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch +++ b/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch @@ -18,7 +18,7 @@ index e8b9050f9abe6f269aab775bb12993bcf18aff2a..2d4a471af69f3036fb2996aae3fd2696 private static boolean isOutsideSpawnableHeight(int y) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3ccb2128e8c 100644 +index 12013237e7b00f47d2a8660fd09ee3d52fdf084c..caca37e0febbfaa2012820c8a6f0e6adbaf2451b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -312,9 +312,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -54,7 +54,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3cc // Paper start - implement regenerateChunk method final ServerLevel serverLevel = this.world; final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); -@@ -502,6 +518,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -509,6 +525,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot @@ -62,7 +62,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3cc ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper // If generate = false, but the chunk already exists, we will get this back. -@@ -534,6 +551,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -541,6 +558,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean addPluginChunkTicket(int x, int z, Plugin plugin) { @@ -70,7 +70,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3cc Preconditions.checkArgument(plugin != null, "null plugin"); Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled"); -@@ -615,6 +633,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -622,6 +640,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setChunkForceLoaded(int x, int z, boolean forced) { @@ -78,7 +78,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3cc this.getHandle().setChunkForced(x, z, forced); } -@@ -927,6 +946,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -934,6 +953,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { @@ -86,7 +86,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3cc // Transient load for this tick return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); } -@@ -2336,6 +2356,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2343,6 +2363,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot end // Paper start public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { diff --git a/patches/server/0781-Add-NamespacedKey-biome-methods.patch b/patches/server/0781-Add-NamespacedKey-biome-methods.patch index 7823841639..1656e9d9f2 100644 --- a/patches/server/0781-Add-NamespacedKey-biome-methods.patch +++ b/patches/server/0781-Add-NamespacedKey-biome-methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods Co-authored-by: Thonk <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index fd1ec07ada04de98d0a4f1ca4c93ec53771f88d7..0185faee3051c04b4924753ba56536e4e070476b 100644 +index 34c19a422de27cd6aa08159186a0180215c0837d..3bf1c2a5273879a64e81bcd8c107e7bc82cf679c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -601,6 +601,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -605,6 +605,19 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(material.isBlock(), material + " is not a block"); return getBlock(material).hasCollision; } diff --git a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch index eb539d450b..68314fc167 100644 --- a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch @@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7819b889654cc6bac588532ffe7b32f36e9f8912..35eca4018d33d772f9a53f4d2a7830b8c38a8518 100644 +index 6e7e8aa26a60d774d51148bc8dca5e5c901f81e7..aaf49ff8339e360461dedfe940449b4bf9be1b66 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1160,6 +1160,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1223,6 +1223,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } catch (Exception ignored) { } // CraftBukkit end diff --git a/patches/server/0801-Elder-Guardian-appearance-API.patch b/patches/server/0801-Elder-Guardian-appearance-API.patch index 81483f0154..c4ebbd5d8a 100644 --- a/patches/server/0801-Elder-Guardian-appearance-API.patch +++ b/patches/server/0801-Elder-Guardian-appearance-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 93fb3ec75009ccbeba796146ffb6236cba2d8bd5..41a1f63b0772944b8dcc310510de8f6f372ae80d 100644 +index f97040ad62f10b1f12ab70b89573316f7c173bf7..9a10f548e6264ae1c3b8ec26670e6ebf340c7ecd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3147,6 +3147,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3149,6 +3149,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0816-Add-Player-Warden-Warning-API.patch b/patches/server/0816-Add-Player-Warden-Warning-API.patch index 9f3436ec3d..3a666d2056 100644 --- a/patches/server/0816-Add-Player-Warden-Warning-API.patch +++ b/patches/server/0816-Add-Player-Warden-Warning-API.patch @@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 41a1f63b0772944b8dcc310510de8f6f372ae80d..5823c8d3e9c2fa15ad0f062b1a5fe0286b64c712 100644 +index 9a10f548e6264ae1c3b8ec26670e6ebf340c7ecd..b6a5c3f38cf63ffd0ed86796dcea0f97bd048bd0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3152,6 +3152,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3154,6 +3154,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void showElderGuardian(boolean silent) { if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); } diff --git a/patches/server/0818-Add-paper-dumplisteners-command.patch b/patches/server/0818-Add-paper-dumplisteners-command.patch index 1919006e5d..ba293d1dad 100644 --- a/patches/server/0818-Add-paper-dumplisteners-command.patch +++ b/patches/server/0818-Add-paper-dumplisteners-command.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add /paper dumplisteners command Co-authored-by: TwoLeggedCat <[email protected]> diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf..a6793f227fa90a37260cf0b9d5e9b6f1f47ff920 100644 +index c9bb2df0d884227576ed8d2e72219bbbd7ba827e..534d9c380f26d6cce3c99fa88ad2e15410535094 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { +@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); diff --git a/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch index 6c8db92383..2486d05f04 100644 --- a/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch +++ b/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix async entity add due to fungus trees diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 1c2ec978f923521322aaec59b4e88d26d656b6cd..5ece375eaf6bcc61864997a389bb5e24625e4505 100644 +index ff94af5be8de374f5cde2607eebbb23e65705581..209596e89307b9e1d0ff4c465876d29fef4fc290 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -249,6 +249,7 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -228,6 +228,7 @@ public class WorldGenRegion implements WorldGenLevel { if (iblockdata.isAir()) { return false; } else { diff --git a/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch b/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch index e57df15047..a27e98f7ca 100644 --- a/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch +++ b/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Improve inlining for some hot BlockBehavior and FluidState diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index aa15d65f69f89da97cecd47c3458cd3b4937055f..a274d0c3b4cceb2688a41ac1c3fbaa1a03704224 100644 +index c8ccf424dccef47aaa9c9b6e03f49fe783035c0a..ab174986ad558916427a70f59c6907f17b0d01df 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -989,15 +989,15 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -975,15 +975,15 @@ public abstract class BlockBehaviour implements FeatureElement { return this.shapeExceedsCube; // Paper - moved into shape cache init } @@ -28,7 +28,7 @@ index aa15d65f69f89da97cecd47c3458cd3b4937055f..a274d0c3b4cceb2688a41ac1c3fbaa1a return this.isAir; } -@@ -1081,7 +1081,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1067,7 +1067,7 @@ public abstract class BlockBehaviour implements FeatureElement { } } @@ -37,7 +37,7 @@ index aa15d65f69f89da97cecd47c3458cd3b4937055f..a274d0c3b4cceb2688a41ac1c3fbaa1a return this.canOcclude; } -@@ -1289,11 +1289,11 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1275,11 +1275,11 @@ public abstract class BlockBehaviour implements FeatureElement { return this.getBlock().builtInRegistryHolder().is(key); } diff --git a/patches/server/0839-Flying-Fall-Damage.patch b/patches/server/0839-Flying-Fall-Damage.patch index 7d9c4d6035..fe06e47cf0 100644 --- a/patches/server/0839-Flying-Fall-Damage.patch +++ b/patches/server/0839-Flying-Fall-Damage.patch @@ -26,10 +26,10 @@ index e0fd3c3a129216ad1272a6e038eb16cb44e45475..182180275be3bf90b9f8e66dcf19ad6c } else { if (fallDistance >= 2.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3f8f928b61ff48e403d7a391343e62fbedf5826d..c9616b31b074c82eb06d9254ae65a0a85260d480 100644 +index 2f299e3485fca4701719a31ba6c981b91155cf05..f807dfc75a8e8f1e642aeedfb46def1e5aacde85 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2430,6 +2430,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2432,6 +2432,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().onUpdateAbilities(); } diff --git a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch index 5644b80eb8..33bafa151a 100644 --- a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch @@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 016cebed19ca382a40e4fabee1b96aec816944bf..469e108c844880b1a95e5aa9f0f8f12375cc314a 100644 +index aaf49ff8339e360461dedfe940449b4bf9be1b66..f7e5d95bd94b87fb17fa98a170d171fbdd6d8357 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1434,6 +1434,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1497,6 +1497,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper @@ -1251,7 +1251,7 @@ index fb934b069312ce27c8ebaf3d3645b2c2475bd87f..ecdf98872f2f9b9b067be80701f20775 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 b66b01a743353e3b829f65bc619b39cc62d5f4fe..cc8e826c72ca954030c5b42f6704a6e95cb88c31 100644 +index ae67d4f7b7609c41952780c6088b8b7d58f9be6d..dc1f933c6d76880062e8b25d4227bf75b62a2160 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -306,6 +306,76 @@ public final class CraftServer implements Server { diff --git a/patches/server/0914-Fix-custom-statistic-criteria-creation.patch b/patches/server/0914-Fix-custom-statistic-criteria-creation.patch index cb796007fd..65ade03da5 100644 --- a/patches/server/0914-Fix-custom-statistic-criteria-creation.patch +++ b/patches/server/0914-Fix-custom-statistic-criteria-creation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix custom statistic criteria creation diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0185faee3051c04b4924753ba56536e4e070476b..1cdcd673e67090b6ba3ec7b38bd062c0d8f7308a 100644 +index 3bf1c2a5273879a64e81bcd8c107e7bc82cf679c..187854e8c560234710763f8e92c1a026550ba60d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -614,6 +614,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -618,6 +618,12 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); cra.setBiome(x, y, z, biomeBase); } diff --git a/patches/server/0915-Bandaid-fix-for-Effect.patch b/patches/server/0915-Bandaid-fix-for-Effect.patch index 7cc42138ae..323cc5986c 100644 --- a/patches/server/0915-Bandaid-fix-for-Effect.patch +++ b/patches/server/0915-Bandaid-fix-for-Effect.patch @@ -60,10 +60,10 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9 case COMPOSTER_FILL_ATTEMPT: datavalue = ((Boolean) data) ? 1 : 0; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 551e13635a82df8f2a420a758d08d3ccb2128e8c..3cca22e7ef6a2558a539d67705fc64c0f8867fe8 100644 +index caca37e0febbfaa2012820c8a6f0e6adbaf2451b..467aacb5ce61ac79d8294067fd681b081c195fbe 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1351,7 +1351,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1358,7 +1358,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { public <T> void playEffect(Location loc, Effect effect, T data, int radius) { if (data != null) { Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect); @@ -73,7 +73,7 @@ index 551e13635a82df8f2a420a758d08d3ccb2128e8c..3cca22e7ef6a2558a539d67705fc64c0 // Special case: the axis is optional for ELECTRIC_SPARK Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a003b72f5c0384712ffd39f6505a408e09cbbc25..6d6bbd1d40bbb6d8c0b9a03b6c69f98c0370e866 100644 +index 63b7118d23959ad75565271cc2b8a1143cd550e1..d06bce05edf6026be2af9583cddea70739a72032 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -831,7 +831,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch index 1b37f747b4..0dabb11567 100644 --- a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch +++ b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch @@ -10,10 +10,10 @@ which would cause a crash on Folia but would appear to function fine on Paper. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 7ca4790d564846c1ab9560e349005eea8aef35b8..94e9919da2ba5a36afa5b7f97af888cb113bb14b 100644 +index 29aaedbe70901fdd98f15f2ca5ba382106091d1a..f594b5c60c723ef70e51ab30b45b90f89d6972d6 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -346,6 +346,13 @@ public class ChunkSerializer { +@@ -307,6 +307,13 @@ public class ChunkSerializer { for (int k1 = 0; k1 < nbttaglist3.size(); ++k1) { CompoundTag nbttagcompound4 = nbttaglist3.getCompound(k1); @@ -27,7 +27,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..94e9919da2ba5a36afa5b7f97af888cb ((ChunkAccess) object1).setBlockEntityNbt(nbttagcompound4); } -@@ -591,10 +598,19 @@ public class ChunkSerializer { +@@ -517,10 +524,19 @@ public class ChunkSerializer { CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i); boolean flag = nbttagcompound1.getBoolean("keepPacked"); diff --git a/patches/server/0958-Add-player-idle-duration-API.patch b/patches/server/0958-Add-player-idle-duration-API.patch index 6a84393957..d112b47a20 100644 --- a/patches/server/0958-Add-player-idle-duration-API.patch +++ b/patches/server/0958-Add-player-idle-duration-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API Implements API for getting and resetting a player's idle duration. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ea8eca5a7359d68095d073ea725f12a45e44dcaa..350d4e75401d2adda3f60e5637eac3d6c278c928 100644 +index 3155a7978f9cb77c7cfe299f751f2231ba71c478..7523db3196409c5d04069ff4bd22ba06bcfbbe84 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3269,6 +3269,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3271,6 +3271,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch b/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch index 68e3bc845e..8488f5abd8 100644 --- a/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch +++ b/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch @@ -47,10 +47,10 @@ index c978f3b2d42f512e982f289e76c2422e41b7eec6..bb8e962e63c7a2d931f9bd7f7c002aa3 Vec3 vec3d = raytrace1.getFrom().subtract(raytrace1.getTo()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a8993837da2d 100644 +index 467aacb5ce61ac79d8294067fd681b081c195fbe..3a941be852a2dd5114ca9673597e84e3813d6ee2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1085,9 +1085,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1092,9 +1092,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<? super Entity> filter) { @@ -68,7 +68,7 @@ index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a899 Preconditions.checkArgument(direction != null, "Vector direction cannot be null"); direction.checkFinite(); -@@ -1137,9 +1143,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1144,9 +1150,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) { @@ -87,7 +87,7 @@ index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a899 Preconditions.checkArgument(direction != null, "Vector direction cannot be null"); direction.checkFinite(); -@@ -1152,16 +1165,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1159,16 +1172,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { } Vector dir = direction.clone().normalize().multiply(maxDistance); diff --git a/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch b/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch index ddd7a5783d..beed351bbb 100644 --- a/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch +++ b/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch @@ -45,10 +45,10 @@ index 0db0d67f9ac15372becc1166c37f7f0aede4a4da..a9e70484b01fc082ea25d43d1d428334 BlockState iblockdata = BaseFireBlock.getState(this.level(), blockposition); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 11ad72b87651b380ceb7083322d1a8993837da2d..0617419975f843f3899b2cb013fd37ea631dd320 100644 +index 3a941be852a2dd5114ca9673597e84e3813d6ee2..da5f8dc6b4fce78f5f6278396d58474a5cc13f12 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -733,7 +733,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -740,7 +740,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { LightningBolt lightning = EntityType.LIGHTNING_BOLT.create(this.world); lightning.moveTo(loc.getX(), loc.getY(), loc.getZ()); diff --git a/patches/server/0976-Add-Structure-check-API.patch b/patches/server/0975-Add-Structure-check-API.patch index 01a73c5287..12af3e4045 100644 --- a/patches/server/0976-Add-Structure-check-API.patch +++ b/patches/server/0975-Add-Structure-check-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Structure check API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 0617419975f843f3899b2cb013fd37ea631dd320..d7fb40682d446b962d9e19ca88b297c4e9a28231 100644 +index d3ea1097a3df1af221d190aaa8c7c246f75e2b90..a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -230,6 +230,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch b/patches/server/0976-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch index 40da841e83..40da841e83 100644 --- a/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch +++ b/patches/server/0976-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch diff --git a/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch index 74f1b6a5c6..5f294896fb 100644 --- a/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch @@ -50,7 +50,7 @@ index 6147ffdcb83a9d013a05facd75453d6500064fe7..ecf463139bb6567103d81ae26cfff53d if (entityitem == null) { return null; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7fa7cb2a567c90a4bb7cf20c7182c45395b6ea32..2a1cbb548bfe65382483597c6350450033dffdb1 100644 +index 5fec06e12ede63496f75ccf43f52b16301d11eb0..4575e3e8a21e47d39fd3639163e804ec9dc452a6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2476,6 +2476,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0980-add-more-scoreboard-API.patch b/patches/server/0979-add-more-scoreboard-API.patch index 3365b53a36..3365b53a36 100644 --- a/patches/server/0980-add-more-scoreboard-API.patch +++ b/patches/server/0979-add-more-scoreboard-API.patch diff --git a/patches/server/0981-Improve-Registry.patch b/patches/server/0980-Improve-Registry.patch index 162949848b..162949848b 100644 --- a/patches/server/0981-Improve-Registry.patch +++ b/patches/server/0980-Improve-Registry.patch diff --git a/patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/0981-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch index aa658a4835..aa658a4835 100644 --- a/patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch +++ b/patches/server/0981-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch diff --git a/patches/server/0983-Add-experience-points-API.patch b/patches/server/0982-Add-experience-points-API.patch index c7b16fc198..23a45d1ba3 100644 --- a/patches/server/0983-Add-experience-points-API.patch +++ b/patches/server/0982-Add-experience-points-API.patch @@ -18,7 +18,7 @@ index 182180275be3bf90b9f8e66dcf19ad6ce02136bf..2759fa8768cfa7a38af7266a8e58af5f // Paper start - send while respecting visibility private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 51a63de2e0bb43c35cd9b8e6c431ec81fc9aecd1..89a248b392a4001e951415a3560c39259a83e8d0 100644 +index 81d89d2d3c3144e6b4667597d39eddcceb9f1913..5743013c527c80f2dda444b5bf2d8872ff000386 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1779,6 +1779,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0984-Add-drops-to-shear-events.patch b/patches/server/0983-Add-drops-to-shear-events.patch index 77b35dfe1f..77b35dfe1f 100644 --- a/patches/server/0984-Add-drops-to-shear-events.patch +++ b/patches/server/0983-Add-drops-to-shear-events.patch diff --git a/patches/server/0985-Add-PlayerShieldDisableEvent.patch b/patches/server/0984-Add-PlayerShieldDisableEvent.patch index 0e89bafeb1..0e89bafeb1 100644 --- a/patches/server/0985-Add-PlayerShieldDisableEvent.patch +++ b/patches/server/0984-Add-PlayerShieldDisableEvent.patch diff --git a/patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0985-Validate-ResourceLocation-in-NBT-reading.patch index a88ee23306..a88ee23306 100644 --- a/patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch +++ b/patches/server/0985-Validate-ResourceLocation-in-NBT-reading.patch diff --git a/patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch b/patches/server/0986-Properly-handle-experience-dropping-on-block-break.patch index 3cebe8aa1c..0fb2129a50 100644 --- a/patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch +++ b/patches/server/0986-Properly-handle-experience-dropping-on-block-break.patch @@ -68,10 +68,10 @@ index 660ede322b4f4ccad241820d8ffd4540ebb18fbc..63217d3db86b467f3358730eb8b9b3c9 } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index a274d0c3b4cceb2688a41ac1c3fbaa1a03704224..4c6ab71c3222ce03edd70abef35c71398d885c13 100644 +index ab174986ad558916427a70f59c6907f17b0d01df..20de3aeb4991dcfd0bbf813075a4c76e277b7598 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -1197,6 +1197,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1183,6 +1183,7 @@ public abstract class BlockBehaviour implements FeatureElement { public void spawnAfterBreak(ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) { this.getBlock().spawnAfterBreak(this.asState(), world, pos, tool, dropExperience); diff --git a/patches/server/0988-Fixup-NamespacedKey-handling.patch b/patches/server/0987-Fixup-NamespacedKey-handling.patch index 14ddcf111d..14ddcf111d 100644 --- a/patches/server/0988-Fixup-NamespacedKey-handling.patch +++ b/patches/server/0987-Fixup-NamespacedKey-handling.patch diff --git a/patches/server/0990-Expose-LootTable-of-DecoratedPot.patch b/patches/server/0988-Expose-LootTable-of-DecoratedPot.patch index 6d5e2738de..6d5e2738de 100644 --- a/patches/server/0990-Expose-LootTable-of-DecoratedPot.patch +++ b/patches/server/0988-Expose-LootTable-of-DecoratedPot.patch diff --git a/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 364e247001..d64cc30c77 100644 --- a/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -18,7 +18,7 @@ index 3c4ac79c094dc2fff7de94150a34b7bf814ac0de..38b56923a642afc1cb411480ba03cc78 @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 0801bbba0ea2a5d6e19d503ee31ad6717f1d5234..a1fd9d902bb6ebca7ca7edc584cbf72a138368eb 100644 +index 886ddaf896c8385a744e9abe4dcd399bc693f60b..9dab2dd7fd77fa1006c903dc5d1f4f8339e10b91 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1735,10 +1735,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider diff --git a/patches/server/0015-Rewrite-dataconverter-system.patch b/patches/server/0990-Rewrite-dataconverter-system.patch index b25429c6d6..ef1dfaa9bd 100644 --- a/patches/server/0015-Rewrite-dataconverter-system.patch +++ b/patches/server/0990-Rewrite-dataconverter-system.patch @@ -24806,10 +24806,10 @@ index 2939fad9c86f358b317f815d6efff0f41f6a3ea8..3e4cd09fc37d72d22a0f966039d1e65b return structureTemplate.save(new CompoundTag()); } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -index 25623dcd44edc475c5dce2756bf99fc18e142b63..6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f 100644 +index 6743dca44e6552ad39aca757a24f3c4df400d83d..eebaf98bc0fa4696af59b2a79563beb73501a554 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -@@ -78,7 +78,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -79,7 +79,7 @@ public class ChunkStorage implements AutoCloseable { int i = ChunkStorage.getVersion(nbttagcompound); // CraftBukkit start @@ -24818,7 +24818,7 @@ index 25623dcd44edc475c5dce2756bf99fc18e142b63..6c0f87535ffa95cf82ab4b03bb7bf8f2 CompoundTag level = nbttagcompound.getCompound("Level"); if (level.getBoolean("TerrainPopulated") && !level.getBoolean("LightPopulated")) { ServerChunkCache cps = (generatoraccess == null) ? null : ((ServerLevel) generatoraccess).getChunkSource(); -@@ -90,7 +90,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -91,7 +91,7 @@ public class ChunkStorage implements AutoCloseable { // CraftBukkit end if (i < 1493) { @@ -24827,7 +24827,7 @@ index 25623dcd44edc475c5dce2756bf99fc18e142b63..6c0f87535ffa95cf82ab4b03bb7bf8f2 if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) { LegacyStructureDataHandler persistentstructurelegacy = this.getLegacyStructureHandler(resourcekey, supplier); -@@ -108,7 +108,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -109,7 +109,7 @@ public class ChunkStorage implements AutoCloseable { // Spigot end ChunkStorage.injectDatafixingContext(nbttagcompound, resourcekey, optional); @@ -24926,7 +24926,7 @@ index 836bcea1c6a9de29b4a248220331f3a8c697204d..399da9d43aefbb95897df4697860d5bc Path path = save.dataFile(); diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java -index 8292978e1386c55d99241c3ee2ead3440b9e2570..3d74ffc6e38b0dbe7ca6d8d84a63f78d6b1908a7 100644 +index 49d39980054bce470ddaceeb6ab7fab83bf8dc54..63e187c65cb855031f286aad0d25ac4694f7a331 100644 --- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java +++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java @@ -97,7 +97,7 @@ public class PlayerDataStorage { @@ -24938,3 +24938,26 @@ index 8292978e1386c55d99241c3ee2ead3440b9e2570..3d74ffc6e38b0dbe7ca6d8d84a63f78d player.load(nbttagcompound); } +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index b9183a9a657c2cd320fca0f15db0dae6827546f1..4e1390b9244aeb745ffd3fd1257bc74248722515 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -500,8 +500,7 @@ public final class CraftMagicNumbers implements UnsafeValues { + + CompoundTag compound = deserializeNbtFromBytes(data); + final int dataVersion = compound.getInt("DataVersion"); +- compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); +- return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound)); ++ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, this.getDataVersion()))); // Paper - rewrite dataconverter + } + + @Override +@@ -521,7 +520,7 @@ public final class CraftMagicNumbers implements UnsafeValues { + + CompoundTag compound = deserializeNbtFromBytes(data); + int dataVersion = compound.getInt("DataVersion"); +- compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ENTITY, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); ++ compound = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY, compound, dataVersion, getDataVersion()); // Paper - rewrite dataconverter + if (!preserveUUID) { + // Generate a new UUID so we don't have to worry about deserializing the same entity twice + compound.remove("UUID"); diff --git a/patches/server/0016-Starlight.patch b/patches/server/0991-Starlight.patch index 39d3cff759..a563feb5eb 100644 --- a/patches/server/0016-Starlight.patch +++ b/patches/server/0991-Starlight.patch @@ -7,7 +7,6 @@ See https://github.com/PaperMC/Starlight == AT == public net.minecraft.server.level.ChunkHolder broadcast(Lnet/minecraft/network/protocol/Packet;Z)V -public net.minecraft.world.level.chunk.LevelChunkSection states diff --git a/src/main/java/ca/spottedleaf/starlight/common/light/BlockStarLightEngine.java b/src/main/java/ca/spottedleaf/starlight/common/light/BlockStarLightEngine.java new file mode 100644 @@ -4347,13 +4346,13 @@ index 0000000000000000000000000000000000000000..dd995e25ae620ae36cd5eecb2fe10ad0 + +} diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 6d06b772ffb9d47d6a717462a4b2b494544e80ae..de0e1ad2c78e5132651494f198703533847c84bd 100644 +index 534d9c380f26d6cce3c99fa88ad2e15410535094..e47fb2aa5e885162cae5cbfc9f33ff7864bf538e 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -38,6 +38,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("reload"), new ReloadCommand()); - commands.put(Set.of("version"), new VersionCommand()); - commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); +@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("dumpitem"), new DumpItemCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); + commands.put(Set.of("dumplisteners"), new DumpListenersCommand()); + commands.put(Set.of("fixlight"), new FixLightCommand()); return commands.entrySet().stream() @@ -4480,7 +4479,7 @@ index 0000000000000000000000000000000000000000..463c6d8d5b114816ed90655582859458 + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 5250bf5029825524c239854db7999883459f1a8a..c5cd2c2c28795593712b0de2bbaa7e3860f1131a 100644 +index facfdbb87e89f4db33ce13233c2ba4366d35c15b..807a6bb1026dac2c4cd0a50afe06fd62ce23558b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -53,7 +53,7 @@ public class ChunkHolder { @@ -4493,7 +4492,7 @@ index 5250bf5029825524c239854db7999883459f1a8a..c5cd2c2c28795593712b0de2bbaa7e38 private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory; public int oldTicketLevel; diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 7ee1b9fe8099091feaf09c4e7ffda99159b33c9b..c581ddf24f66a98798e8965adc848638edd889de 100644 +index 9dab2dd7fd77fa1006c903dc5d1f4f8339e10b91..3ae47b86b80f9156e71d1da83e492153f360d1b5 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -125,7 +125,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -4506,7 +4505,7 @@ index 7ee1b9fe8099091feaf09c4e7ffda99159b33c9b..c581ddf24f66a98798e8965adc848638 private final RandomState randomState; private final ChunkGeneratorStructureState chunkGeneratorState; diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java -index 76005b3c48bfa323a77781c20c63708eeaa66b2b..222e72baa2fdb27c592e4c9ebef8303263b8d8ce 100644 +index 4e1618462840a1378dbe6492696c97544815edf2..8e8e3896040241bba8fd15f4d6d046567847f741 100644 --- a/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java @@ -380,7 +380,7 @@ public abstract class DistanceManager { @@ -4851,7 +4850,7 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..6051e5f272838ef23276a90e21c2fc82 public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) { return new TicketType<>(name, argumentComparator, 0L); diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index d11741d2618976bdb51f75d823f260f32d5bafc9..23dfc741b31cdc25265fb5daffcae63417102a41 100644 +index 209596e89307b9e1d0ff4c465876d29fef4fc290..c3e7bd8865cc8990fc59f1ff0dfc1697cbb5ca49 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -107,6 +107,27 @@ public class WorldGenRegion implements WorldGenLevel { @@ -4883,18 +4882,18 @@ index d11741d2618976bdb51f75d823f260f32d5bafc9..23dfc741b31cdc25265fb5daffcae634 return this.level.getChunkSource().chunkMap.isOldChunkAround(chunkPos, checkRadius); } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..a009fca54665cbc3f11cad776256fbf1fbbb18c7 100644 +index 20de3aeb4991dcfd0bbf813075a4c76e277b7598..4c6ab71c3222ce03edd70abef35c71398d885c13 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -874,6 +874,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -881,6 +881,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.spawnTerrainParticles = blockbase_info.spawnTerrainParticles; this.instrument = blockbase_info.instrument; this.replaceable = blockbase_info.replaceable; + this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper } - - private boolean calculateSolid() { -@@ -902,6 +903,18 @@ public abstract class BlockBehaviour implements FeatureElement { + // Paper start - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time + private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; +@@ -917,6 +918,18 @@ public abstract class BlockBehaviour implements FeatureElement { return this.shapeExceedsCube; } // Paper end @@ -4913,7 +4912,7 @@ index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..a009fca54665cbc3f11cad776256fbf1 public void initCache() { this.fluidState = ((Block) this.owner).getFluidState(this.asState()); -@@ -910,6 +923,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -925,6 +938,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.cache = new BlockBehaviour.BlockStateBase.Cache(this.asState()); } this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here @@ -5135,10 +5134,10 @@ index 6bb508105641b5729572736c5c3f9bd6711e309a..60e760b42dd6471a229dfd45490dcf8c @Override public BlockEntity getBlockEntity(BlockPos pos) { diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516a07c114b 100644 +index af757309cb46af6df07872f7596b66df6d6f18d7..73e682bb3ef3b2e450ec8c594b5365c7a340615e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -219,6 +219,12 @@ public class LevelChunk extends ChunkAccess { +@@ -220,6 +220,12 @@ public class LevelChunk extends ChunkAccess { public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) { this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData()); @@ -5151,7 +5150,7 @@ index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516 Iterator iterator = protoChunk.getBlockEntities().values().iterator(); while (iterator.hasNext()) { -@@ -245,7 +251,7 @@ public class LevelChunk extends ChunkAccess { +@@ -246,7 +252,7 @@ public class LevelChunk extends ChunkAccess { } } @@ -5160,7 +5159,7 @@ index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516 this.setLightCorrect(protoChunk.isLightCorrect()); this.unsaved = true; this.needsDecoration = true; // CraftBukkit -@@ -426,7 +432,7 @@ public class LevelChunk extends ChunkAccess { +@@ -437,7 +443,7 @@ public class LevelChunk extends ChunkAccess { ProfilerFiller gameprofilerfiller = this.level.getProfiler(); gameprofilerfiller.push("updateSkyLightSources"); @@ -5170,7 +5169,7 @@ index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516 this.level.getChunkSource().getLightEngine().checkBlock(blockposition); gameprofilerfiller.pop(); diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index b8fb6d1d85e07f5165bfaf7d80807e069b595851..1219200cd915d6239a32a2bd09d325cd8fa9b346 100644 +index dd62e257e16974a6d556a7f5e2d113a2cbc08981..dfae0918079425df92d958b04275be8ae60d4b60 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -143,7 +143,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -5196,13 +5195,13 @@ index 38ec21faaa16df5485a81a581506700a5ab0a440..7da1ed9640211b0e064162dcdb000053 } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb694632ede5 100644 +index f594b5c60c723ef70e51ab30b45b90f89d6972d6..7e416ad09959a08931c207f62d97af4ee868c039 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -84,6 +84,14 @@ public class ChunkSerializer { - public static final String BLOCK_LIGHT_TAG = "BlockLight"; - public static final String SKY_LIGHT_TAG = "SkyLight"; - +@@ -88,6 +88,14 @@ public class ChunkSerializer { + private static final int CURRENT_DATA_VERSION = net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion(); + private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); + // Paper end - Do not let the server load chunks from newer versions + // Paper start - replace light engine impl + private static final int STARLIGHT_LIGHT_VERSION = 9; + @@ -5213,8 +5212,8 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 + public ChunkSerializer() {} - public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { -@@ -94,13 +102,20 @@ public class ChunkSerializer { + // Paper start - guard against serializing mismatching coordinates +@@ -119,13 +127,20 @@ public class ChunkSerializer { } UpgradeData chunkconverter = nbt.contains("UpgradeData", 10) ? new UpgradeData(nbt.getCompound("UpgradeData"), world) : UpgradeData.EMPTY; @@ -5236,7 +5235,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 Registry<Biome> iregistry = world.registryAccess().registryOrThrow(Registries.BIOME); Codec<PalettedContainer<Holder<Biome>>> codec = ChunkSerializer.makeBiomeCodecRW(iregistry); // CraftBukkit - read/write boolean flag2 = false; -@@ -108,7 +123,7 @@ public class ChunkSerializer { +@@ -133,7 +148,7 @@ public class ChunkSerializer { DataResult dataresult; for (int j = 0; j < nbttaglist.size(); ++j) { @@ -5245,7 +5244,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 byte b0 = nbttagcompound1.getByte("Y"); int k = world.getSectionIndexFromSectionY(b0); -@@ -151,19 +166,39 @@ public class ChunkSerializer { +@@ -176,19 +191,39 @@ public class ChunkSerializer { boolean flag3 = nbttagcompound1.contains("BlockLight", 7); boolean flag4 = flag1 && nbttagcompound1.contains("SkyLight", 7); @@ -5293,7 +5292,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 } } -@@ -192,6 +227,8 @@ public class ChunkSerializer { +@@ -217,6 +252,8 @@ public class ChunkSerializer { }, chunkPos); object1 = new LevelChunk(world.getLevel(), chunkPos, chunkconverter, levelchunkticks, levelchunkticks1, l, achunksection, ChunkSerializer.postLoadChunk(world, nbt), blendingdata); @@ -5302,7 +5301,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 } else { ProtoChunkTicks<Block> protochunkticklist = ProtoChunkTicks.load(nbt.getList("block_ticks", 10), (s) -> { return BuiltInRegistries.BLOCK.getOptional(ResourceLocation.tryParse(s)); -@@ -200,6 +237,8 @@ public class ChunkSerializer { +@@ -225,6 +262,8 @@ public class ChunkSerializer { return BuiltInRegistries.FLUID.getOptional(ResourceLocation.tryParse(s)); }, chunkPos); ProtoChunk protochunk = new ProtoChunk(chunkPos, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, world, iregistry, blendingdata); @@ -5311,7 +5310,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 object1 = protochunk; protochunk.setInhabitedTime(l); -@@ -314,6 +353,12 @@ public class ChunkSerializer { +@@ -346,6 +385,12 @@ public class ChunkSerializer { // CraftBukkit end public static CompoundTag write(ServerLevel world, ChunkAccess chunk) { @@ -5324,7 +5323,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 ChunkPos chunkcoordintpair = chunk.getPos(); CompoundTag nbttagcompound = NbtUtils.addCurrentDataVersion(new CompoundTag()); -@@ -363,11 +408,14 @@ public class ChunkSerializer { +@@ -395,11 +440,14 @@ public class ChunkSerializer { for (int i = lightenginethreaded.getMinLightSection(); i < lightenginethreaded.getMaxLightSection(); ++i) { int j = chunk.getSectionIndexFromSectionY(i); boolean flag1 = j >= 0 && j < achunksection.length; @@ -5343,7 +5342,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 if (flag1) { LevelChunkSection chunksection = achunksection[j]; -@@ -382,13 +430,27 @@ public class ChunkSerializer { +@@ -414,13 +462,27 @@ public class ChunkSerializer { nbttagcompound1.put("biomes", (Tag) dataresult1.getOrThrow(false, logger1::error)); } @@ -5375,7 +5374,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 if (!nbttagcompound1.isEmpty()) { nbttagcompound1.putByte("Y", (byte) i); -@@ -399,7 +461,8 @@ public class ChunkSerializer { +@@ -431,7 +493,8 @@ public class ChunkSerializer { nbttagcompound.put("sections", nbttaglist); if (flag) { @@ -5385,7 +5384,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 } ListTag nbttaglist1 = new ListTag(); -@@ -473,6 +536,17 @@ public class ChunkSerializer { +@@ -505,6 +568,17 @@ public class ChunkSerializer { })); } @@ -5403,3 +5402,21 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 public static ChunkStatus.ChunkType getChunkTypeFromTag(@Nullable CompoundTag nbt) { return nbt != null ? ChunkStatus.byName(nbt.getString("Status")).getChunkType() : ChunkStatus.ChunkType.PROTOCHUNK; } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 4ae206af89a413edb09319fd4bce2a94c575c617..5cc2deb8f170452c7049743068bf281f67687db9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -490,12 +490,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + } + } + +- for (final ChunkPos pos : chunksToRelight) { +- final ChunkAccess chunk = serverChunkCache.getChunk(pos.x, pos.z, false); +- if (chunk != null) { +- serverChunkCache.getLightEngine().lightChunk(chunk, false); +- } +- } ++ serverChunkCache.getLightEngine().relight(chunksToRelight, pos -> {}, relit -> {}); // Paper - Starlight + + return true; + // Paper end - implement regenerate chunk method diff --git a/patches/server/0991-Rewrite-chunk-system.patch b/patches/server/0992-Rewrite-chunk-system.patch index e4f89841a2..acd575015b 100644 --- a/patches/server/0991-Rewrite-chunk-system.patch +++ b/patches/server/0992-Rewrite-chunk-system.patch @@ -15266,13 +15266,13 @@ index 0000000000000000000000000000000000000000..f7b0e2564ac4bd2db1d2b2bdc230c9f5 + } +} diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index a6793f227fa90a37260cf0b9d5e9b6f1f47ff920..596ef21a05a5c9311adcd8799239b1532d9bb747 100644 +index e47fb2aa5e885162cae5cbfc9f33ff7864bf538e..b68b37274f22c2a89d723aec4d1c6be813eef73c 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java @@ -43,6 +43,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("dumpitem"), new DumpItemCommand()); commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); commands.put(Set.of("dumplisteners"), new DumpListenersCommand()); + commands.put(Set.of("fixlight"), new FixLightCommand()); + commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); return commands.entrySet().stream() @@ -16642,10 +16642,10 @@ index deb2d8c22a1c5724d0ac8571f4ea54711988dc4b..72d013d06705b08ed696e3d3b6d631d6 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce800a94811d 100644 +index 7d637094afecc2a838f9cc5cc837f8bf63cfd5aa..b27cdfd527d9234b51eba7bb642968fa886d460e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -310,7 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -311,7 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); @@ -16654,7 +16654,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 ((MinecraftServer) atomicreference.get()).runServer(); }, "Server thread"); -@@ -642,7 +642,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -643,7 +643,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.forceDifficulty(); for (ServerLevel worldserver : this.getAllLevels()) { this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver); @@ -16663,7 +16663,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); } -@@ -855,6 +855,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -856,6 +856,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public abstract boolean shouldRconBroadcast(); public boolean saveAllChunks(boolean suppressLogs, boolean flush, boolean force) { @@ -16676,7 +16676,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 boolean flag3 = false; for (Iterator iterator = this.getAllLevels().iterator(); iterator.hasNext(); flag3 = true) { -@@ -863,8 +869,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -864,8 +870,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (!suppressLogs) { MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location()); } @@ -16691,7 +16691,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 } // CraftBukkit start - moved to WorldServer.save -@@ -883,7 +893,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -884,7 +894,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator1.hasNext()) { ServerLevel worldserver2 = (ServerLevel) iterator1.next(); @@ -16700,7 +16700,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 } MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved"); -@@ -964,36 +974,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -965,36 +975,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } } @@ -16738,7 +16738,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 this.isSaving = false; this.resources.close(); -@@ -1012,7 +993,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1013,7 +994,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving } // Spigot end @@ -16747,8 +16747,8 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 } public String getLocalIp() { -@@ -1054,6 +1035,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - } +@@ -1106,6 +1087,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + // Paper end // Spigot End + public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system @@ -16756,9 +16756,9 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 protected void runServer() { try { if (!this.initServer()) { -@@ -1069,6 +1052,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - Arrays.fill( this.recentTps, 20 ); - long tickSection = Util.getMillis(), tickCount = 1; +@@ -1124,6 +1107,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + long currentTime; + // Paper end - further improve server tick loop while (this.running) { + // Paper start - rewrite chunk system + // guarantee that nothing can stop the server from halting if it can at least still tick @@ -16769,7 +16769,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 long i; if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) { -@@ -1194,6 +1183,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1257,6 +1246,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } private boolean haveTime() { @@ -16781,7 +16781,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 // CraftBukkit start if (isOversleep) return canOversleep(); // Paper - because of our changes, this logic is broken return this.forceTicks || this.runningTask() || Util.getNanos() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTimeNanos : this.nextTickTimeNanos); -@@ -1437,7 +1431,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1500,7 +1494,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Paper start - Folia scheduler API ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); getAllLevels().forEach(level -> { @@ -16790,7 +16790,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 if (entity.isRemoved()) { continue; } -@@ -2457,7 +2451,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2520,7 +2514,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // CraftBukkit start @Override public boolean isSameThread() { @@ -21370,7 +21370,7 @@ index 73e682bb3ef3b2e450ec8c594b5365c7a340615e..6a5756bd333d9b221e7770842e5114d2 public void setFullStatus(Supplier<FullChunkStatus> levelTypeProvider) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 94e9919da2ba5a36afa5b7f97af888cb113bb14b..5aff6454b5b1c7834adca8f1234ec4848aa3709c 100644 +index 7e416ad09959a08931c207f62d97af4ee868c039..5d50f1bcba507975b8942529104c0ccd5e08c252 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -110,6 +110,17 @@ public class ChunkSerializer { @@ -22531,7 +22531,7 @@ index 1eff5e4800ad3b628a42113fb3ba67458e56a40d..d4e0ef75dd12709a0dcf9193821c30b8 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b23cc5371cb8fc2cfaba70c73cd9d4b0accb3283..b63a0770e80f16848861a4747586ad22b9f9520b 100644 +index 28529732f23fefc8f642a44b95779f9e1cc2bb64..cbe6e8dae17b30905a28167449f1799b66d403c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1384,7 +1384,6 @@ public final class CraftServer implements Server { @@ -22561,10 +22561,10 @@ index b23cc5371cb8fc2cfaba70c73cd9d4b0accb3283..b63a0770e80f16848861a4747586ad22 // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd3594abfa68 100644 +index 5cc2deb8f170452c7049743068bf281f67687db9..84ec87b889d0d450293310e18c34aef505a8147b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -499,10 +499,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -501,10 +501,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; @@ -22582,7 +22582,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null); for (ServerPlayer player : playersInRange) { -@@ -510,8 +514,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -512,8 +516,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { player.connection.send(refreshPacket); } @@ -22592,7 +22592,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 return true; } -@@ -590,20 +593,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -592,20 +595,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Collection<Plugin> getPluginChunkTickets(int x, int z) { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22614,7 +22614,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 } @Override -@@ -611,7 +601,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -613,7 +603,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>(); DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22623,7 +22623,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 long chunkKey = chunkTickets.getLongKey(); SortedArraySet<Ticket<?>> tickets = chunkTickets.getValue(); -@@ -1273,12 +1263,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1275,12 +1265,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getViewDistance() { @@ -22638,7 +22638,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 } public BlockMetadataStore getBlockMetadata() { -@@ -2420,17 +2410,20 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2422,17 +2412,20 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setSimulationDistance(final int simulationDistance) { diff --git a/patches/server/0992-incremental-chunk-and-player-saving.patch b/patches/server/0993-incremental-chunk-and-player-saving.patch index 4f3f105b0b..7f13d86479 100644 --- a/patches/server/0992-incremental-chunk-and-player-saving.patch +++ b/patches/server/0993-incremental-chunk-and-player-saving.patch @@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c546341dc36f5c0526008ff041efff5d491445ff..cae27c2182618bace836ac8356b260d51cad303d 100644 +index 103d2b4169215a8931d33b499fbfeb2354163712..ca352fc1a3d206f9a1fc52eba787e66040d5882c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -907,7 +907,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -908,7 +908,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa try { this.isSaving = true; @@ -17,7 +17,7 @@ index c546341dc36f5c0526008ff041efff5d491445ff..cae27c2182618bace836ac8356b260d5 flag3 = this.saveAllChunks(suppressLogs, flush, force); } finally { this.isSaving = false; -@@ -1324,16 +1324,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1387,16 +1387,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } --this.ticksUntilAutosave; diff --git a/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0994-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch index 7b15fdd4fe..7b15fdd4fe 100644 --- a/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch +++ b/patches/server/0994-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch diff --git a/patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 28206c3e56..28206c3e56 100644 --- a/patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/patches/server/0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch diff --git a/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch index 8e271a005e..8e271a005e 100644 --- a/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch +++ b/patches/server/0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch diff --git a/patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0997-Optimize-Network-Manager-and-add-advanced-packet-sup.patch index 4c83d00b56..4c83d00b56 100644 --- a/patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch +++ b/patches/server/0997-Optimize-Network-Manager-and-add-advanced-packet-sup.patch diff --git a/patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0998-Allow-Saving-of-Oversized-Chunks.patch index f6a81ca166..f6a81ca166 100644 --- a/patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch +++ b/patches/server/0998-Allow-Saving-of-Oversized-Chunks.patch diff --git a/patches/server/0998-Fix-World-isChunkGenerated-calls.patch b/patches/server/0999-Fix-World-isChunkGenerated-calls.patch index d4670f3c2a..dd397e8f64 100644 --- a/patches/server/0998-Fix-World-isChunkGenerated-calls.patch +++ b/patches/server/0999-Fix-World-isChunkGenerated-calls.patch @@ -153,7 +153,7 @@ index f27cf743bbc379520263909541d653dd38d1be58..0db8ee3b640e6d1268e9c1cccda85459 // Paper start - don't write garbage data to disk if writing serialization fails dataoutputstream.close(); // Only write if successful diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 65b2902c65011223b344d64179d9dd3594abfa68..99405971f51001465b0414c50d2044a95a281ab8 100644 +index 84ec87b889d0d450293310e18c34aef505a8147b..d1cff7794313fd29717e9d7818ccf00e340f08a9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -376,9 +376,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -182,7 +182,7 @@ index 65b2902c65011223b344d64179d9dd3594abfa68..99405971f51001465b0414c50d2044a9 throw new RuntimeException(ex); } } -@@ -528,20 +542,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -530,20 +544,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot warnUnsafeChunk("loading a faraway chunk", x, z); // Paper diff --git a/patches/server/0999-Flat-bedrock-generator-settings.patch b/patches/server/1000-Flat-bedrock-generator-settings.patch index 7e54f34f22..7e54f34f22 100644 --- a/patches/server/0999-Flat-bedrock-generator-settings.patch +++ b/patches/server/1000-Flat-bedrock-generator-settings.patch diff --git a/patches/server/1000-Entity-Activation-Range-2.0.patch b/patches/server/1001-Entity-Activation-Range-2.0.patch index 64177acf80..64177acf80 100644 --- a/patches/server/1000-Entity-Activation-Range-2.0.patch +++ b/patches/server/1001-Entity-Activation-Range-2.0.patch diff --git a/patches/server/1001-Optional-per-player-mob-spawns.patch b/patches/server/1002-Optional-per-player-mob-spawns.patch index f6d37500e1..f6d37500e1 100644 --- a/patches/server/1001-Optional-per-player-mob-spawns.patch +++ b/patches/server/1002-Optional-per-player-mob-spawns.patch diff --git a/patches/server/1002-Anti-Xray.patch b/patches/server/1003-Anti-Xray.patch index 17297f90ac..1e5bcc17f4 100644 --- a/patches/server/1002-Anti-Xray.patch +++ b/patches/server/1003-Anti-Xray.patch @@ -1504,7 +1504,7 @@ index 9a2bf744abd8916d492e901be889223591bac3fd..1dd415c96d17eff8e7555c33d3c52e57 int getSerializedSize(); diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 5aff6454b5b1c7834adca8f1234ec4848aa3709c..4bef691ad22b6638847aebb471a3c28522c7a461 100644 +index 5d50f1bcba507975b8942529104c0ccd5e08c252..1ee35c828ea637e2954158060e1ad98f2649cedd 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -71,7 +71,7 @@ import org.slf4j.Logger; @@ -1571,7 +1571,7 @@ index d4e0ef75dd12709a0dcf9193821c30b8943e6c36..fd702027e62eb38d51fb7c46ef268e9b private static final byte[] EMPTY_LIGHT = new byte[2048]; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b63a0770e80f16848861a4747586ad22b9f9520b..cd8608fdfce31a9349d1e494be9f7fdf2c98fe85 100644 +index cbe6e8dae17b30905a28167449f1799b66d403c1..0915c7b9937c28f74b6fe3c9fc8de44492a49911 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2610,7 +2610,7 @@ public final class CraftServer implements Server { @@ -1584,10 +1584,10 @@ index b63a0770e80f16848861a4747586ad22b9f9520b..cd8608fdfce31a9349d1e494be9f7fdf // Paper start - Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 99405971f51001465b0414c50d2044a95a281ab8..b27e965005b64c817588b75d467913c27ab1e31b 100644 +index d1cff7794313fd29717e9d7818ccf00e340f08a9..a139601888b88e8580bdb9c2469386a94abae975 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -522,11 +522,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -524,11 +524,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { List<ServerPlayer> playersInRange = playerChunk.playerProvider.getPlayers(playerChunk.getPos(), false); if (playersInRange.isEmpty()) return true; // Paper - rewrite player chunk loader diff --git a/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch index c4b823d114..c4b823d114 100644 --- a/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch +++ b/patches/server/1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch diff --git a/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1005-Optimize-Collision-to-not-load-chunks.patch index 88daae9ea4..88daae9ea4 100644 --- a/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/1005-Optimize-Collision-to-not-load-chunks.patch diff --git a/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch index 8e879a28af..8e879a28af 100644 --- a/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch +++ b/patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/server/1006-Entity-load-save-limit-per-chunk.patch b/patches/server/1007-Entity-load-save-limit-per-chunk.patch index 65c011c1e1..65c011c1e1 100644 --- a/patches/server/1006-Entity-load-save-limit-per-chunk.patch +++ b/patches/server/1007-Entity-load-save-limit-per-chunk.patch diff --git a/patches/server/1007-Fix-and-optimise-world-force-upgrading.patch b/patches/server/1008-Fix-and-optimise-world-force-upgrading.patch index 69b768b90a..3b5a35bcf5 100644 --- a/patches/server/1007-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/1008-Fix-and-optimise-world-force-upgrading.patch @@ -267,10 +267,10 @@ index 72d013d06705b08ed696e3d3b6d631d65800c2c9..61840cfd64caba6595dfc99c91c76a19 Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e04153106d91d235e70cc478fd343a04faf821f4..d6879c1b5f63098c276fa109ac66586e3e4ae2a0 100644 +index ca352fc1a3d206f9a1fc52eba787e66040d5882c..49fbd8b84401070d314a32a3b1cdf65055452e5b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -583,11 +583,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -584,11 +584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa worlddata = new PrimaryLevelData(worldsettings, worldoptions, worlddimensions_b.specialWorldProperty(), lifecycle); } worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end) @@ -283,7 +283,7 @@ index e04153106d91d235e70cc478fd343a04faf821f4..d6879c1b5f63098c276fa109ac66586e PrimaryLevelData iworlddataserver = worlddata; boolean flag = worlddata.isDebugWorld(); -@@ -602,6 +598,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -603,6 +599,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } @@ -352,7 +352,7 @@ index 0db8ee3b640e6d1268e9c1cccda85459bd447105..42d37bee3a459adcd46408596ccf93ab return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cd8608fdfce31a9349d1e494be9f7fdf2c98fe85..afb4fa8fa124ed0154762962a3fe59164e968c7c 100644 +index 0915c7b9937c28f74b6fe3c9fc8de44492a49911..25f41119bcc19bab7cd2fdb044147b3f78a8ef1c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1345,9 +1345,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/1008-Improved-Watchdog-Support.patch b/patches/server/1009-Improved-Watchdog-Support.patch index 8dc7b17e31..a6edf7134b 100644 --- a/patches/server/1008-Improved-Watchdog-Support.patch +++ b/patches/server/1009-Improved-Watchdog-Support.patch @@ -71,7 +71,7 @@ index 6f2452de76e8f5fcc1367066e0e753740764eb98..e047dee632022abfe05865d1e71838be cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a18740f1c7b76 100644 +index 49fbd8b84401070d314a32a3b1cdf65055452e5b..1509af90e26468b2b9a7b547309721fe567c411c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -296,7 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -83,7 +83,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -308,6 +308,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -309,6 +309,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public static long currentTickLong = 0L; // Paper - track current tick as a long public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked @@ -93,7 +93,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system -@@ -927,6 +930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -928,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // CraftBukkit start private boolean hasStopped = false; private boolean hasLoggedStop = false; // Paper - Debugging @@ -101,7 +101,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 private final Object stopLock = new Object(); public final boolean hasStopped() { synchronized (this.stopLock) { -@@ -942,6 +946,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -943,6 +947,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.hasStopped = true; } if (!hasLoggedStop && isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging @@ -121,7 +121,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 // CraftBukkit end if (this.metricsRecorder.isRecording()) { this.cancelRecordingMetrics(); -@@ -996,7 +1013,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -997,7 +1014,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving } // Spigot end @@ -143,7 +143,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 } public String getLocalIp() { -@@ -1042,6 +1073,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1094,6 +1125,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa protected void runServer() { try { @@ -151,7 +151,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 if (!this.initServer()) { throw new IllegalStateException("Failed to initialize server"); } -@@ -1051,6 +1083,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1103,6 +1135,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.status = this.buildServerStatus(); // Spigot start @@ -169,8 +169,8 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 + org.spigotmc.WatchdogThread.tick(); // Paper org.spigotmc.WatchdogThread.hasStarted = true; // Paper Arrays.fill( this.recentTps, 20 ); - long tickSection = Util.getMillis(), tickCount = 1; -@@ -1121,6 +1165,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + // Paper start - further improve server tick loop +@@ -1184,6 +1228,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis); } } catch (Throwable throwable) { @@ -183,7 +183,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable); CrashReport crashreport = MinecraftServer.constructOrExtractCrashReport(throwable); -@@ -1145,15 +1195,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1208,15 +1258,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.services.profileCache().clearExecutor(); } @@ -203,7 +203,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 } } -@@ -1222,6 +1272,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1285,6 +1335,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public TickTask wrapRunnable(Runnable runnable) { @@ -216,7 +216,7 @@ index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a1874 return new TickTask(this.tickCount, runnable); } -@@ -2047,7 +2103,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2110,7 +2166,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.worldData.setDataConfiguration(worlddataconfiguration); this.resources.managers.updateRegistryTags(this.registryAccess()); net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper - Custom Potion Mixes diff --git a/patches/server/1009-Optimize-Voxel-Shape-Merging.patch b/patches/server/1010-Optimize-Voxel-Shape-Merging.patch index 2c47963e34..2c47963e34 100644 --- a/patches/server/1009-Optimize-Voxel-Shape-Merging.patch +++ b/patches/server/1010-Optimize-Voxel-Shape-Merging.patch diff --git a/patches/server/1010-Write-SavedData-IO-async.patch b/patches/server/1011-Write-SavedData-IO-async.patch index d7f6d3dea7..d7f6d3dea7 100644 --- a/patches/server/1010-Write-SavedData-IO-async.patch +++ b/patches/server/1011-Write-SavedData-IO-async.patch diff --git a/patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/patches/server/1012-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch index 7429b07205..7429b07205 100644 --- a/patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch +++ b/patches/server/1012-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch diff --git a/patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/1013-Use-distance-map-to-optimise-entity-tracker.patch index 891a4e5d21..891a4e5d21 100644 --- a/patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/1013-Use-distance-map-to-optimise-entity-tracker.patch diff --git a/patches/server/1013-Optimize-Bit-Operations-by-inlining.patch b/patches/server/1014-Optimize-Bit-Operations-by-inlining.patch index 269787b9ed..269787b9ed 100644 --- a/patches/server/1013-Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/1014-Optimize-Bit-Operations-by-inlining.patch diff --git a/patches/server/1014-Remove-streams-from-hot-code.patch b/patches/server/1015-Remove-streams-from-hot-code.patch index 75a38173c7..75a38173c7 100644 --- a/patches/server/1014-Remove-streams-from-hot-code.patch +++ b/patches/server/1015-Remove-streams-from-hot-code.patch diff --git a/patches/server/1015-Eigencraft-redstone-implementation.patch b/patches/server/1016-Eigencraft-redstone-implementation.patch index 0022f6b8df..0022f6b8df 100644 --- a/patches/server/1015-Eigencraft-redstone-implementation.patch +++ b/patches/server/1016-Eigencraft-redstone-implementation.patch diff --git a/patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/1017-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch index 30e9a24146..30e9a24146 100644 --- a/patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch +++ b/patches/server/1017-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/1018-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch index 14c24b80b2..14c24b80b2 100644 --- a/patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch +++ b/patches/server/1018-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch diff --git a/patches/server/1018-Improve-boat-collision-performance.patch b/patches/server/1019-Improve-boat-collision-performance.patch index 7e6566d525..7e6566d525 100644 --- a/patches/server/1018-Improve-boat-collision-performance.patch +++ b/patches/server/1019-Improve-boat-collision-performance.patch diff --git a/patches/server/1019-Optimise-general-POI-access.patch b/patches/server/1020-Optimise-general-POI-access.patch index 9be40e9753..9be40e9753 100644 --- a/patches/server/1019-Optimise-general-POI-access.patch +++ b/patches/server/1020-Optimise-general-POI-access.patch diff --git a/patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1021-Custom-table-implementation-for-blockstate-state-loo.patch index 52bdb3212c..52bdb3212c 100644 --- a/patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch +++ b/patches/server/1021-Custom-table-implementation-for-blockstate-state-loo.patch diff --git a/patches/server/1021-Execute-chunk-tasks-mid-tick.patch b/patches/server/1022-Execute-chunk-tasks-mid-tick.patch index 1a20c77ced..5360c9ad1f 100644 --- a/patches/server/1021-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/1022-Execute-chunk-tasks-mid-tick.patch @@ -19,10 +19,10 @@ index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..46449728f69ee7d4f78470f8da23c055 private MinecraftTimings() {} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index af558f9f5f094d6aea6ba5e85e9a18740f1c7b76..100cccf92efae2b87be7dff1f21cb5038c823c5a 100644 +index 1509af90e26468b2b9a7b547309721fe567c411c..30ca4f1cc72b3a9ffab2a07330a671e48ae9177d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1293,8 +1293,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1356,8 +1356,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa return flag; } diff --git a/patches/server/1022-Optimise-random-block-ticking.patch b/patches/server/1023-Optimise-random-block-ticking.patch index 4f3d16341d..4f3d16341d 100644 --- a/patches/server/1022-Optimise-random-block-ticking.patch +++ b/patches/server/1023-Optimise-random-block-ticking.patch diff --git a/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1024-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index a47c6db882..66b1297d83 100644 --- a/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/1024-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -10,7 +10,7 @@ hoping that at least then we don't swap chunks, and maybe recover them all. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 4bef691ad22b6638847aebb471a3c28522c7a461..ccbdb68e3bcf5f609e96ddd6e5ccfb27abb4d1f5 100644 +index 1ee35c828ea637e2954158060e1ad98f2649cedd..afc583d5726a572f606469bba3aaba4600827992 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -70,6 +70,18 @@ import net.minecraft.world.ticks.ProtoChunkTicks; diff --git a/patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1025-Use-Velocity-compression-and-cipher-natives.patch index 8f8f34ad27..8f8f34ad27 100644 --- a/patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/1025-Use-Velocity-compression-and-cipher-natives.patch diff --git a/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1026-Detail-more-information-in-watchdog-dumps.patch index 36f45a25f6..36f45a25f6 100644 --- a/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/1026-Detail-more-information-in-watchdog-dumps.patch diff --git a/patches/server/1026-Collision-optimisations.patch b/patches/server/1027-Collision-optimisations.patch index 71ab7a2ee0..71ab7a2ee0 100644 --- a/patches/server/1026-Collision-optimisations.patch +++ b/patches/server/1027-Collision-optimisations.patch diff --git a/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/1028-Optimise-collision-checking-in-player-move-packet-ha.patch index 1e773118a7..1e773118a7 100644 --- a/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/1028-Optimise-collision-checking-in-player-move-packet-ha.patch diff --git a/patches/server/1028-Fix-tripwire-state-inconsistency.patch b/patches/server/1029-Fix-tripwire-state-inconsistency.patch index bce767ae73..bce767ae73 100644 --- a/patches/server/1028-Fix-tripwire-state-inconsistency.patch +++ b/patches/server/1029-Fix-tripwire-state-inconsistency.patch diff --git a/patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1030-Fix-entity-type-tags-suggestions-in-selectors.patch index 83872a3693..83872a3693 100644 --- a/patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch +++ b/patches/server/1030-Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1031-Add-Alternate-Current-redstone-implementation.patch index 0c4cd1212b..0c4cd1212b 100644 --- a/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/1031-Add-Alternate-Current-redstone-implementation.patch diff --git a/patches/server/1031-optimize-dirt-and-snow-spreading.patch b/patches/server/1032-optimize-dirt-and-snow-spreading.patch index 223dbd9a3e..223dbd9a3e 100644 --- a/patches/server/1031-optimize-dirt-and-snow-spreading.patch +++ b/patches/server/1032-optimize-dirt-and-snow-spreading.patch diff --git a/patches/server/1032-Properly-resend-entities.patch b/patches/server/1033-Properly-resend-entities.patch index 82e40b8e93..82e40b8e93 100644 --- a/patches/server/1032-Properly-resend-entities.patch +++ b/patches/server/1033-Properly-resend-entities.patch diff --git a/patches/server/1033-Optimize-Hoppers.patch b/patches/server/1034-Optimize-Hoppers.patch index 557e2b9fc7..345e561dd2 100644 --- a/patches/server/1033-Optimize-Hoppers.patch +++ b/patches/server/1034-Optimize-Hoppers.patch @@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 100cccf92efae2b87be7dff1f21cb5038c823c5a..9183e47d51d95e71ab503564a7a59e03c0a54c2f 100644 +index 30ca4f1cc72b3a9ffab2a07330a671e48ae9177d..7da73248b56992f765a7c27a42502efb04622956 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1627,6 +1627,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1690,6 +1690,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent diff --git a/patches/server/1034-Improve-performance-of-mass-crafts.patch b/patches/server/1035-Improve-performance-of-mass-crafts.patch index 21ed7a6c78..21ed7a6c78 100644 --- a/patches/server/1034-Improve-performance-of-mass-crafts.patch +++ b/patches/server/1035-Improve-performance-of-mass-crafts.patch diff --git a/patches/server/1035-Actually-optimise-explosions.patch b/patches/server/1036-Actually-optimise-explosions.patch index da42c9e195..da42c9e195 100644 --- a/patches/server/1035-Actually-optimise-explosions.patch +++ b/patches/server/1036-Actually-optimise-explosions.patch diff --git a/patches/server/1036-Optimise-chunk-tick-iteration.patch b/patches/server/1037-Optimise-chunk-tick-iteration.patch index 9aeb33c382..9aeb33c382 100644 --- a/patches/server/1036-Optimise-chunk-tick-iteration.patch +++ b/patches/server/1037-Optimise-chunk-tick-iteration.patch diff --git a/patches/server/1037-Lag-compensation-ticks.patch b/patches/server/1038-Lag-compensation-ticks.patch index 86c4c02378..c779081bd4 100644 --- a/patches/server/1037-Lag-compensation-ticks.patch +++ b/patches/server/1038-Lag-compensation-ticks.patch @@ -8,10 +8,10 @@ Areas affected by lag comepnsation: - Eating food items diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9183e47d51d95e71ab503564a7a59e03c0a54c2f..baa33011136c1436733a413fdca16763b09d604b 100644 +index 7da73248b56992f765a7c27a42502efb04622956..cfe78fe6db2bb1f039619bf2497a8b8981917756 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public volatile Thread shutdownThread; // Paper public volatile boolean abnormalExit = false; // Paper @@ -19,7 +19,7 @@ index 9183e47d51d95e71ab503564a7a59e03c0a54c2f..baa33011136c1436733a413fdca16763 public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); -@@ -1626,6 +1627,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1689,6 +1690,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); diff --git a/patches/server/1038-Optimise-nearby-player-retrieval.patch b/patches/server/1039-Optimise-nearby-player-retrieval.patch index c6ab594786..c6ab594786 100644 --- a/patches/server/1038-Optimise-nearby-player-retrieval.patch +++ b/patches/server/1039-Optimise-nearby-player-retrieval.patch diff --git a/patches/server/1039-Distance-manager-tick-timings.patch b/patches/server/1040-Distance-manager-tick-timings.patch index f946d92596..f946d92596 100644 --- a/patches/server/1039-Distance-manager-tick-timings.patch +++ b/patches/server/1040-Distance-manager-tick-timings.patch diff --git a/patches/server/1040-Handle-Oversized-block-entities-in-chunks.patch b/patches/server/1041-Handle-Oversized-block-entities-in-chunks.patch index 1bdb933b52..1bdb933b52 100644 --- a/patches/server/1040-Handle-Oversized-block-entities-in-chunks.patch +++ b/patches/server/1041-Handle-Oversized-block-entities-in-chunks.patch diff --git a/scripts/moveback.py b/scripts/moveback.py index 6c7fca436c..509e29fab5 100644 --- a/scripts/moveback.py +++ b/scripts/moveback.py @@ -2,8 +2,8 @@ import os import sys # Use inside of server patch dir -# py ../../scripts/moveback.py 'Rewrite chunk system' -patch_target = 992 # TODO: Update this +# py ../../scripts/moveback.py '' +patch_target = 990 # TODO: Update this def increment_number(filename): |