From f04e64dfc69230ad90f62dfc22bb4673c2d89479 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 7 Jun 2022 21:22:42 -0700 Subject: [PATCH] moar patches --- ...025-Further-improve-server-tick-loop.patch | 36 +++--- ...dd-Early-Warning-Feature-to-WatchDog.patch | 8 +- ...pawn-settings-and-per-player-option.patch} | 26 ++--- ...nections-shouldn-t-hold-up-shutdown.patch} | 4 +- ...ow-bees-to-load-chunks-for-beehives.patch} | 10 +- ...PlayerChunkMap-adds-crashing-server.patch} | 12 +- .../0381-Don-t-tick-dead-players.patch} | 4 +- ...-Player-s-shouldn-t-be-able-to-move.patch} | 4 +- ...timize-Collision-to-not-load-chunks.patch} | 10 +- ...ove-existing-players-to-world-spawn.patch} | 10 +- ...alSelector-Goal.Flag-Set-operations.patch} | 0 .../0386-Improved-Watchdog-Support.patch} | 104 +++++++++--------- .../0387-Optimize-Pathfinding.patch} | 4 +- ...8-Reduce-Either-Optional-allocation.patch} | 0 14 files changed, 116 insertions(+), 116 deletions(-) rename patches/{unapplied/server/0379-Pillager-patrol-spawn-settings-and-per-player-option.patch => server/0377-Pillager-patrol-spawn-settings-and-per-player-option.patch} (87%) rename patches/{unapplied/server/0380-Remote-Connections-shouldn-t-hold-up-shutdown.patch => server/0378-Remote-Connections-shouldn-t-hold-up-shutdown.patch} (86%) rename patches/{unapplied/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch => server/0379-Do-not-allow-bees-to-load-chunks-for-beehives.patch} (84%) rename patches/{unapplied/server/0382-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch => server/0380-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch} (84%) rename patches/{unapplied/server/0383-Don-t-tick-dead-players.patch => server/0381-Don-t-tick-dead-players.patch} (85%) rename patches/{unapplied/server/0384-Dead-Player-s-shouldn-t-be-able-to-move.patch => server/0382-Dead-Player-s-shouldn-t-be-able-to-move.patch} (84%) rename patches/{unapplied/server/0385-Optimize-Collision-to-not-load-chunks.patch => server/0383-Optimize-Collision-to-not-load-chunks.patch} (94%) rename patches/{unapplied/server/0386-Don-t-move-existing-players-to-world-spawn.patch => server/0384-Don-t-move-existing-players-to-world-spawn.patch} (85%) rename patches/{unapplied/server/0387-Optimize-GoalSelector-Goal.Flag-Set-operations.patch => server/0385-Optimize-GoalSelector-Goal.Flag-Set-operations.patch} (100%) rename patches/{unapplied/server/0388-Improved-Watchdog-Support.patch => server/0386-Improved-Watchdog-Support.patch} (88%) rename patches/{unapplied/server/0389-Optimize-Pathfinding.patch => server/0387-Optimize-Pathfinding.patch} (91%) rename patches/{unapplied/server/0390-Reduce-Either-Optional-allocation.patch => server/0388-Reduce-Either-Optional-allocation.patch} (100%) diff --git a/patches/server/0025-Further-improve-server-tick-loop.patch b/patches/server/0025-Further-improve-server-tick-loop.patch index 96f3215136..a1536a0d2c 100644 --- a/patches/server/0025-Further-improve-server-tick-loop.patch +++ b/patches/server/0025-Further-improve-server-tick-loop.patch @@ -12,7 +12,7 @@ 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 bd549661ccfb29b9a4f9d69956c549ba3e888e31..032e6819da27c8616b9b3b6c09bd559e69c35100 100644 +index bd549661ccfb29b9a4f9d69956c549ba3e888e31..39a079ce407081ba1ff13c23cfbeeab9c5a78e07 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit long j = i / 50L; @@ -114,22 +114,22 @@ index bd549661ccfb29b9a4f9d69956c549ba3e888e31..032e6819da27c8616b9b3b6c09bd559e ++MinecraftServer.currentTickLong; // Paper - if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) -+ if ( ++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0 ) ++ if ( ++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0 ) { - 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) -+ final long diff = curTime - tickSection; -+ 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 ++ final long diff = curTime - tickSection; ++ 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; } // Spigot end @@ -138,13 +138,13 @@ index bd549661ccfb29b9a4f9d69956c549ba3e888e31..032e6819da27c8616b9b3b6c09bd559e } - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit -+ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time -+ lastTick = curTime; ++ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time ++ lastTick = curTime; this.nextTickTime += 50L; 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 93947c982c40be873bd1f3273ca69dbdf6820aeb..a7dcdb5cce888f8580b54f7de263110e69285311 100644 +index 6a35ff1c7d7b59b8dae8bbae2f2133f74d00e35b..24ede23d6cb432c0f842ce076ce592ef8c089a85 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2374,6 +2374,17 @@ public final class CraftServer implements Server { diff --git a/patches/server/0239-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0239-Add-Early-Warning-Feature-to-WatchDog.patch index 3efe9c9080..a6241d0930 100644 --- a/patches/server/0239-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0239-Add-Early-Warning-Feature-to-WatchDog.patch @@ -36,17 +36,17 @@ index c3539fabda1887cca6e82abce26dff088cdc4251..924b890d34c113ce804244dbb6635ff7 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b031d4340dbee22108f8cbc15729337c50160a29..87970a1291b6c01bcb94a87fbbb0877a9d6b350f 100644 +index 6d92ab505613fc0ba0c0436c6a6336eb6349a461..40d086016536dd3efa5c861a770853c166974c7c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1057,6 +1057,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0) { @@ -70,7 +70,7 @@ index d5a701b2d684bbe18f985adb6bd62e9218d3a0a6..babdbd9c78ff71a12d7bb369603f139c return 0; + } + -+ net.minecraft.server.level.ServerPlayer entityhuman = world.players().get(random.nextInt(j)); ++ net.minecraft.server.level.ServerPlayer entityhuman = world.players().get(randomsource.nextInt(j)); + if (entityhuman.isSpectator()) { + return 0; + } @@ -80,7 +80,7 @@ index d5a701b2d684bbe18f985adb6bd62e9218d3a0a6..babdbd9c78ff71a12d7bb369603f139c + --entityhuman.patrolSpawnDelay; + patrolSpawnDelay = entityhuman.patrolSpawnDelay; } else { -- this.nextTick += 12000 + random.nextInt(1200); +- this.nextTick += 12000 + randomsource.nextInt(1200); - long i = world.getDayTime() / 24000L; + this.nextTick--; + patrolSpawnDelay = this.nextTick; @@ -96,15 +96,15 @@ index d5a701b2d684bbe18f985adb6bd62e9218d3a0a6..babdbd9c78ff71a12d7bb369603f139c + days = world.getDayTime() / 24000L; + } + if (world.paperConfig.patrolPerPlayerDelay) { -+ entityhuman.patrolSpawnDelay += world.paperConfig.patrolDelay + random.nextInt(1200); ++ entityhuman.patrolSpawnDelay += world.paperConfig.patrolDelay + randomsource.nextInt(1200); + } else { -+ this.nextTick += world.paperConfig.patrolDelay + random.nextInt(1200); ++ this.nextTick += world.paperConfig.patrolDelay + randomsource.nextInt(1200); + } - if (i >= 5L && world.isDay()) { -- if (random.nextInt(5) != 0) { +- if (randomsource.nextInt(5) != 0) { + if (days >= world.paperConfig.patrolStartDay && world.isDay()) { -+ if (random.nextDouble() >= world.paperConfig.patrolSpawnChance) { ++ if (randomsource.nextDouble() >= world.paperConfig.patrolSpawnChance) { + // Paper end return 0; } else { @@ -113,7 +113,7 @@ index d5a701b2d684bbe18f985adb6bd62e9218d3a0a6..babdbd9c78ff71a12d7bb369603f139c if (j < 1) { return 0; } else { -- Player entityhuman = (Player) world.players().get(random.nextInt(j)); +- Player entityhuman = (Player) world.players().get(randomsource.nextInt(j)); if (entityhuman.isSpectator()) { return 0; diff --git a/patches/unapplied/server/0380-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/patches/server/0378-Remote-Connections-shouldn-t-hold-up-shutdown.patch similarity index 86% rename from patches/unapplied/server/0380-Remote-Connections-shouldn-t-hold-up-shutdown.patch rename to patches/server/0378-Remote-Connections-shouldn-t-hold-up-shutdown.patch index c53005aca2..b798d6cc26 100644 --- a/patches/unapplied/server/0380-Remote-Connections-shouldn-t-hold-up-shutdown.patch +++ b/patches/server/0378-Remote-Connections-shouldn-t-hold-up-shutdown.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remote Connections shouldn't hold up shutdown Bugs in the connection logic appears to leave stale connections even, preventing shutdown diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 4357d5c7c66d9490a34f2d591ddc3d58d36cadd1..ab26a26ac553071ecd943dc8a3b41debf8b797ef 100644 +index 0cd6e4fbcc97ab6b64333860d56946268c1f5064..8f5910ee6469af62bab9c26c2e1985784ae73900 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -434,11 +434,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -399,11 +399,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } if (this.rconThread != null) { diff --git a/patches/unapplied/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch b/patches/server/0379-Do-not-allow-bees-to-load-chunks-for-beehives.patch similarity index 84% rename from patches/unapplied/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch rename to patches/server/0379-Do-not-allow-bees-to-load-chunks-for-beehives.patch index 471ca643c3..aa61dfee66 100644 --- a/patches/unapplied/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch +++ b/patches/server/0379-Do-not-allow-bees-to-load-chunks-for-beehives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not allow bees to load chunks for beehives diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 8e857d4ff6497d68e462418d75b8378ff7adbc97..c49e7ea3e2efc4459f5ed1d4ebd83c9d23420611 100644 +index d94f045d7fe928c256c5d3e1af02ac73d7897f5a..d13f3460644f635ded96bf92ddf9ecf8984c8e47 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -408,6 +408,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -409,6 +409,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (this.hivePos == null) { return false; } else { @@ -16,7 +16,7 @@ index 8e857d4ff6497d68e462418d75b8378ff7adbc97..c49e7ea3e2efc4459f5ed1d4ebd83c9d BlockEntity tileentity = this.level.getBlockEntity(this.hivePos); return tileentity instanceof BeehiveBlockEntity && ((BeehiveBlockEntity) tileentity).isFireNearby(); -@@ -441,6 +442,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -442,6 +443,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { } private boolean doesHiveHaveSpace(BlockPos pos) { @@ -24,7 +24,7 @@ index 8e857d4ff6497d68e462418d75b8378ff7adbc97..c49e7ea3e2efc4459f5ed1d4ebd83c9d BlockEntity tileentity = this.level.getBlockEntity(pos); return tileentity instanceof BeehiveBlockEntity ? !((BeehiveBlockEntity) tileentity).isFull() : false; -@@ -920,6 +922,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -921,6 +923,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public boolean canBeeUse() { if (Bee.this.hasHive() && Bee.this.wantsToEnterHive() && Bee.this.hivePos.closerToCenterThan(Bee.this.position(), 2.0D)) { @@ -32,7 +32,7 @@ index 8e857d4ff6497d68e462418d75b8378ff7adbc97..c49e7ea3e2efc4459f5ed1d4ebd83c9d BlockEntity tileentity = Bee.this.level.getBlockEntity(Bee.this.hivePos); if (tileentity instanceof BeehiveBlockEntity) { -@@ -943,6 +946,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -944,6 +947,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public void start() { diff --git a/patches/unapplied/server/0382-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0380-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch similarity index 84% rename from patches/unapplied/server/0382-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch rename to patches/server/0380-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch index 44137bcfcb..a67b478152 100644 --- a/patches/unapplied/server/0382-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch +++ b/patches/server/0380-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch @@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding Stack will identify any causer of this and warn instead of crashing. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index a0ffdeaad5c375539857d6a5a94832216d09f024..5346109670bedf88f13b4eff47c5292170fb47cc 100644 +index 5cf6f6f67520af8d94456a028828e49446e82be9..496f9580fe0f28381f863cd505779e6b9c103bc9 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1600,6 +1600,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1643,6 +1643,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void addEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot @@ -26,10 +26,10 @@ index a0ffdeaad5c375539857d6a5a94832216d09f024..5346109670bedf88f13b4eff47c52921 EntityType entitytypes = entity.getType(); int i = entitytypes.clientTrackingRange() * 16; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0a7dbafd938141b34dc66d0b4af26dba92a21c06..5009ad1a758e192eaf6ca59baab26d2ba58a6c66 100644 +index 6bded610f82189a5549e656881dbce0d34f285b2..8808b8b5b3fa03a1a0c4d843867f1e26d966ab85 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2210,7 +2210,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2288,7 +2288,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public void onTrackingStart(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot @@ -38,9 +38,9 @@ index 0a7dbafd938141b34dc66d0b4af26dba92a21c06..5009ad1a758e192eaf6ca59baab26d2b if (entity instanceof ServerPlayer) { ServerPlayer entityplayer = (ServerPlayer) entity; -@@ -2243,6 +2243,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - } +@@ -2322,6 +2322,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.valid = true; // CraftBukkit + ServerLevel.this.getChunkSource().addEntity(entity); // Paper start - Set origin location when the entity is being added to the world diff --git a/patches/unapplied/server/0383-Don-t-tick-dead-players.patch b/patches/server/0381-Don-t-tick-dead-players.patch similarity index 85% rename from patches/unapplied/server/0383-Don-t-tick-dead-players.patch rename to patches/server/0381-Don-t-tick-dead-players.patch index 85bc002aaa..df707c1662 100644 --- a/patches/unapplied/server/0383-Don-t-tick-dead-players.patch +++ b/patches/server/0381-Don-t-tick-dead-players.patch @@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else. This is safe because Spectators are skipped in unloaded chunks too in vanilla. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 600a774a0cdad4b2582afb3c603734209dac24f7..ef222e90d1dd125c909f00bab98eeb501f547a50 100644 +index 4c0ab7705824a02bb7e9906fbd3a5c4792bc7dd7..25cbb75767331682276f3c1abd6a08bbc81b4e13 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -643,7 +643,7 @@ public class ServerPlayer extends Player { +@@ -650,7 +650,7 @@ public class ServerPlayer extends Player { public void doTick() { try { diff --git a/patches/unapplied/server/0384-Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/0382-Dead-Player-s-shouldn-t-be-able-to-move.patch similarity index 84% rename from patches/unapplied/server/0384-Dead-Player-s-shouldn-t-be-able-to-move.patch rename to patches/server/0382-Dead-Player-s-shouldn-t-be-able-to-move.patch index b79b2b17bc..a0ee4a030d 100644 --- a/patches/unapplied/server/0384-Dead-Player-s-shouldn-t-be-able-to-move.patch +++ b/patches/server/0382-Dead-Player-s-shouldn-t-be-able-to-move.patch @@ -7,10 +7,10 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. 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 8a05690556f8f979d268cd7c6b5c14343ad33579..49648e258c6e72ac921f69114e1e36a926749d46 100644 +index 6eb7240850d50528d8fad8dff79ee578e3f9b588..fba9636e670300e31b5348de9cf3bc23e0eb6e6a 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1128,7 +1128,7 @@ public abstract class Player extends LivingEntity { +@@ -1174,7 +1174,7 @@ public abstract class Player extends LivingEntity { @Override protected boolean isImmobile() { diff --git a/patches/unapplied/server/0385-Optimize-Collision-to-not-load-chunks.patch b/patches/server/0383-Optimize-Collision-to-not-load-chunks.patch similarity index 94% rename from patches/unapplied/server/0385-Optimize-Collision-to-not-load-chunks.patch rename to patches/server/0383-Optimize-Collision-to-not-load-chunks.patch index 84a6cf3797..11639a4e22 100644 --- a/patches/unapplied/server/0385-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/0383-Optimize-Collision-to-not-load-chunks.patch @@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 7b000de3fa232a75cc3737783e4a38025d0d8bde..52ce9718321b96ffb00b3a1b1b2b0071a91217b6 100644 +index a2071ea91515c5ddd2318cc4918328d20dec224e..dcdf25a8111410d54adc2e758775efcce0165b73 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -791,6 +791,7 @@ public abstract class PlayerList { +@@ -795,6 +795,7 @@ public abstract class PlayerList { entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // CraftBukkit end @@ -26,11 +26,11 @@ index 7b000de3fa232a75cc3737783e4a38025d0d8bde..52ce9718321b96ffb00b3a1b1b2b0071 entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 32e93c0c9c56a00585ede420f488cfe4a1b37ffa..384f4eabb2ebacd459e0f21e268e3dd0cd4b4d20 100644 +index ea522476dff5408e1b7e488c4460406409d140ca..0e36422d3bf2261ee792774b17cfbeadd05f2b1d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -174,6 +174,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - // Paper end +@@ -195,6 +195,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper + public boolean collisionLoadChunks = false; // Paper diff --git a/patches/unapplied/server/0386-Don-t-move-existing-players-to-world-spawn.patch b/patches/server/0384-Don-t-move-existing-players-to-world-spawn.patch similarity index 85% rename from patches/unapplied/server/0386-Don-t-move-existing-players-to-world-spawn.patch rename to patches/server/0384-Don-t-move-existing-players-to-world-spawn.patch index 0519e05dc1..31d5133613 100644 --- a/patches/unapplied/server/0386-Don-t-move-existing-players-to-world-spawn.patch +++ b/patches/server/0384-Don-t-move-existing-players-to-world-spawn.patch @@ -10,10 +10,10 @@ larger than the keep loaded range. By skipping this, we avoid potential for a large spike on server start. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ef222e90d1dd125c909f00bab98eeb501f547a50..888e127e7e59a7ceb63f12ec69046916a0e29fc9 100644 +index 25cbb75767331682276f3c1abd6a08bbc81b4e13..3603e169f9195b86553867ddabca2e3ad90a494f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -313,7 +313,7 @@ public class ServerPlayer extends Player { +@@ -320,7 +320,7 @@ public class ServerPlayer extends Player { this.stats = server.getPlayerList().getPlayerStats(this); this.advancements = server.getPlayerList().getPlayerAdvancements(this); this.maxUpStep = 1.0F; @@ -22,7 +22,7 @@ index ef222e90d1dd125c909f00bab98eeb501f547a50..888e127e7e59a7ceb63f12ec69046916 this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper -@@ -531,7 +531,7 @@ public class ServerPlayer extends Player { +@@ -538,7 +538,7 @@ public class ServerPlayer extends Player { position = Vec3.atCenterOf(((ServerLevel) world).getSharedSpawnPos()); } this.level = world; @@ -32,10 +32,10 @@ index ef222e90d1dd125c909f00bab98eeb501f547a50..888e127e7e59a7ceb63f12ec69046916 this.gameMode.setLevel((ServerLevel) world); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 52ce9718321b96ffb00b3a1b1b2b0071a91217b6..332bc127230fcefcdab0087922536af8b6ff1e8c 100644 +index dcdf25a8111410d54adc2e758775efcce0165b73..3290a2e4689c9e34c3260db4de8ac7f6dc74f8ea 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -210,6 +210,8 @@ public abstract class PlayerList { +@@ -214,6 +214,8 @@ public abstract class PlayerList { worldserver1 = worldserver; } diff --git a/patches/unapplied/server/0387-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/0385-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/unapplied/server/0387-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/0385-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/unapplied/server/0388-Improved-Watchdog-Support.patch b/patches/server/0386-Improved-Watchdog-Support.patch similarity index 88% rename from patches/unapplied/server/0388-Improved-Watchdog-Support.patch rename to patches/server/0386-Improved-Watchdog-Support.patch index 20a652c50e..4a6bebbbce 100644 --- a/patches/unapplied/server/0388-Improved-Watchdog-Support.patch +++ b/patches/server/0386-Improved-Watchdog-Support.patch @@ -71,10 +71,10 @@ index 8cc4cb2163a93b9491550fe6d0f5d980fb216920..4dd14d73a37b32288a64fbd67ee22c43 cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 03ebc2a0476aef9297cbbc7f358915703a469b02..4ed65f1371013fb91fe60a0e1501e222a6e9c508 100644 +index 6d71dd7021afa2cb3c1200c64de08e3658e0a998..08ada4f1818f3dc8aeee417df11948a48b66bcfd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -297,7 +297,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -83,7 +83,7 @@ index 03ebc2a0476aef9297cbbc7f358915703a469b02..4ed65f1371013fb91fe60a0e1501e222 // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -307,6 +307,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new Thread(() -> { -@@ -911,6 +914,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { CompletableFuture completablefuture; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 332bc127230fcefcdab0087922536af8b6ff1e8c..936742383a6834bfd687ec48db308475f598d216 100644 +index 3290a2e4689c9e34c3260db4de8ac7f6dc74f8ea..8fa76c3184d7e25339c2de27332ff4d523a4b85e 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -512,7 +512,7 @@ public abstract class PlayerList { +@@ -516,7 +516,7 @@ public abstract class PlayerList { this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); @@ -299,10 +299,10 @@ index 6fefa619299d3202158490630d62c16aef71e831..7a4ade1a4190bf4fbb048919ae2be230 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 334fd625829c8e5e9c434b184f6d0084b2d6ccc8..e4c2bd0131a54495fbd1930ad046225118e33186 100644 +index c4e679eca56ca756d2d7a9d2ffa2a56e5ab3f721..6f04f79832b52fc898ec2b13af03bc28d4e0bbc1 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -832,6 +832,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -789,6 +789,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { tickConsumer.accept(entity); } catch (Throwable throwable) { @@ -311,10 +311,10 @@ index 334fd625829c8e5e9c434b184f6d0084b2d6ccc8..e4c2bd0131a54495fbd1930ad0462251 final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); MinecraftServer.LOGGER.error(msg, throwable); 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 f994d393929ca6813d4209fb9c93550e4f692228..0b049b267a1e1d6b48c035ed54ff24337863fb9e 100644 +index 930fa1703727249585b4ac045db15d55736c58fd..f362f0edf7ee81d2e21d86d57b86420f9619f32e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -1058,6 +1058,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1083,6 +1083,7 @@ public class LevelChunk extends ChunkAccess { gameprofilerfiller.pop(); } catch (Throwable throwable) { @@ -323,10 +323,10 @@ index f994d393929ca6813d4209fb9c93550e4f692228..0b049b267a1e1d6b48c035ed54ff2433 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/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 21a10a0dc98cb2c669a505d6185c2093855afae6..9e2adc414d43f0c91f222be5f082e74d9db173aa 100644 +index 8a36ed778814dfd74ab190fa25cc6dbb54275ac0..14baaf2d679ccceeecb32958cd2ad0ef54beaf4b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2067,7 +2067,7 @@ public final class CraftServer implements Server { +@@ -2050,7 +2050,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -336,7 +336,7 @@ index 21a10a0dc98cb2c669a505d6185c2093855afae6..9e2adc414d43f0c91f222be5f082e74d // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 69b7a11d423b1cd8560cd726dd2b9a2b203e7dfd..7a5e7e8a680ead5128fbf5829bc47704715b94bd 100644 +index fea479165e4cf1e4fc6e462d63123bf31bb4e3c3..5e79ad04aed13462d1d187a71801aeb2628495e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -12,6 +12,8 @@ import java.util.logging.Level; diff --git a/patches/unapplied/server/0389-Optimize-Pathfinding.patch b/patches/server/0387-Optimize-Pathfinding.patch similarity index 91% rename from patches/unapplied/server/0389-Optimize-Pathfinding.patch rename to patches/server/0387-Optimize-Pathfinding.patch index 4259e48495..061629eb03 100644 --- a/patches/unapplied/server/0389-Optimize-Pathfinding.patch +++ b/patches/server/0387-Optimize-Pathfinding.patch @@ -7,10 +7,10 @@ Prevents pathfinding from spamming failures for things such as arrow attacks. diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -index 7991baa181d60ac037fd859278d00274ddb42be8..b47cd6d8ed02875bd9af54d27b7c1cda340e7f9f 100644 +index 649c2fdba307d986d13916bf90e311c862ccefc1..af53372391d05dd6aa3757556418e8723b8b6d80 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -@@ -189,9 +189,29 @@ public abstract class PathNavigation { +@@ -191,9 +191,29 @@ public abstract class PathNavigation { return this.moveTo(this.createPath(x, y, z, 1), speed); } diff --git a/patches/unapplied/server/0390-Reduce-Either-Optional-allocation.patch b/patches/server/0388-Reduce-Either-Optional-allocation.patch similarity index 100% rename from patches/unapplied/server/0390-Reduce-Either-Optional-allocation.patch rename to patches/server/0388-Reduce-Either-Optional-allocation.patch