From d7fc0c5ab221ea38b4ae14b862c06cfac2fc0277 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 5 Dec 2023 20:39:26 +0100 Subject: [PATCH] More more work --- .../server/0016-Starlight.patch | 10 +- .../server/0017-Add-TickThread.patch | 0 .../server/0018-Rewrite-chunk-system.patch | 196 +++++++++--------- ...-option-to-load-extra-plugin-jars-no.patch | 6 +- ...actus-bamboo-and-reed-growth-heights.patch | 22 +- ...figurable-baby-zombie-movement-speed.patch | 0 ...022-Configurable-fishing-time-ranges.patch | 0 .../0023-Allow-nerfed-mobs-to-jump.patch | 6 +- ...-despawn-distances-for-living-entiti.patch | 4 +- ...5-Allow-for-toggling-of-spawn-chunks.patch | 4 +- ...ck-and-tnt-entities-at-the-specified.patch | 8 +- ...ient-crashes-server-lists-and-Mojang.patch | 12 +- .../0028-Implement-Paper-VersionChecker.patch | 4 +- ...d-version-history-to-version-command.patch | 2 +- .../0030-Player-affects-spawning-API.patch | 20 +- ...031-Further-improve-server-tick-loop.patch | 46 ++-- ...032-Only-refresh-abilities-if-needed.patch | 4 +- .../server/0033-Entity-Origin-API.patch | 36 ++-- ...event-tile-entity-and-entity-crashes.patch | 4 +- ...nfigurable-top-of-nether-void-damage.patch | 4 +- ...e-before-converting-and-renaming-pla.patch | 4 +- .../0037-Always-tick-falling-blocks.patch | 0 .../0038-Configurable-end-credits.patch | 4 +- ...-explosions-processing-dead-entities.patch | 4 +- .../server/0040-Optimize-explosions.patch | 28 +-- .../0041-Disable-explosion-knockback.patch | 12 +- .../server/0042-Disable-thunder.patch | 4 +- .../server/0043-Disable-ice-and-snow.patch | 6 +- ...4-Configurable-mob-spawner-tick-rate.patch | 6 +- ...45-Implement-PlayerLocaleChangeEvent.patch | 12 +- .../server/0046-Add-BeaconEffectEvent.patch | 0 ...figurable-container-update-tick-rate.patch | 6 +- .../0048-Use-UserCache-for-player-heads.patch | 0 .../0049-Disable-spigot-tick-limiters.patch | 8 +- .../0050-Add-PlayerInitialSpawnEvent.patch | 6 +- 35 files changed, 242 insertions(+), 246 deletions(-) rename patches/{unapplied => }/server/0016-Starlight.patch (99%) rename patches/{unapplied => }/server/0017-Add-TickThread.patch (100%) rename patches/{unapplied => }/server/0018-Rewrite-chunk-system.patch (99%) rename patches/{unapplied => }/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch (92%) rename patches/{unapplied => }/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch (87%) rename patches/{unapplied => }/server/0021-Configurable-baby-zombie-movement-speed.patch (100%) rename patches/{unapplied => }/server/0022-Configurable-fishing-time-ranges.patch (100%) rename patches/{unapplied => }/server/0023-Allow-nerfed-mobs-to-jump.patch (90%) rename patches/{unapplied => }/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch (89%) rename patches/{unapplied => }/server/0025-Allow-for-toggling-of-spawn-chunks.patch (85%) rename patches/{unapplied => }/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch (89%) rename patches/{unapplied => }/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch (93%) rename patches/{unapplied => }/server/0028-Implement-Paper-VersionChecker.patch (97%) rename patches/{unapplied => }/server/0029-Add-version-history-to-version-command.patch (98%) rename patches/{unapplied => }/server/0030-Player-affects-spawning-API.patch (92%) rename patches/{unapplied => }/server/0031-Further-improve-server-tick-loop.patch (88%) rename patches/{unapplied => }/server/0032-Only-refresh-abilities-if-needed.patch (87%) rename patches/{unapplied => }/server/0033-Entity-Origin-API.patch (81%) rename patches/{unapplied => }/server/0034-Prevent-tile-entity-and-entity-crashes.patch (96%) rename patches/{unapplied => }/server/0035-Configurable-top-of-nether-void-damage.patch (94%) rename patches/{unapplied => }/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch (88%) rename patches/{unapplied => }/server/0037-Always-tick-falling-blocks.patch (100%) rename patches/{unapplied => }/server/0038-Configurable-end-credits.patch (86%) rename patches/{unapplied => }/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch (89%) rename patches/{unapplied => }/server/0040-Optimize-explosions.patch (85%) rename patches/{unapplied => }/server/0041-Disable-explosion-knockback.patch (75%) rename patches/{unapplied => }/server/0042-Disable-thunder.patch (87%) rename patches/{unapplied => }/server/0043-Disable-ice-and-snow.patch (78%) rename patches/{unapplied => }/server/0044-Configurable-mob-spawner-tick-rate.patch (87%) rename patches/{unapplied => }/server/0045-Implement-PlayerLocaleChangeEvent.patch (86%) rename patches/{unapplied => }/server/0046-Add-BeaconEffectEvent.patch (100%) rename patches/{unapplied => }/server/0047-Configurable-container-update-tick-rate.patch (84%) rename patches/{unapplied => }/server/0048-Use-UserCache-for-player-heads.patch (100%) rename patches/{unapplied => }/server/0049-Disable-spigot-tick-limiters.patch (81%) rename patches/{unapplied => }/server/0050-Add-PlayerInitialSpawnEvent.patch (89%) diff --git a/patches/unapplied/server/0016-Starlight.patch b/patches/server/0016-Starlight.patch similarity index 99% rename from patches/unapplied/server/0016-Starlight.patch rename to patches/server/0016-Starlight.patch index 2da6ef5db8..cf99fc1857 100644 --- a/patches/unapplied/server/0016-Starlight.patch +++ b/patches/server/0016-Starlight.patch @@ -4851,7 +4851,7 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..6051e5f272838ef23276a90e21c2fc82 public static TicketType create(String name, Comparator 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 e96a0ca47e4701ba187555bd92c968345bc85677..33091331ec742767611fad1ab2a324fa334650c5 100644 +index d11741d2618976bdb51f75d823f260f32d5bafc9..23dfc741b31cdc25265fb5daffcae63417102a41 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,10 +4883,10 @@ index e96a0ca47e4701ba187555bd92c968345bc85677..33091331ec742767611fad1ab2a324fa 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 2b8e88a75e9a974e1ecafe0360a9d69b79326d11..6c171199dcc30f56a6d0ab7ecf398b505d145067 100644 +index 07e41b936f5f229876cf9ff5cd8d6278088eee48..bf42cead5fa040d87da28d7be521b109724da19b 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 -@@ -807,6 +807,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -874,6 +874,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.spawnTerrainParticles = blockbase_info.spawnTerrainParticles; this.instrument = blockbase_info.instrument; this.replaceable = blockbase_info.replaceable; @@ -4894,7 +4894,7 @@ index 2b8e88a75e9a974e1ecafe0360a9d69b79326d11..6c171199dcc30f56a6d0ab7ecf398b50 } private boolean calculateSolid() { -@@ -835,6 +836,18 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -902,6 +903,18 @@ public abstract class BlockBehaviour implements FeatureElement { return this.shapeExceedsCube; } // Paper end @@ -4913,7 +4913,7 @@ index 2b8e88a75e9a974e1ecafe0360a9d69b79326d11..6c171199dcc30f56a6d0ab7ecf398b50 public void initCache() { this.fluidState = ((Block) this.owner).getFluidState(this.asState()); -@@ -843,6 +856,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -910,6 +923,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 diff --git a/patches/unapplied/server/0017-Add-TickThread.patch b/patches/server/0017-Add-TickThread.patch similarity index 100% rename from patches/unapplied/server/0017-Add-TickThread.patch rename to patches/server/0017-Add-TickThread.patch diff --git a/patches/unapplied/server/0018-Rewrite-chunk-system.patch b/patches/server/0018-Rewrite-chunk-system.patch similarity index 99% rename from patches/unapplied/server/0018-Rewrite-chunk-system.patch rename to patches/server/0018-Rewrite-chunk-system.patch index 6a27f84772..b6673497db 100644 --- a/patches/unapplied/server/0018-Rewrite-chunk-system.patch +++ b/patches/server/0018-Rewrite-chunk-system.patch @@ -16640,10 +16640,10 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292 @Override diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index ae0b713870976d4b1e469a90cef9b2e282dbcaab..646cd39c46d86899f23c8179c0790e32d03f954f 100644 +index 884731fa4ebbbdc7c06ff670941f36ef3bf384ad..360ecf561cde34b07929519a67485e0315e4676c 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -279,6 +279,7 @@ public class Main { +@@ -305,6 +305,7 @@ public class Main { convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata); */ @@ -16652,10 +16652,10 @@ index ae0b713870976d4b1e469a90cef9b2e282dbcaab..646cd39c46d86899f23c8179c0790e32 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 7abd42e34ce14618f4987933cdd230879b6ac804..27ab6d2749b89cc5d3fd4e22603daee95634be71 100644 +index 337a1e89ba63471ea6b413cdec3e68d343a0b46b..2021526bf6b8bdc286c31aaa62ab0235fac073cd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); @@ -16664,7 +16664,7 @@ index 7abd42e34ce14618f4987933cdd230879b6ac804..27ab6d2749b89cc5d3fd4e22603daee9 ((MinecraftServer) atomicreference.get()).runServer(); }, "Server thread"); -@@ -571,7 +571,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - return worldserver1.getChunkSource().chunkMap.hasWork(); - })) { -- this.nextTickTime = Util.getMillis() + 1L; +- this.nextTickTimeNanos = Util.getNanos() + TimeUtil.NANOSECONDS_PER_MILLISECOND; - iterator = this.getAllLevels().iterator(); - - while (iterator.hasNext()) { @@ -16748,7 +16748,7 @@ index 7abd42e34ce14618f4987933cdd230879b6ac804..27ab6d2749b89cc5d3fd4e22603daee9 this.isSaving = false; this.resources.close(); -@@ -920,7 +901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit -@@ -1080,6 +1069,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop void addTicketAtLevel(TicketType ticketType, ChunkPos chunkPos, int ticketLevel, T identifier) { this.distanceManager.addTicket(ticketType, chunkPos, ticketLevel, identifier); } -@@ -367,7 +238,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -365,7 +236,7 @@ public class ServerChunkCache extends ChunkSource { public LevelChunk getChunkAtIfLoadedImmediately(int x, int z) { long k = ChunkPos.asLong(x, z); @@ -19258,7 +19258,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 return this.getChunkAtIfLoadedMainThread(x, z); } -@@ -393,7 +264,8 @@ public class ServerChunkCache extends ChunkSource { +@@ -391,7 +262,8 @@ public class ServerChunkCache extends ChunkSource { @Nullable @Override public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) { @@ -19268,7 +19268,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 return (ChunkAccess) CompletableFuture.supplyAsync(() -> { return this.getChunk(x, z, leastStatus, create); }, this.mainThreadProcessor).join(); -@@ -405,23 +277,20 @@ public class ServerChunkCache extends ChunkSource { +@@ -403,23 +275,20 @@ public class ServerChunkCache extends ChunkSource { ChunkAccess ichunkaccess; @@ -19298,7 +19298,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 this.level.timings.syncChunkLoad.stopTiming(); // Paper } // Paper ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { -@@ -441,7 +310,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -439,7 +308,7 @@ public class ServerChunkCache extends ChunkSource { @Nullable @Override public LevelChunk getChunkNow(int chunkX, int chunkZ) { @@ -19307,7 +19307,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 return null; } else { this.level.getProfiler().incrementCounter("getChunkNow"); -@@ -487,7 +356,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -485,7 +354,7 @@ public class ServerChunkCache extends ChunkSource { } public CompletableFuture> getChunkFuture(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { @@ -19316,7 +19316,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 CompletableFuture completablefuture; if (flag1) { -@@ -508,47 +377,52 @@ public class ServerChunkCache extends ChunkSource { +@@ -506,47 +375,52 @@ public class ServerChunkCache extends ChunkSource { } private CompletableFuture> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { @@ -19401,7 +19401,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 } @Nullable -@@ -560,22 +434,13 @@ public class ServerChunkCache extends ChunkSource { +@@ -558,22 +432,13 @@ public class ServerChunkCache extends ChunkSource { if (playerchunk == null) { return null; } else { @@ -19430,7 +19430,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 } } -@@ -589,15 +454,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -587,15 +452,7 @@ public class ServerChunkCache extends ChunkSource { } boolean runDistanceManagerUpdates() { @@ -19447,7 +19447,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 } // Paper start -@@ -607,17 +464,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -605,17 +462,10 @@ public class ServerChunkCache extends ChunkSource { // Paper end public boolean isPositionTicking(long pos) { @@ -19469,7 +19469,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 } public void save(boolean flush) { -@@ -633,17 +483,13 @@ public class ServerChunkCache extends ChunkSource { +@@ -631,17 +481,13 @@ public class ServerChunkCache extends ChunkSource { this.close(true); } @@ -19490,15 +19490,15 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 this.level.getProfiler().push("purge"); this.distanceManager.purgeStaleTickets(); this.runDistanceManagerUpdates(); -@@ -664,6 +510,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -662,6 +508,7 @@ public class ServerChunkCache extends ChunkSource { this.level.getProfiler().popPush("chunks"); if (tickChunks) { this.level.timings.chunks.startTiming(); // Paper - timings + this.chunkMap.level.playerChunkLoader.tick(); // Paper - replace player chunk loader - this is mostly required to account for view distance changes this.tickChunks(); this.level.timings.chunks.stopTiming(); // Paper - timings - } -@@ -760,7 +607,12 @@ public class ServerChunkCache extends ChunkSource { + this.chunkMap.tick(); +@@ -756,7 +603,12 @@ public class ServerChunkCache extends ChunkSource { ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos); if (playerchunk != null) { @@ -19512,7 +19512,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 } } -@@ -926,17 +778,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -922,17 +774,10 @@ public class ServerChunkCache extends ChunkSource { @Override // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task public boolean pollTask() { @@ -19532,10 +19532,10 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f4ec438ff 100644 +index b698cdc4ef9e2bf824b9e5a4f985b6832c15f8f6..51f0705499003ea71274e1d5c8a77306fa868485 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -194,7 +194,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -196,7 +196,7 @@ public class ServerLevel extends Level implements WorldGenLevel { private final MinecraftServer server; public final PrimaryLevelData serverLevelData; // CraftBukkit - type final EntityTickList entityTickList; @@ -19544,7 +19544,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f private final GameEventDispatcher gameEventDispatcher; public boolean noSave; private final SleepStatus sleepStatus; -@@ -260,50 +260,65 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -262,50 +262,65 @@ public class ServerLevel extends Level implements WorldGenLevel { return true; } @@ -19637,7 +19637,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f chunkProvider.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos); chunkProvider.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, holderIdentifier); -@@ -315,12 +330,223 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -317,12 +332,223 @@ public class ServerLevel extends Level implements WorldGenLevel { for (int cx = minChunkX; cx <= maxChunkX; ++cx) { for (int cz = minChunkZ; cz <= maxChunkZ; ++cz) { io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad( @@ -19863,7 +19863,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f // Add env and gen to constructor, IWorldDataServer -> WorldDataServer public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { -@@ -364,16 +590,16 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -366,16 +592,16 @@ public class ServerLevel extends Level implements WorldGenLevel { // CraftBukkit end boolean flag2 = minecraftserver.forceSynchronousWrites(); DataFixer datafixer = minecraftserver.getFixerUpper(); @@ -19885,7 +19885,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f return minecraftserver.overworld().getDataStorage(); }); this.chunkSource.getGeneratorState().ensureStructuresGenerated(); -@@ -402,6 +628,9 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -404,6 +630,9 @@ public class ServerLevel extends Level implements WorldGenLevel { return (RandomSequences) this.getDataStorage().computeIfAbsent(RandomSequences.factory(l), "random_sequences"); }); this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit @@ -19895,7 +19895,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } /** @deprecated */ -@@ -512,7 +741,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -529,7 +758,7 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.push("checkDespawn"); entity.checkDespawn(); gameprofilerfiller.pop(); @@ -19904,7 +19904,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f Entity entity1 = entity.getVehicle(); if (entity1 != null) { -@@ -537,13 +766,16 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -554,13 +783,16 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.push("entityManagement"); @@ -19923,7 +19923,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } protected void tickTime() { -@@ -1010,6 +1242,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1029,6 +1261,11 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) { @@ -19935,7 +19935,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f ServerChunkCache chunkproviderserver = this.getChunkSource(); if (!savingDisabled) { -@@ -1025,16 +1262,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1044,16 +1281,13 @@ public class ServerLevel extends Level implements WorldGenLevel { } timings.worldSaveChunks.startTiming(); // Paper @@ -19956,7 +19956,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f // CraftBukkit start - moved from MinecraftServer.saveChunks ServerLevel worldserver1 = this; -@@ -1170,7 +1404,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1189,7 +1423,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED); } @@ -19965,7 +19965,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } // CraftBukkit start -@@ -1186,7 +1420,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1205,7 +1439,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } // CraftBukkit end @@ -19974,7 +19974,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } } -@@ -1198,10 +1432,10 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1217,10 +1451,10 @@ public class ServerLevel extends Level implements WorldGenLevel { public boolean tryAddFreshEntityWithPassengers(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { // CraftBukkit end Stream stream = entity.getSelfAndPassengers().map(Entity::getUUID); // CraftBukkit - decompile error @@ -19988,7 +19988,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f return false; } else { this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit -@@ -1712,7 +1946,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1736,7 +1970,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -19997,7 +19997,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f bufferedwriter.write(String.format(Locale.ROOT, "block_entity_tickers: %d\n", this.blockEntityTickers.size())); bufferedwriter.write(String.format(Locale.ROOT, "block_ticks: %d\n", this.getBlockTicks().count())); bufferedwriter.write(String.format(Locale.ROOT, "fluid_ticks: %d\n", this.getFluidTicks().count())); -@@ -1761,7 +1995,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1785,7 +2019,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1); try { @@ -20006,7 +20006,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } catch (Throwable throwable4) { if (bufferedwriter2 != null) { try { -@@ -1782,7 +2016,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1806,7 +2040,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2); try { @@ -20015,7 +20015,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } catch (Throwable throwable6) { if (bufferedwriter3 != null) { try { -@@ -1924,7 +2158,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1948,7 +2182,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public String getWatchdogStats() { @@ -20024,7 +20024,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); }), this.blockEntityTickers.size(), ServerLevel.getTypeCount(this.blockEntityTickers, TickingBlockEntity::getType), this.getBlockTicks().count(), this.getFluidTicks().count(), this.gatherChunkSourceStats()); } -@@ -1984,15 +2218,15 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2008,15 +2242,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public LevelEntityGetter getEntities() { org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot @@ -20045,7 +20045,7 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f } public void startTickingChunk(LevelChunk chunk) { -@@ -2008,34 +2242,49 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2032,34 +2266,49 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void close() throws IOException { super.close(); @@ -20103,10 +20103,10 @@ index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f @Override diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 936e3e0563a2443e13eae1e8875080187420cf4e..d7c4ce86956c0461603e8d569e9bebe39f07c8a1 100644 +index b403b7d585f474e2b6029404d19e756a40206f7f..b6939932a4b8800c8751125a4a6d4dcea39110c1 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -257,6 +257,50 @@ public class ServerPlayer extends Player { +@@ -265,6 +265,50 @@ public class ServerPlayer extends Player { public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper @@ -20402,7 +20402,7 @@ index 6051e5f272838ef23276a90e21c2fc821ca155d1..658e63ebde81dc14c8ab5850fb246dc0 public static TicketType create(String name, Comparator 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 33091331ec742767611fad1ab2a324fa334650c5..a38e279c9b36e539c45f410da827056a80acc43c 100644 +index 23dfc741b31cdc25265fb5daffcae63417102a41..3f5ba2b2f01d8cc07c4200a60b1b08cb584b170e 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -525,4 +525,21 @@ public class WorldGenRegion implements WorldGenLevel { @@ -20474,10 +20474,10 @@ index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf this.desiredChunksPerTick = Double.isNaN((double)desiredBatchSize) ? 0.01F : Mth.clamp(desiredBatchSize, 0.01F, 64.0F); if (this.unacknowledgedBatches == 0) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0649344ca2290446ff27cf9fa0d6f84ad0fe91c2..70fe4e973f41c2e5b12c0d96be418dd40e69c0f2 100644 +index d6b9fee57d22da0eaf3dcc4abfd3995d69abef95..b41351783ea9795afaddce453c82ab32cb8134a1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -696,6 +696,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -699,6 +699,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.disconnect(Component.translatable("disconnect.spam")); return; } @@ -20492,10 +20492,10 @@ index 0649344ca2290446ff27cf9fa0d6f84ad0fe91c2..70fe4e973f41c2e5b12c0d96be418dd4 StringReader stringreader = new StringReader(packet.getCommand()); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8f7bc04fc32e3b9c0625d795b09ea7f2e950fc05..afaa046ff1adf717ef8356cc276a55d63abc0aba 100644 +index f5a4191977e8675952fc689744c8a39e86f62a07..fdf3bf3decb14378f5e59e41bab26e965bc7be14 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -251,7 +251,7 @@ public abstract class PlayerList { +@@ -250,7 +250,7 @@ public abstract class PlayerList { boolean flag2 = gamerules.getBoolean(GameRules.RULE_LIMITED_CRAFTING); // Spigot - view distance @@ -20504,7 +20504,7 @@ index 8f7bc04fc32e3b9c0625d795b09ea7f2e950fc05..afaa046ff1adf717ef8356cc276a55d6 player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); playerconnection.send(new ClientboundPlayerAbilitiesPacket(player.getAbilities())); -@@ -799,8 +799,8 @@ public abstract class PlayerList { +@@ -798,8 +798,8 @@ public abstract class PlayerList { LevelData worlddata = worldserver2.getLevelData(); entityplayer1.connection.send(new ClientboundRespawnPacket(entityplayer1.createCommonSpawnInfo(worldserver2), (byte) i)); @@ -20515,7 +20515,7 @@ index 8f7bc04fc32e3b9c0625d795b09ea7f2e950fc05..afaa046ff1adf717ef8356cc276a55d6 entityplayer1.connection.teleport(CraftLocation.toBukkit(entityplayer1.position(), worldserver2.getWorld(), entityplayer1.getYRot(), entityplayer1.getXRot())); // CraftBukkit entityplayer1.connection.send(new ClientboundSetDefaultSpawnPositionPacket(worldserver1.getSharedSpawnPos(), worldserver1.getSharedSpawnAngle())); entityplayer1.connection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -@@ -1291,7 +1291,7 @@ public abstract class PlayerList { +@@ -1292,7 +1292,7 @@ public abstract class PlayerList { public void setViewDistance(int viewDistance) { this.viewDistance = viewDistance; @@ -20524,7 +20524,7 @@ index 8f7bc04fc32e3b9c0625d795b09ea7f2e950fc05..afaa046ff1adf717ef8356cc276a55d6 Iterator iterator = this.server.getAllLevels().iterator(); while (iterator.hasNext()) { -@@ -1306,7 +1306,7 @@ public abstract class PlayerList { +@@ -1307,7 +1307,7 @@ public abstract class PlayerList { public void setSimulationDistance(int simulationDistance) { this.simulationDistance = simulationDistance; @@ -20627,7 +20627,7 @@ index ca788f0dcec4a117b410fe8348969e056b138b1e..a6ac76707da39cf86113003b1f326433 public boolean remove(Object object) { int i = this.findIndex((T)object); diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java -index 495b52bfab14478f8285cc5471335a41244c199e..e16ef1b7c0bfe6d6194c09f6787a50fd9b28f55e 100644 +index 640db9f71608310a64e09f1e3e677c01e6ccd98a..f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9 100644 --- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java +++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java @@ -186,7 +186,11 @@ public class WorldUpgrader { @@ -20643,10 +20643,10 @@ index 495b52bfab14478f8285cc5471335a41244c199e..e16ef1b7c0bfe6d6194c09f6787a50fd if (flag1) { ++this.converted; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c8d43b42c 100644 +index a1a744657f8802852c161258382c5891858ebfa6..fa3d294b36eb0c23b293466fc72bd2970a452b55 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -327,6 +327,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -332,6 +332,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end @@ -20705,7 +20705,7 @@ index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c public Entity(EntityType type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.passengers = ImmutableList.of(); -@@ -2264,11 +2316,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2293,11 +2345,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return InteractionResult.PASS; } @@ -20719,8 +20719,8 @@ index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c return false; } -@@ -3588,6 +3640,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - }; +@@ -3632,6 +3684,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + }).count(); } + // Paper start - rewrite chunk system @@ -20734,9 +20734,9 @@ index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c + // Paper end - rewrite chunk system + public boolean hasExactlyOnePlayerPassenger() { - return this.getIndirectPassengersStream().filter((entity) -> { - return entity instanceof Player; -@@ -3919,6 +3981,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + return this.countPlayerPassengers() == 1; + } +@@ -3961,6 +4023,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public final void setPosRaw(double x, double y, double z) { @@ -20749,7 +20749,7 @@ index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c if (this.position.x != x || this.position.y != y || this.position.z != z) { this.position = new Vec3(x, y, z); int i = Mth.floor(x); -@@ -4026,6 +4094,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4068,6 +4136,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @Override public final void setRemoved(Entity.RemovalReason reason) { @@ -20763,7 +20763,7 @@ index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c if (this.removalReason == null) { this.removalReason = reason; } -@@ -4034,7 +4109,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4076,7 +4151,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.stopRiding(); } @@ -20772,7 +20772,7 @@ index 46853c3daa7f3f552632444fbf41624cfd1c8dc4..9eda990939b36c08a6f4820353942d6c this.levelCallback.onRemove(reason); } -@@ -4049,7 +4124,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4091,7 +4166,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @Override public boolean shouldBeSaved() { @@ -21056,10 +21056,10 @@ index b6a3c75b84d9f768afee33aa0f226207b307c1c0..2ec2b1d9d987c7f31c685aec3d3c87f4 List getEntities(EntityTypeTest filter, AABB box, Predicate predicate); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 43b631634ff225fa007af552f51f00150892185b..ec31a60fae419fb610f216bd42558e6aa57c2e19 100644 +index 26fe1603b3899f5b69980dc64d46d26d9c944fde..2922b90241e81245dbd56c53ab2eb661314c04fd 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -453,6 +453,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -456,6 +456,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(FullChunkStatus.BLOCK_TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i); @@ -21071,7 +21071,7 @@ index 43b631634ff225fa007af552f51f00150892185b..ec31a60fae419fb610f216bd42558e6a } if ((i & 1) != 0) { -@@ -805,7 +810,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -823,7 +828,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return this.capturedTileEntities.get(blockposition); } // CraftBukkit end @@ -21080,7 +21080,7 @@ index 43b631634ff225fa007af552f51f00150892185b..ec31a60fae419fb610f216bd42558e6a } public void setBlockEntity(BlockEntity blockEntity) { -@@ -896,26 +901,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -914,26 +919,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { this.getProfiler().incrementCounter("getEntities"); List list = Lists.newArrayList(); @@ -21108,7 +21108,7 @@ index 43b631634ff225fa007af552f51f00150892185b..ec31a60fae419fb610f216bd42558e6a return list; } -@@ -933,34 +919,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -951,34 +937,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { this.getProfiler().incrementCounter("getEntities"); @@ -21159,7 +21159,7 @@ index 43b631634ff225fa007af552f51f00150892185b..ec31a60fae419fb610f216bd42558e6a } @Nullable -@@ -1230,4 +1205,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1250,4 +1225,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { private ExplosionInteraction() {} } @@ -22652,10 +22652,10 @@ index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..7687a81bfa420e8377308fea3d673814 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d..2df4e56450535d2d3f6e83c06261fac7ee7a12dd 100644 +index 0f3659d2d60426275869dec76412aecb8e407442..e411d9e821604f07e744f2457654f6ac4bb34db7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1162,7 +1162,7 @@ public final class CraftServer implements Server { +@@ -1194,7 +1194,7 @@ public final class CraftServer implements Server { this.console.addLevel(internal); this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); @@ -22664,7 +22664,7 @@ index e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d..2df4e56450535d2d3f6e83c06261fac7 this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld())); return internal.getWorld(); -@@ -1206,7 +1206,7 @@ public final class CraftServer implements Server { +@@ -1238,7 +1238,7 @@ public final class CraftServer implements Server { } handle.getChunkSource().close(save); @@ -22673,7 +22673,7 @@ index e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d..2df4e56450535d2d3f6e83c06261fac7 handle.convertable.close(); } catch (Exception ex) { this.getLogger().log(Level.SEVERE, null, ex); -@@ -2098,7 +2098,7 @@ public final class CraftServer implements Server { +@@ -2130,7 +2130,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -22683,10 +22683,10 @@ index e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d..2df4e56450535d2d3f6e83c06261fac7 // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadfe6347ad1 100644 +index bb60804a77ecda3c86ccf54e028e634f8d7f141d..1f160036b433c5d1fb8ed1f94adefccab7a85bc7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -325,10 +325,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -326,10 +326,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; @@ -22704,7 +22704,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null); for (ServerPlayer player : playersInRange) { -@@ -336,8 +340,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -337,8 +341,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { player.connection.send(refreshPacket); } @@ -22714,7 +22714,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf return true; } -@@ -414,20 +417,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -415,20 +418,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Collection getPluginChunkTickets(int x, int z) { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22736,7 +22736,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf } @Override -@@ -435,7 +425,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -436,7 +426,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { Map> ret = new HashMap<>(); DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22745,7 +22745,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf long chunkKey = chunkTickets.getLongKey(); SortedArraySet> tickets = chunkTickets.getValue(); -@@ -2018,14 +2008,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2024,14 +2014,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot start @Override public int getViewDistance() { @@ -22802,10 +22802,10 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf // Spigot start private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9cec05442734dd9e08e749dc73358c045c6d3d24..5e495f89139689ca37982c7b0b79eaf50d444435 100644 +index c74428dccd9db8c4d2809bbd23f3268a16d7e282..24c282c0727fa814c403716837b2d44b216c5b16 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -197,6 +197,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -198,6 +198,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = System.currentTimeMillis(); } @@ -22868,7 +22868,7 @@ index 20592dc147f4f0b84928dabcfa349622f1de691c..d46ccc3b3aaacf937631a44a7e0f91b7 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java -index 7c110a758a84c5e22f36b788dec84998e607af6c..cbedb6f002bc01daa16d349421c4ef04d4bcbcb2 100644 +index e37c2d82ed606cbfe00c152b08c3ab99ac751f69..a650411e3fa7e2a045ac55502c77028be348acf1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java @@ -824,19 +824,39 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel { @@ -22915,7 +22915,7 @@ index 7c110a758a84c5e22f36b788dec84998e607af6c..cbedb6f002bc01daa16d349421c4ef04 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -index 629178347039893fb9de710810fe8112499bb91c..d5861dfa771c4eb217e082e3c832c3a6c603710d 100644 +index 440660dfa70d57e94ae4eef1dce783aee5034f7e..187eda2dd40785eb09528c86718d6b4fd3ab252c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java @@ -258,4 +258,20 @@ public class DummyGeneratorAccess implements WorldGenLevel { diff --git a/patches/unapplied/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch similarity index 92% rename from patches/unapplied/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch rename to patches/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch index 2852551c4e..198ccd4791 100644 --- a/patches/unapplied/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,10 +7,10 @@ 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 2df4e56450535d2d3f6e83c06261fac7ee7a12dd..66e4b4b12a38d537e8093ba1deb9489fdd56919a 100644 +index e411d9e821604f07e744f2457654f6ac4bb34db7..012634a64a39cbcbb49d2c8948fac92eca15cebe 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -431,6 +431,35 @@ public final class CraftServer implements Server { +@@ -426,6 +426,35 @@ public final class CraftServer implements Server { io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.INSTANCE.enter(io.papermc.paper.plugin.entrypoint.Entrypoint.PLUGIN); // Paper - replace implementation } @@ -47,7 +47,7 @@ index 2df4e56450535d2d3f6e83c06261fac7ee7a12dd..66e4b4b12a38d537e8093ba1deb9489f if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index d4b36863c55d3ffb2c71118b078c13ae95fc73d3..306fdc4111a9afeafc540dbf4f0f9dabcec3c3d9 100644 +index 328118a19ce409ad9a15e75d54d70eb3be65ea6a..7285510dc618327b578b179165023414d595a354 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -160,6 +160,12 @@ public class Main { diff --git a/patches/unapplied/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch similarity index 87% rename from patches/unapplied/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch index 2f67f3bc30..777483a52b 100644 --- a/patches/unapplied/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/0020-Configurable-cactus-bamboo-and-reed-growth-heights.patch @@ -7,10 +7,10 @@ Bamboo - Both the minimum fully-grown heights and the maximum are configurable - Machine_Maker diff --git a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java -index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e73701cf3 100644 +index bd72deadb59289ae90afc379ee61e8198ddaf4ed..1dd85da8da9e2040d740c5f573e7438380f9a7a8 100644 --- a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java -@@ -130,7 +130,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { +@@ -137,7 +137,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { if (random.nextFloat() < (world.spigotConfig.bambooModifier / (100.0f * 3)) && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - SPIGOT-7159: Better modifier resolution int i = this.getHeightBelowUpToMax(world, pos) + 1; @@ -19,7 +19,7 @@ index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e this.growBamboo(state, world, pos, random, i); } } -@@ -161,7 +161,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { +@@ -168,7 +168,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { int i = this.getHeightAboveUpToMax(world, pos); int j = this.getHeightBelowUpToMax(world, pos); @@ -28,7 +28,7 @@ index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e } @Override -@@ -180,7 +180,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { +@@ -187,7 +187,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { BlockPos blockposition1 = pos.above(i); BlockState iblockdata1 = world.getBlockState(blockposition1); @@ -37,7 +37,7 @@ index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e return; } -@@ -221,7 +221,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { +@@ -228,7 +228,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { } int j = (Integer) state.getValue(BambooStalkBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; @@ -46,7 +46,7 @@ index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooStalkBlock.AGE, j)).setValue(BambooStalkBlock.LEAVES, blockpropertybamboosize)).setValue(BambooStalkBlock.STAGE, k), 3)) { -@@ -236,7 +236,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { +@@ -243,7 +243,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { protected int getHeightAboveUpToMax(BlockGetter world, BlockPos pos) { int i; @@ -55,7 +55,7 @@ index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e ; } -@@ -246,7 +246,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { +@@ -253,7 +253,7 @@ public class BambooStalkBlock extends Block implements BonemealableBlock { protected int getHeightBelowUpToMax(BlockGetter world, BlockPos pos) { int i; @@ -65,10 +65,10 @@ index 75754c06268d6d1b719742d127516f77ba5c1046..05a508cb457b67078ccb08bd2228a59e } diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -index a7e8be5545ef6c2ff9a056d297d11850d07bdd1c..2c3bbe4f295be9782c11af13c2cf9c05f27313d9 100644 +index fcd5b593c79aab42928cb1ddd0e6c1b03b7bafaf..3c7bbfcb3a88f23056cd0db3da2a281a81dc8c85 100644 --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -@@ -54,7 +54,7 @@ public class CactusBlock extends Block { +@@ -61,7 +61,7 @@ public class CactusBlock extends Block { ; } @@ -78,10 +78,10 @@ index a7e8be5545ef6c2ff9a056d297d11850d07bdd1c..2c3bbe4f295be9782c11af13c2cf9c05 int modifier = world.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java -index 7fbc511eb1cbfedc3bbf5bff7a61e8f74c294140..c3f500580d257e1397f2eb7c47b063a6fe6bb405 100644 +index 47d4fc5bcf2657078abc7a2637b6337fc0ea0977..ceaec1776067b7635c3952025f00f13f4ea86c88 100644 --- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java -@@ -52,7 +52,7 @@ public class SugarCaneBlock extends Block { +@@ -59,7 +59,7 @@ public class SugarCaneBlock extends Block { ; } diff --git a/patches/unapplied/server/0021-Configurable-baby-zombie-movement-speed.patch b/patches/server/0021-Configurable-baby-zombie-movement-speed.patch similarity index 100% rename from patches/unapplied/server/0021-Configurable-baby-zombie-movement-speed.patch rename to patches/server/0021-Configurable-baby-zombie-movement-speed.patch diff --git a/patches/unapplied/server/0022-Configurable-fishing-time-ranges.patch b/patches/server/0022-Configurable-fishing-time-ranges.patch similarity index 100% rename from patches/unapplied/server/0022-Configurable-fishing-time-ranges.patch rename to patches/server/0022-Configurable-fishing-time-ranges.patch diff --git a/patches/unapplied/server/0023-Allow-nerfed-mobs-to-jump.patch b/patches/server/0023-Allow-nerfed-mobs-to-jump.patch similarity index 90% rename from patches/unapplied/server/0023-Allow-nerfed-mobs-to-jump.patch rename to patches/server/0023-Allow-nerfed-mobs-to-jump.patch index c7519d91f9..927d436277 100644 --- a/patches/unapplied/server/0023-Allow-nerfed-mobs-to-jump.patch +++ b/patches/server/0023-Allow-nerfed-mobs-to-jump.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow nerfed mobs to jump diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index ec841a4d9a11f0d9047c202a31f944b340da33c8..6cc544b39b62cf5be582e697a0df13f82fb73a4b 100644 +index 01761d37c9e4be4e498b62c7612885648b2968a6..183866636eb67f632728a01c8e5e11b514d89f84 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -111,6 +111,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -112,6 +112,7 @@ public abstract class Mob extends LivingEntity implements Targeting { private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; @@ -16,7 +16,7 @@ index ec841a4d9a11f0d9047c202a31f944b340da33c8..6cc544b39b62cf5be582e697a0df13f8 public GoalSelector targetSelector; @Nullable private LivingEntity target; -@@ -876,7 +877,15 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -877,7 +878,15 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override protected final void serverAiStep() { ++this.noActionTime; diff --git a/patches/unapplied/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch similarity index 89% rename from patches/unapplied/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch index d8c587a6f3..587bb29c19 100644 --- a/patches/unapplied/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/patches/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable despawn distances for living entities diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 6cc544b39b62cf5be582e697a0df13f82fb73a4b..6e4980b0e6505f8da90d1d63584ef69f899896ea 100644 +index 183866636eb67f632728a01c8e5e11b514d89f84..007a5c9a6dc70ca6a215fdeb3fe77f8a8ee46818 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -852,14 +852,14 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -853,14 +853,14 @@ public abstract class Mob extends LivingEntity implements Targeting { if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/patches/unapplied/server/0025-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch similarity index 85% rename from patches/unapplied/server/0025-Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch index 22a4665115..a9e11b490f 100644 --- a/patches/unapplied/server/0025-Allow-for-toggling-of-spawn-chunks.patch +++ b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ec31a60fae419fb610f216bd42558e6aa57c2e19..1e57df43ea47f18cc151dc8ad5fd6f18d3615462 100644 +index 2922b90241e81245dbd56c53ab2eb661314c04fd..9369e0346a6b511a332d54577c781c3d2c2b5c86 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -261,6 +261,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -264,6 +264,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); // CraftBukkit end this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings diff --git a/patches/unapplied/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 89% rename from patches/unapplied/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch index 2796f982aa..5d0ae749e1 100644 --- a/patches/unapplied/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/0026-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 15d7cb338a0a1c77e999c23042f04ef3f24ede9a..5e30e7a1447503f424ec3a5aa3983826ee960fd8 100644 +index d344b13e3726f0fe8a57c098769d1beea9705cdd..5d09790876c3c50d126678565001645f6aece16f 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -142,6 +142,16 @@ public class FallingBlockEntity extends Entity { @@ -27,10 +27,10 @@ index 15d7cb338a0a1c77e999c23042f04ef3f24ede9a..5e30e7a1447503f424ec3a5aa3983826 BlockPos blockposition = this.blockPosition(); boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock; diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index a290daaeebfc110428dd8201f144c2acb06fddfc..415b8822f0dfb14d49bccb2a10ac04025891ddf7 100644 +index 36d93ee421406302c05945db17d46b04b485e4c0..f08c021f867c00611139a17db48352944eb2aa99 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -69,6 +69,12 @@ public class PrimedTnt extends Entity implements TraceableEntity { +@@ -77,6 +77,12 @@ public class PrimedTnt extends Entity implements TraceableEntity { } this.move(MoverType.SELF, this.getDeltaMovement()); @@ -44,7 +44,7 @@ index a290daaeebfc110428dd8201f144c2acb06fddfc..415b8822f0dfb14d49bccb2a10ac0402 if (this.onGround()) { this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D)); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java -index 137f9052701c5b10ff03b01316ced37220dbf280..1f4031cb7a101a7f25d530380974a627cc29bb09 100644 +index 0fc58f38bbd855414ad36b682e60b069d7b68cb1..9ec8821cf6571c5cc6b32212fe6f33bc4f6b949f 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java @@ -53,6 +53,12 @@ public class MinecartTNT extends AbstractMinecart { diff --git a/patches/unapplied/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 similarity index 93% rename from patches/unapplied/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index c3acf9363e..7aa28033c4 100644 --- a/patches/unapplied/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 27ab6d2749b89cc5d3fd4e22603daee95634be71..6155d6e3c361bb4a0381e7065a7b603b783a47a6 100644 +index 2021526bf6b8bdc286c31aaa62ab0235fac073cd..b082e17b9fbcc0e8ee881a89df1207d26bbeda0b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1457,7 +1457,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop CAN_BE_COLLIDED_WITH = EntitySelector.NO_SPECTATORS.and(Entity::canBeCollidedWith); private EntitySelector() {} @@ -21,10 +21,10 @@ index 984a13267cc1bb960507bc9231359bb4bb837205..668a7c3f36cdbe48e472cb810b27ae4a public static Predicate withinDistance(double x, double y, double z, double max) { double d4 = max * max; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 6e4980b0e6505f8da90d1d63584ef69f899896ea..2aa3df6ef2da77fa51c11d64124ac55a3769f567 100644 +index 007a5c9a6dc70ca6a215fdeb3fe77f8a8ee46818..3d054cfa5050f4b75eab4a18035655c1bfd9290b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -848,7 +848,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -849,7 +849,7 @@ public abstract class Mob extends LivingEntity implements Targeting { if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -73,10 +73,10 @@ index 37824f2470c7ddb77216ffbf4da02cc10a95a171..0c9a91990376482bc16f74a8b183ebf0 entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null, (CompoundTag) null); worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 37629bf1193e220bcf872c714c55e0708d9fd7e0..45a5baf2f6e868fd5b41be1204bee46fb2e631b5 100644 +index eed6481bc88ed15a5e3fe7056b545ab44ed81983..86d187cadb73dbe0757f9417c4549e358ff303ca 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -184,6 +184,9 @@ public abstract class Player extends LivingEntity { +@@ -179,6 +179,9 @@ public abstract class Player extends LivingEntity { @Nullable public FishingHook fishing; protected float hurtDir; @@ -87,10 +87,10 @@ index 37629bf1193e220bcf872c714c55e0708d9fd7e0..45a5baf2f6e868fd5b41be1204bee46f // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index ad5d8db9fb44f8e47edc82f9ba62872802bfa380..124703a7c043b6c3b651fa1a81c5ba3e99e47938 100644 +index d156f7e3430685947d2b4c30aa867e8002ca70ad..e888cf862662ae6baa6d0de8188aa74a9c6a8e00 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -54,7 +54,7 @@ public abstract class BaseSpawner { +@@ -56,7 +56,7 @@ public abstract class BaseSpawner { } public boolean isNearPlayer(Level world, BlockPos pos) { @@ -137,10 +137,10 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..36d793b492d9776ee36f8285b5bab09e 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 5e495f89139689ca37982c7b0b79eaf50d444435..ed70dc4b4dfd57af877c42ff579296ce5cebadbd 100644 +index 24c282c0727fa814c403716837b2d44b216c5b16..e6f67e770f97f239e545c2d4396c86b546c712e0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2251,6 +2251,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2266,6 +2266,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().language; } diff --git a/patches/unapplied/server/0031-Further-improve-server-tick-loop.patch b/patches/server/0031-Further-improve-server-tick-loop.patch similarity index 88% rename from patches/unapplied/server/0031-Further-improve-server-tick-loop.patch rename to patches/server/0031-Further-improve-server-tick-loop.patch index 511a37bc52..8cb4a3bd97 100644 --- a/patches/unapplied/server/0031-Further-improve-server-tick-loop.patch +++ b/patches/server/0031-Further-improve-server-tick-loop.patch @@ -12,10 +12,10 @@ 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 6155d6e3c361bb4a0381e7065a7b603b783a47a6..d13a0f5a3b95b0d0ca80c760f757087c88eceaeb 100644 +index b082e17b9fbcc0e8ee881a89df1207d26bbeda0b..2955636e2afd425988e9377d4bbe93258fd4e412 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -277,7 +277,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -286,7 +286,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit - long j = i / 50L; -@@ -969,12 +1021,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 679f55d1b09868a28c5ba82746968eab1000aa88..5d5cdcc3d6ba9b76b083404beb532eecf3f83f50 100644 +index 9f3598371c854ec74f3b5752c9779d6c0d99ec39..450a55fd1b01ac67d911d152a04a3dee3aa0a2e9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -715,7 +715,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -720,7 +720,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void checkBelowWorld() { diff --git a/patches/unapplied/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch similarity index 88% rename from patches/unapplied/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch rename to patches/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch index 167b258277..5d700a4574 100644 --- a/patches/unapplied/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch +++ b/patches/server/0036-Check-online-mode-before-converting-and-renaming-pla.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Check online mode before converting and renaming player data 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 e2c0ab0ab06b15dcfa6ce8c82ad4136f2be33b5c..984b75e12b5feab63767e030df925b3cbf26d559 100644 +index 3d74ffc6e38b0dbe7ca6d8d84a63f78d6b1908a7..08f4cc47ec3aa4dd6980ba543219891a510b010b 100644 --- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java +++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java -@@ -56,7 +56,7 @@ public class PlayerDataStorage { +@@ -60,7 +60,7 @@ public class PlayerDataStorage { File file = new File(this.playerDir, player.getStringUUID() + ".dat"); // Spigot Start boolean usingWrongFile = false; diff --git a/patches/unapplied/server/0037-Always-tick-falling-blocks.patch b/patches/server/0037-Always-tick-falling-blocks.patch similarity index 100% rename from patches/unapplied/server/0037-Always-tick-falling-blocks.patch rename to patches/server/0037-Always-tick-falling-blocks.patch diff --git a/patches/unapplied/server/0038-Configurable-end-credits.patch b/patches/server/0038-Configurable-end-credits.patch similarity index 86% rename from patches/unapplied/server/0038-Configurable-end-credits.patch rename to patches/server/0038-Configurable-end-credits.patch index 7c4a921f4e..762d732bb9 100644 --- a/patches/unapplied/server/0038-Configurable-end-credits.patch +++ b/patches/server/0038-Configurable-end-credits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable end credits diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d7c4ce86956c0461603e8d569e9bebe39f07c8a1..61ec0ed91457e4b04a72010199be520c9d4a9488 100644 +index b6939932a4b8800c8751125a4a6d4dcea39110c1..bf89ea0f7506434848cb9c1cbfb3fe6dd2eb3212 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1069,6 +1069,7 @@ public class ServerPlayer extends Player { +@@ -1074,6 +1074,7 @@ public class ServerPlayer extends Player { this.unRide(); this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); if (!this.wonGame) { diff --git a/patches/unapplied/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch similarity index 89% rename from patches/unapplied/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch rename to patches/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch index 6f5230d060..305920cc55 100644 --- a/patches/unapplied/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/patches/server/0039-Fix-lag-from-explosions-processing-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 280ee4747526c05a02d556908b8a3d59a4ccad9e..4f2e06dab92085edd8f98415272cf77952e4888f 100644 +index 725ea53e6143d29f9619e1045341bc30155b248e..c5d644876e0c92a444a574ee7571227e19b28482 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -203,7 +203,7 @@ public class Explosion { +@@ -225,7 +225,7 @@ public class Explosion { int i1 = Mth.floor(this.y + (double) f2 + 1.0D); int j1 = Mth.floor(this.z - (double) f2 - 1.0D); int k1 = Mth.floor(this.z + (double) f2 + 1.0D); diff --git a/patches/unapplied/server/0040-Optimize-explosions.patch b/patches/server/0040-Optimize-explosions.patch similarity index 85% rename from patches/unapplied/server/0040-Optimize-explosions.patch rename to patches/server/0040-Optimize-explosions.patch index 00cec9c09b..4f1610a9f4 100644 --- a/patches/unapplied/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 d13a0f5a3b95b0d0ca80c760f757087c88eceaeb..4627eb980d5ac1571f57756bc90f2ae6d361f522 100644 +index 2955636e2afd425988e9377d4bbe93258fd4e412..6986109ca6de3c73d63c4539477997361044e64f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1390,6 +1390,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop