From fca7f237b64556aeef1f6bde78db8e054db74047 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Fri, 26 Jan 2024 14:12:13 +0900 Subject: [PATCH] Updated Upstream (Paper, Purpur) --- gradle.properties | 4 +- patches/api/0002-Purpur-API-Changes.patch | 2 +- .../0001-Pufferfish-Server-Changes.patch | 87 +++--- .../server/0002-Purpur-Server-Changes.patch | 280 +++++++++--------- patches/server/0005-Rebrand.patch | 4 +- .../server/0007-Plazma-Configurations.patch | 10 +- .../0009-Port-SparklyPaper-patches.patch | 4 +- ...0012-Optimize-default-configurations.patch | 4 +- ...missing-purpur-configuration-options.patch | 4 +- ...16-Completely-remove-Mojang-Profiler.patch | 14 +- .../0019-Apply-various-optimizations.patch | 6 +- patches/server/0035-Reduce-allocations.patch | 6 +- 12 files changed, 227 insertions(+), 198 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7fc02d8..76ccb26 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ version = 1.20.4-R0.1-SNAPSHOT mcVersion = 1.20.4 -paperCommit = 1831240d1c48086fc0199584787cd2013d4d4b5f -purpurCommit = 11391a2b82ea206c3a02dde459da5ad3a9db17e0 +paperCommit = b03f255532bba5a1398f03207756f42e5597ccb8 +purpurCommit = eab2140f5e34a97dc95ae692ee71b622b848b577 org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/api/0002-Purpur-API-Changes.patch b/patches/api/0002-Purpur-API-Changes.patch index 9a7d553..a4e098c 100644 --- a/patches/api/0002-Purpur-API-Changes.patch +++ b/patches/api/0002-Purpur-API-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny -Date: Tue, 23 Jan 2024 15:56:26 +0900 +Date: Fri, 26 Jan 2024 13:54:27 +0900 Subject: [PATCH] Purpur API Changes PurpurMC diff --git a/patches/server/0001-Pufferfish-Server-Changes.patch b/patches/server/0001-Pufferfish-Server-Changes.patch index b6157ec..bbdddc1 100644 --- a/patches/server/0001-Pufferfish-Server-Changes.patch +++ b/patches/server/0001-Pufferfish-Server-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Kevin Raneri -Date: Tue, 23 Jan 2024 15:56:24 +0900 +Date: Fri, 26 Jan 2024 13:54:26 +0900 Subject: [PATCH] Pufferfish Server Changes Pufferfish @@ -1497,40 +1497,41 @@ index ba12919c3f9aec34a9e64993b143ae92be5eb172..9efeab9078e2d08903e482718b840797 } else { this.lastTimeStamp = body.timeStamp(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 23d2264dfc4f763a7198eb543e7f86a5a5aa85c3..b1671cb6275369efe3e643bce40a3fd7318a6fa0 100644 +index fa2b4cdd4c4e2c1df3e378a7c706f06c3361ad53..5b6771cc925d29c26ea0cfcf0f72184f96e3eade 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1214,6 +1215,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // Paper - rewrite chunk system +@@ -1218,6 +1220,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Pufferfish"; // Pufferfish - Pufferfish > // Paper } public SystemReport fillSystemReport(SystemReport details) { -@@ -2437,6 +2444,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f); - final java.util.concurrent.atomic.AtomicLong chunkFutureAwaitCounter = new java.util.concurrent.atomic.AtomicLong(); // Paper - chunk system rewrite +@@ -77,6 +77,9 @@ public class ServerChunkCache extends ChunkSource { private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4]; -+ public boolean firstRunSpawnCounts = true; // Pufferfish -+ public final java.util.concurrent.atomic.AtomicBoolean _pufferfish_spawnCountsReady = new java.util.concurrent.atomic.AtomicBoolean(false); // Pufferfish - optimize countmobs // Paper end ++ public boolean firstRunSpawnCounts = true; // Pufferfish ++ public final java.util.concurrent.atomic.AtomicBoolean _pufferfish_spawnCountsReady = new java.util.concurrent.atomic.AtomicBoolean(false); // Pufferfish - optimize countmobs ++ public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory) { -@@ -513,6 +515,7 @@ public class ServerChunkCache extends ChunkSource { + this.level = world; + this.mainThreadProcessor = new ServerChunkCache.MainThreadExecutor(world); +@@ -513,6 +516,7 @@ public class ServerChunkCache extends ChunkSource { // Paper - optimise chunk tick iteration @@ -1632,7 +1634,7 @@ index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..12f11576c41ded54f759da16f54f6d7b if (this.level.getServer().tickRateManager().runsNormally()) { gameprofilerfiller.popPush("naturalSpawnCount"); this.level.timings.countNaturalMobs.startTiming(); // Paper - timings -@@ -521,6 +524,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -521,6 +525,7 @@ public class ServerChunkCache extends ChunkSource { int naturalSpawnChunkCount = k; NaturalSpawner.SpawnState spawnercreature_d; // moved down if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled @@ -1640,7 +1642,7 @@ index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..12f11576c41ded54f759da16f54f6d7b // re-set mob counts for (ServerPlayer player : this.level.players) { // Paper start - per player mob spawning backoff -@@ -535,14 +539,18 @@ public class ServerChunkCache extends ChunkSource { +@@ -535,14 +540,18 @@ public class ServerChunkCache extends ChunkSource { } // Paper end - per player mob spawning backoff } @@ -1662,7 +1664,7 @@ index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..12f11576c41ded54f759da16f54f6d7b gameprofilerfiller.popPush("spawnAndTick"); boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit -@@ -632,8 +640,8 @@ public class ServerChunkCache extends ChunkSource { +@@ -632,8 +641,8 @@ public class ServerChunkCache extends ChunkSource { if (tick && chunk1.chunkStatus.isOrAfter(net.minecraft.server.level.FullChunkStatus.ENTITY_TICKING)) { // Paper end - optimise chunk tick iteration chunk1.incrementInhabitedTime(j); @@ -1673,11 +1675,11 @@ index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..12f11576c41ded54f759da16f54f6d7b } if (true || this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { // Paper - optimise chunk tick iteration -@@ -680,6 +688,40 @@ public class ServerChunkCache extends ChunkSource { +@@ -680,6 +689,40 @@ public class ServerChunkCache extends ChunkSource { gameprofilerfiller.pop(); gameprofilerfiller.pop(); } -+ ++ + // Pufferfish start - optimize mob spawning + if (gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncMobSpawning) { + for (ServerPlayer player : this.level.players) { @@ -1917,7 +1919,7 @@ index d6cbe98e67fdbf8db46338a88ab1356dd63b50a3..20dd3a63b2f955b05a75eb240e33ae4c int LARGE_MAX_STACK_SIZE = 64; int DEFAULT_DISTANCE_LIMIT = 8; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..f80a94eaa7d093a01cc4f349516b788d40d66e51 100644 +index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..00b26925b9e0ef7290f904273da875603b6ce11b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -308,7 +308,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1929,7 +1931,7 @@ index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..f80a94eaa7d093a01cc4f349516b788d private ChunkPos chunkPosition; private Vec3 deltaMovement; private float yRot; -@@ -501,6 +501,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -501,6 +501,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this)); } // Paper end - optimise entity tracking @@ -1938,10 +1940,11 @@ index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..f80a94eaa7d093a01cc4f349516b788d + public int activatedPriority = gg.pufferfish.pufferfish.PufferfishConfig.maximumActivationPrio; // golf score + public final BlockPos.MutableBlockPos cachedBlockPos = new BlockPos.MutableBlockPos(); // used where needed + // Pufferfish end ++ public float getBukkitYaw() { return this.yRot; } -@@ -807,6 +812,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -807,6 +813,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void tick() { @@ -1954,7 +1957,7 @@ index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..f80a94eaa7d093a01cc4f349516b788d this.baseTick(); } -@@ -4402,16 +4413,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4402,16 +4414,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean updateFluidHeightAndDoFluidPushing(TagKey tag, double speed) { @@ -1980,7 +1983,7 @@ index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..f80a94eaa7d093a01cc4f349516b788d double d1 = 0.0D; boolean flag = this.isPushedByFluid(); boolean flag1 = false; -@@ -4419,14 +4432,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4419,14 +4433,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S int k1 = 0; BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); @@ -2048,7 +2051,7 @@ index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..f80a94eaa7d093a01cc4f349516b788d if (d2 >= axisalignedbb.minY) { flag1 = true; -@@ -4448,9 +4508,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4448,9 +4509,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit end } } @@ -2698,18 +2701,34 @@ index 27b0a79f7a7c47047216aae42944bac2a2151181..a097cfc528f709c80575f35483b68783 autorecipestackmanager.initialize(this); // Paper - better exact choice recipes int i = 0; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index b33bb001a48788e727e2f01788a6163024121bf3..2bae36d00a830a2640960024818566bb9351424b 100644 +index b33bb001a48788e727e2f01788a6163024121bf3..763fe7d1e8334441a5db2285bd4424d165e1c945 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -211,6 +211,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - // Paper end - Use getChunkIfLoadedImmediately +@@ -212,6 +212,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); -+ -+ protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter ++ protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter ++ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot + this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config +@@ -1317,13 +1319,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + try { + tickConsumer.accept(entity); + MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick +- } catch (Throwable throwable) { ++ } catch (Throwable throwable) { // Pufferfish - diff on change ServerLevel.tick + if (throwable instanceof ThreadDeath) throw throwable; // Paper + // Paper start - Prevent block entity and entity crashes + 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); + getCraftServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent +- entity.discard(); ++ entity.discard(); // Pufferfish - diff on change ServerLevel.tick + // Paper end - Prevent block entity and entity crashes + } + } @@ -1797,6 +1799,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } @@ -3291,7 +3310,7 @@ index 96d772eb02f79f8c478f5e6f065e387aa7665b18..c5ce412f321b8b4f31cc042893659e21 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 509f8487a170f3dc84b091acf16df26e42391189..2338ba106c19c3e61d1a2088cc51d0744432666d 100644 +index 4e1390b9244aeb745ffd3fd1257bc74248722515..e04d721765648a2b5f5bf1f2053e344bfb92f0f4 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -482,7 +482,7 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0002-Purpur-Server-Changes.patch b/patches/server/0002-Purpur-Server-Changes.patch index 27ff9a3..f68565a 100644 --- a/patches/server/0002-Purpur-Server-Changes.patch +++ b/patches/server/0002-Purpur-Server-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny -Date: Tue, 23 Jan 2024 15:56:26 +0900 +Date: Fri, 26 Jan 2024 13:54:27 +0900 Subject: [PATCH] Purpur Server Changes PurpurMC @@ -329,16 +329,14 @@ index 59699c59fdfc611177fdb3136f84ab539b17d9c9..4819c043e193603581598c91d44d407a ignored.add("goal_selector_1"); ignored.add("goal_selector_2"); diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java -index 039a86034928a5eb7aaa2d7ca76a7bddcca346bd..28fc0a88d93fa78b0e037fe42e9f9d32aeea052b 100644 +index 039a86034928a5eb7aaa2d7ca76a7bddcca346bd..308f67d0616e2d6bb135258f1fda53ccdee01430 100644 --- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java +++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java -@@ -67,8 +67,8 @@ public class RAMDetails extends JList { - } +@@ -68,7 +68,7 @@ public class RAMDetails extends JList { vector.add("Memory use: " + (data.getUsedMem() / 1024L / 1024L) + " mb (" + (data.getFree() * 100L / data.getMax()) + "% free)"); vector.add("Heap: " + (data.getTotal() / 1024L / 1024L) + " / " + (data.getMax() / 1024L / 1024L) + " mb"); -- vector.add("Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / (double) TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms"); + vector.add("Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / (double) TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms"); - vector.add("TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg)); -+ vector.add("Avg tick: " + DECIMAL_FORMAT.format(this.getAverage(server.getTickTimesNanos())) + " ms"); + vector.add("TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg)); // Purpur setListData(vector); } @@ -1096,21 +1094,21 @@ index 9ec6145fe04ec64bbee8ec6a837719caebdbc6f5..358d610ad020cada1bb83e393deeeaae public ClientboundSetTimePacket(long time, long timeOfDay, boolean doDaylightCycle) { this.gameTime = time; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b1671cb6275369efe3e643bce40a3fd7318a6fa0..1b04d3f93b7fbe5c08f5063e64761a254ede45b5 100644 +index 5b6771cc925d29c26ea0cfcf0f72184f96e3eade..2b53c6fb21b08f04c378278f1a5e78e1e4b276d7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -293,6 +293,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -302,11 +303,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; -@@ -1541,20 +1567,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { entityplayer.connection.suspendFlushing(); }); @@ -1369,7 +1368,7 @@ index b1671cb6275369efe3e643bce40a3fd7318a6fa0..1b04d3f93b7fbe5c08f5063e64761a25 // Paper start - Folia scheduler API ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); getAllLevels().forEach(level -> { -@@ -1652,22 +1678,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent @@ -1458,7 +1457,7 @@ index b1671cb6275369efe3e643bce40a3fd7318a6fa0..1b04d3f93b7fbe5c08f5063e64761a25 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world"); -@@ -1727,33 +1755,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return org.purpurmc.purpur.PurpurConfig.serverModName; // Purpur - Purpur > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! +- return "Pufferfish"; // Pufferfish - Pufferfish > // Paper ++ return org.purpurmc.purpur.PurpurConfig.serverModName; // Purpur - Purpur > // Pufferfish - Pufferfish > // Paper } public SystemReport fillSystemReport(SystemReport details) { -@@ -2444,7 +2472,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.executeBlocking(() -> { this.saveDebugReport(path.resolve("server")); -@@ -2694,40 +2722,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create, true); // Paper ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor; -@@ -280,10 +280,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -281,10 +281,10 @@ public class ServerChunkCache extends ChunkSource { if (!completablefuture.isDone()) { // Paper io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads @@ -2136,7 +2148,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 } // Paper ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; -@@ -432,17 +432,17 @@ public class ServerChunkCache extends ChunkSource { +@@ -433,17 +433,17 @@ public class ServerChunkCache extends ChunkSource { public void save(boolean flush) { this.runDistanceManagerUpdates(); @@ -2158,7 +2170,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 } // Paper end - Incremental chunk and player saving -@@ -466,37 +466,37 @@ public class ServerChunkCache extends ChunkSource { +@@ -467,37 +467,37 @@ public class ServerChunkCache extends ChunkSource { // CraftBukkit start - modelled on below public void purgeUnload() { if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system @@ -2209,7 +2221,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 this.clearCache(); } -@@ -506,19 +506,19 @@ public class ServerChunkCache extends ChunkSource { +@@ -507,19 +507,19 @@ public class ServerChunkCache extends ChunkSource { this.lastInhabitedUpdate = i; if (!this.level.isDebug()) { @@ -2235,7 +2247,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 int k = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - Optional per player mob spawns int naturalSpawnChunkCount = k; -@@ -548,10 +548,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -549,10 +549,10 @@ public class ServerChunkCache extends ChunkSource { // Pufferfish end } // Paper end - Optional per player mob spawns @@ -2248,7 +2260,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit // Paper start - optimise chunk tick iteration -@@ -657,19 +657,19 @@ public class ServerChunkCache extends ChunkSource { +@@ -658,19 +658,19 @@ public class ServerChunkCache extends ChunkSource { } } // Paper end - optimise chunk tick iteration @@ -2274,7 +2286,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 // Paper start - optimise chunk tick iteration if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) { it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet copy = this.chunkMap.needsChangeBroadcasting.clone(); -@@ -683,12 +683,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -684,10 +684,10 @@ public class ServerChunkCache extends ChunkSource { } } // Paper end - optimise chunk tick iteration @@ -2286,12 +2298,9 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.pop(); // Purpur } -- -+ + // Pufferfish start - optimize mob spawning - if (gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncMobSpawning) { - for (ServerPlayer player : this.level.players) { -@@ -892,7 +892,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -893,7 +893,7 @@ public class ServerChunkCache extends ChunkSource { @Override protected void doRunTask(Runnable task) { @@ -2301,7 +2310,7 @@ index 12f11576c41ded54f759da16f54f6d7b460c10ed..658aa2d0e206b050640aded489568416 } diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index db55ad9aaabfa1ea998754f3ac352d1698936696..e13b241780df35790ce20445f48eb51e4ed0ad11 100644 +index db55ad9aaabfa1ea998754f3ac352d1698936696..04b98e23eed926d8473cc2464e04a5b9f18f1140 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -73,7 +73,7 @@ public class ServerEntity { @@ -2309,7 +2318,7 @@ index db55ad9aaabfa1ea998754f3ac352d1698936696..e13b241780df35790ce20445f48eb51e private List> trackedDataValues; // CraftBukkit start - private final Set trackedPlayers; -+ public final Set trackedPlayers; // Purpur - private -> public ++ public final Set trackedPlayers; // Purpur - private -> public public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { this.trackedPlayers = trackedPlayers; @@ -3591,17 +3600,17 @@ index 9ddbfcf80d9a381dace78a62880f85a4d767e0eb..7383c7d3820dce06108eaafd236a7c6c } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index e0ee45036b9bf14a6e2013fe291cde0402b85b1f..c103f734ac8f4a58990a33cfefd8066b798a603e 100644 +index e0ee45036b9bf14a6e2013fe291cde0402b85b1f..b230739cf929c8f2b51a812fffe54be343ce3e05 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -479,6 +479,7 @@ public abstract class PlayerList { - // Paper end - Fire PlayerJoinEvent when Player is actually ready - player.initInventoryMenu(); - // CraftBukkit - Moved from above, added world +@@ -486,6 +486,7 @@ public abstract class PlayerList { + scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); + } + // Paper end - Configurable player collision + org.purpurmc.purpur.task.BossBarTask.addToAll(player); // Purpur - // Paper start - Configurable player collision; Add to collideRule team if needed - final net.minecraft.world.scores.Scoreboard scoreboard = this.getServer().getLevel(Level.OVERWORLD).getScoreboard(); - final PlayerTeam collideRuleTeam = scoreboard.getPlayerTeam(this.collideRuleTeamName); + PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); + } + @@ -598,6 +599,7 @@ public abstract class PlayerList { } public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) { @@ -4231,7 +4240,7 @@ index 1f9e0c139988c4c44a26552881647d36965aa4fa..b8d612d22aca74a08b53393c0723a2ae @Override diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901add38644 100644 +index 00b26925b9e0ef7290f904273da875603b6ce11b..e3322c3263280a8e206af7a84db3518ef0916439 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -159,7 +159,7 @@ import org.bukkit.plugin.PluginManager; @@ -4269,7 +4278,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -559,6 +560,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -560,6 +561,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return false; } @@ -4295,7 +4304,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 public final boolean hardCollides() { return this.hardCollides; } -@@ -579,7 +599,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -580,7 +600,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.bb = Entity.INITIAL_AABB; this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; @@ -4304,7 +4313,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 this.remainingFireTicks = -this.getFireImmuneTicks(); this.fluidHeight = new Object2DoubleArrayMap(2); this.fluidOnEyes = new HashSet(); -@@ -831,7 +851,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -832,7 +852,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit end public void baseTick() { @@ -4313,7 +4322,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups this.feetBlockState = null; if (this.isPassenger() && this.getVehicle().isRemoved()) { -@@ -892,7 +912,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -893,7 +913,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } this.firstTick = false; @@ -4322,7 +4331,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } public void setSharedFlagOnFire(boolean onFire) { -@@ -901,10 +921,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -902,10 +922,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void checkBelowWorld() { // Paper start - Configurable nether ceiling damage @@ -4335,7 +4344,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 this.onBelowWorld(); } -@@ -1112,7 +1133,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1113,7 +1134,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } @@ -4344,7 +4353,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) { movement = movement.multiply(this.stuckSpeedMultiplier); this.stuckSpeedMultiplier = Vec3.ZERO; -@@ -1121,7 +1142,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1122,7 +1143,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // Paper start - ignore movement changes while inactive. if (isTemporarilyActive && !(this instanceof ItemEntity || this instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) && movement == getDeltaMovement() && movementType == MoverType.SELF) { setDeltaMovement(Vec3.ZERO); @@ -4353,7 +4362,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 return; } // Paper end -@@ -1142,8 +1163,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1143,8 +1164,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z); } @@ -4364,7 +4373,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 boolean flag = !Mth.equal(movement.x, vec3d1.x); boolean flag1 = !Mth.equal(movement.z, vec3d1.z); -@@ -1162,7 +1183,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1163,7 +1184,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.checkFallDamage(vec3d1.y, this.onGround(), iblockdata, blockposition); if (this.isRemoved()) { @@ -4373,7 +4382,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } else { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); -@@ -1300,7 +1321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1301,7 +1322,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setRemainingFireTicks(-this.getFireImmuneTicks()); } @@ -4382,7 +4391,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } } // Paper start - detailed watchdog information -@@ -1798,7 +1819,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1799,7 +1820,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean fireImmune() { @@ -4391,7 +4400,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { -@@ -1871,7 +1892,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1872,7 +1893,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.isInWater() || flag; } @@ -4400,7 +4409,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 Entity entity = this.getVehicle(); if (entity instanceof Boat) { -@@ -2487,6 +2508,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2488,6 +2509,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S nbttagcompound.putBoolean("Paper.FreezeLock", true); } // Paper end @@ -4412,7 +4421,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2634,6 +2660,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2635,6 +2661,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S freezeLocked = nbt.getBoolean("Paper.FreezeLock"); } // Paper end @@ -4424,7 +4433,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); -@@ -3009,6 +3040,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3010,6 +3041,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.passengers = ImmutableList.copyOf(list); } @@ -4438,7 +4447,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 this.gameEvent(GameEvent.ENTITY_MOUNT, passenger); } } -@@ -3048,6 +3086,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3049,6 +3087,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return false; } // CraftBukkit end @@ -4453,7 +4462,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { this.passengers = ImmutableList.of(); } else { -@@ -3127,12 +3173,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3128,12 +3174,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return Vec3.directionFromRotation(this.getRotationVector()); } @@ -4470,7 +4479,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } this.isInsidePortal = true; -@@ -3150,7 +3199,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3151,7 +3200,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey); if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit @@ -4479,7 +4488,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 this.portalTime = i; // Paper start - Add EntityPortalReadyEvent io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER); -@@ -3168,7 +3217,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3169,7 +3218,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } // Paper - Add EntityPortalReadyEvent // CraftBukkit end @@ -4488,7 +4497,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } this.isInsidePortal = false; -@@ -3183,7 +3232,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3184,7 +3233,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } this.processPortalCooldown(); @@ -4497,7 +4506,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } } -@@ -3373,7 +3422,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3374,7 +3423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public int getMaxAirSupply() { @@ -4506,7 +4515,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } public int getAirSupply() { -@@ -3643,14 +3692,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3644,14 +3693,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end - Fix item duplication and teleport issues if (this.level() instanceof ServerLevel && !this.isRemoved()) { @@ -4523,7 +4532,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit if (shapedetectorshape == null) { -@@ -3689,7 +3738,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3690,7 +3739,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.unRide(); // CraftBukkit end @@ -4532,7 +4541,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 // Paper start - Fix item duplication and teleport issues if (this instanceof Mob) { ((Mob) this).dropLeash(true, true); // Paper drop lead -@@ -3716,10 +3765,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3717,10 +3766,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } this.removeAfterChangingDimensions(); @@ -4545,7 +4554,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 return entity; } } else { -@@ -3837,7 +3886,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3838,7 +3887,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean canChangeDimensions() { @@ -4554,7 +4563,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 } public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { -@@ -4135,6 +4184,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4136,6 +4185,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return SlotAccess.NULL; } @@ -4575,7 +4584,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 @Override public void sendSystemMessage(Component message) {} -@@ -4412,6 +4475,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4413,6 +4476,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.yRotO = this.getYRot(); } @@ -4588,7 +4597,7 @@ index f80a94eaa7d093a01cc4f349516b788d40d66e51..453828b2239b82f99b3bd837b354c901 public boolean updateFluidHeightAndDoFluidPushing(TagKey tag, double speed) { if (false && this.touchingUnloadedChunk()) { // Pufferfish - cost of a lookup here is the same cost as below, so skip return false; -@@ -4972,4 +5041,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4973,4 +5042,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this); } // Paper end - Expose entity id counter @@ -15066,7 +15075,7 @@ index 5f407535298a31a34cfe114dd863fd6a9b977707..29c7e33fe961020e5a0007287fe9b663 } diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163fd99bf2c5 100644 +index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..18f92478f07de7c941ff8bbe0ec2ef2fe3617fd7 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -141,6 +141,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -15078,7 +15087,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f public long nextGolemPanic = -1; // Pufferfish -@@ -155,6 +157,90 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -155,6 +157,91 @@ public class Villager extends AbstractVillager implements ReputationEventHandler this.getNavigation().setCanFloat(true); this.setCanPickUpLoot(true); this.setVillagerData(this.getVillagerData().setType(type).setProfession(VillagerProfession.NONE)); @@ -15129,13 +15138,14 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f + + private boolean checkLobotomized() { + int interval = this.level().purpurConfig.villagerLobotomizeCheckInterval; ++ boolean shouldCheckForTradeLocked = this.level().purpurConfig.villagerLobotomizeWaitUntilTradeLocked; + if (this.notLobotomizedCount > 3) { + // check half as often if not lobotomized for the last 3+ consecutive checks + interval *= 2; + } + if (this.level().getGameTime() % interval == 0) { + // offset Y for short blocks like dirt_path/farmland -+ this.isLobotomized = !canTravelFrom(BlockPos.containing(this.position().x, this.getBoundingBox().minY + 0.0625D, this.position().z)); ++ this.isLobotomized = !(shouldCheckForTradeLocked && this.getVillagerXp() == 0) && !canTravelFrom(BlockPos.containing(this.position().x, this.getBoundingBox().minY + 0.0625D, this.position().z)); + + if (this.isLobotomized) { + this.notLobotomizedCount = 0; @@ -15169,7 +15179,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f } @Override -@@ -191,7 +277,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -191,7 +278,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler brain.addActivity(Activity.PLAY, VillagerGoalPackages.getPlayPackage(0.5F)); } else { brain.setSchedule(Schedule.VILLAGER_DEFAULT); @@ -15178,7 +15188,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f } brain.addActivity(Activity.CORE, VillagerGoalPackages.getCorePackage(villagerprofession, 0.5F)); -@@ -254,15 +340,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -254,15 +341,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler // Paper start this.customServerAiStep(false); } @@ -15207,7 +15217,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f if (this.assignProfessionWhenSpawned) { this.assignProfessionWhenSpawned = false; } -@@ -318,7 +410,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -318,7 +411,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler if (!itemstack.is(Items.VILLAGER_SPAWN_EGG) && this.isAlive() && !this.isTrading() && !this.isSleeping()) { if (this.isBaby()) { this.setUnhappy(); @@ -15216,7 +15226,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f } else { boolean flag = this.getOffers().isEmpty(); -@@ -331,9 +423,10 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -331,9 +424,10 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } if (flag) { @@ -15229,7 +15239,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f this.startTrading(player); } -@@ -502,7 +595,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -502,7 +596,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator.hasNext()) { MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); @@ -15238,7 +15248,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f } } -@@ -752,7 +845,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -752,7 +846,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public boolean canBreed() { @@ -15247,7 +15257,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f } private boolean hungry() { -@@ -945,6 +1038,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -945,6 +1039,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler public boolean hasFarmSeeds() { return this.getInventory().hasAnyMatching((itemstack) -> { @@ -15259,7 +15269,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f return itemstack.is(ItemTags.VILLAGER_PLANTABLE_SEEDS); }); } -@@ -1002,6 +1100,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1002,6 +1101,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } public void spawnGolemIfNeeded(ServerLevel world, long time, int requiredCount) { @@ -15267,7 +15277,7 @@ index b1fa6e102a694b63f2aa9660b9e6b649bcae9a7d..795a91cf05dc4f5fba84eaa501e8163f if (this.wantsToSpawnGolem(time)) { AABB axisalignedbb = this.getBoundingBox().inflate(10.0D, 10.0D, 10.0D); List list = world.getEntitiesOfClass(Villager.class, axisalignedbb); -@@ -1066,6 +1165,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1066,6 +1166,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public void startSleeping(BlockPos pos) { @@ -17443,7 +17453,7 @@ index 28ef910885dbd48965fba6f08cec412697b1b7f0..9c62187b9c716c49db4bb39781df1bfb if (this.fire) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 2bae36d00a830a2640960024818566bb9351424b..f0ed437afcc175fbf6fac939265300cdf884b8cb 100644 +index 763fe7d1e8334441a5db2285bd4424d165e1c945..4779fd92a88c3d485ab3282ab63158f0894f7896 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -178,6 +178,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -17504,13 +17514,11 @@ index 2bae36d00a830a2640960024818566bb9351424b..f0ed437afcc175fbf6fac939265300cd public CraftWorld getWorld() { return this.world; } -@@ -211,12 +255,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - // Paper end - Use getChunkIfLoadedImmediately +@@ -212,11 +256,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); -- + - protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter -+ + //protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor @@ -20385,10 +20393,10 @@ index 5b01cd1b9a07fc8600fddb9d9e0aea3ac5a288f0..7db5fb71e8ffdc9291eadceb2682f7f9 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b27e965005b64c817588b75d467913c27ab1e31b..7a2e6d1c4b1d553c172f7d704036e3dfb39228a7 100644 +index a139601888b88e8580bdb9c2469386a94abae975..9f2d1e3bc19ef541550e4d088343d10ea641cd23 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2373,6 +2373,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2375,6 +2375,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight()); } @@ -21399,7 +21407,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c // Paper end - add timings for scoreboard search } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 2338ba106c19c3e61d1a2088cc51d0744432666d..2331190c476a2bfe3797aa61a4a792a9cc42ff59 100644 +index e04d721765648a2b5f5bf1f2053e344bfb92f0f4..fda1016052dfbedcc5486d716fa2fb13d14af2df 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -482,7 +482,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -22108,10 +22116,10 @@ index 0000000000000000000000000000000000000000..e9fc2b4661f5275b93db5d3fdf25a8bd +} diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..dab252cbadffbcdf19bacc0b378d671b29393e9c +index 0000000000000000000000000000000000000000..a78173ac1a8a71048bd6dbad84c0163e51cd150f --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -0,0 +1,3302 @@ +@@ -0,0 +1,3304 @@ +package org.purpurmc.purpur; + +import net.minecraft.core.registries.BuiltInRegistries; @@ -25010,6 +25018,7 @@ index 0000000000000000000000000000000000000000..dab252cbadffbcdf19bacc0b378d671b + public int villagerMinimumDemand = 0; + public boolean villagerLobotomizeEnabled = false; + public int villagerLobotomizeCheckInterval = 100; ++ public boolean villagerLobotomizeWaitUntilTradeLocked = false; + public boolean villagerDisplayTradeItem = true; + public int villagerSpawnIronGolemRadius = 0; + public int villagerSpawnIronGolemLimit = 0; @@ -25045,6 +25054,7 @@ index 0000000000000000000000000000000000000000..dab252cbadffbcdf19bacc0b378d671b + } + villagerLobotomizeEnabled = getBoolean("mobs.villager.lobotomize.enabled", villagerLobotomizeEnabled); + villagerLobotomizeCheckInterval = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval); ++ villagerLobotomizeWaitUntilTradeLocked = getBoolean("mobs.villager.lobotomize.wait-until-trade-locked", villagerLobotomizeWaitUntilTradeLocked); + villagerDisplayTradeItem = getBoolean("mobs.villager.display-trade-item", villagerDisplayTradeItem); + villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius); + villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit); @@ -27727,7 +27737,7 @@ index 41cddf7e42f0e8f80973e482a95e55d3bd19f659..2e9aed328e576abbe216fdb2071c1342 if ( entity instanceof FireworkRocketEntity ) { return true; diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java -index 9eb2823cc8f83bad2626fc77578b0162d9ed5782..5da1ef6d90c6a5bd047e971bcc56d786239c6fd8 100644 +index 9eb2823cc8f83bad2626fc77578b0162d9ed5782..f144a08e88f8268b84eb188a36bf470457f59958 100644 --- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java +++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java @@ -39,7 +39,7 @@ public class TicksPerSecondCommand extends Command @@ -27735,7 +27745,7 @@ index 9eb2823cc8f83bad2626fc77578b0162d9ed5782..5da1ef6d90c6a5bd047e971bcc56d786 net.kyori.adventure.text.TextComponent.Builder builder = net.kyori.adventure.text.Component.text(); - builder.append(net.kyori.adventure.text.Component.text("TPS from last 1m, 5m, 15m: ", net.kyori.adventure.text.format.NamedTextColor.GOLD)); -+ builder.append(net.kyori.adventure.text.Component.text("TPS from last 5s, 1m, 5m, 15m: ", net.kyori.adventure.text.format.NamedTextColor.GOLD)); ++ builder.append(net.kyori.adventure.text.Component.text("TPS from last 5s, 1m, 5m, 15m: ", net.kyori.adventure.text.format.NamedTextColor.GOLD)); // Purpur builder.append(net.kyori.adventure.text.Component.join(net.kyori.adventure.text.JoinConfiguration.commas(true), tpsAvg)); sender.sendMessage(builder.asComponent()); if (args.length > 0 && args[0].equals("mem") && sender.hasPermission("bukkit.command.tpsmemory")) { diff --git a/patches/server/0005-Rebrand.patch b/patches/server/0005-Rebrand.patch index a09a3aa..537346b 100644 --- a/patches/server/0005-Rebrand.patch +++ b/patches/server/0005-Rebrand.patch @@ -176,10 +176,10 @@ index 61840cfd64caba6595dfc99c91c76a195638d4ee..b94f711b8bd56d159745b59f8b842d19 if (Boolean.getBoolean("Paper.isRunDev")) { net.minecraft.server.packs.VanillaPackResourcesBuilder.developmentConfig = builder -> { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1b04d3f93b7fbe5c08f5063e64761a254ede45b5..9b356fee4f2d858b86356017760ad6d13a9de727 100644 +index 2b53c6fb21b08f04c378278f1a5e78e1e4b276d7..bdb69f65757ed32ef2cd55fd7afd7fc281373797 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -955,7 +955,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> trackedDataValues; // CraftBukkit start - public final Set trackedPlayers; // Purpur - private -> public + public final Set trackedPlayers; // Purpur - private -> public + public static boolean skipSqrWhenNoDeltaChanges = false; // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { diff --git a/patches/server/0012-Optimize-default-configurations.patch b/patches/server/0012-Optimize-default-configurations.patch index d81b0a3..831f4f4 100644 --- a/patches/server/0012-Optimize-default-configurations.patch +++ b/patches/server/0012-Optimize-default-configurations.patch @@ -437,7 +437,7 @@ index c65f68359edfc01bca2c9fd98812d69346631746..bdc0377822ee29abd941b2ac47adaa9b private static void networkSettings() { useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index dab252cbadffbcdf19bacc0b378d671b29393e9c..fde8e2f6c58a2e36dab4cfbc2b1a13f3d7177195 100644 +index a78173ac1a8a71048bd6dbad84c0163e51cd150f..394ef5df7b1b56369d97c7cb36bc2440edac1a2f 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -425,7 +425,7 @@ public class PurpurWorldConfig { @@ -449,7 +449,7 @@ index dab252cbadffbcdf19bacc0b378d671b29393e9c..fde8e2f6c58a2e36dab4cfbc2b1a13f3 public boolean teleportOnNetherCeilingDamage = false; public boolean totemOfUndyingWorksInInventory = false; public boolean playerFixStuckPortal = false; -@@ -3131,7 +3131,7 @@ public class PurpurWorldConfig { +@@ -3133,7 +3133,7 @@ public class PurpurWorldConfig { public boolean zombieJockeyOnlyBaby = true; public double zombieJockeyChance = 0.05D; public boolean zombieJockeyTryExistingChickens = true; diff --git a/patches/server/0014-Add-missing-purpur-configuration-options.patch b/patches/server/0014-Add-missing-purpur-configuration-options.patch index 9ad65d0..298508f 100644 --- a/patches/server/0014-Add-missing-purpur-configuration-options.patch +++ b/patches/server/0014-Add-missing-purpur-configuration-options.patch @@ -205,7 +205,7 @@ index bdc0377822ee29abd941b2ac47adaa9b5a4a3770..8d7bc4bb2bc28e962e300232eb5c6f41 org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27); enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index fde8e2f6c58a2e36dab4cfbc2b1a13f3d7177195..39540b37592c7a9d2200b77aeff12887d7fee7fe 100644 +index 394ef5df7b1b56369d97c7cb36bc2440edac1a2f..7ee419c39fe8295ef21993d621699573b80427cc 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -1180,7 +1180,15 @@ public class PurpurWorldConfig { @@ -286,7 +286,7 @@ index fde8e2f6c58a2e36dab4cfbc2b1a13f3d7177195..39540b37592c7a9d2200b77aeff12887 tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable); tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater); tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable); -@@ -2987,7 +3025,15 @@ public class PurpurWorldConfig { +@@ -2989,7 +3027,15 @@ public class PurpurWorldConfig { public boolean wardenRidable = false; public boolean wardenRidableInWater = true; public boolean wardenControllable = true; diff --git a/patches/server/0016-Completely-remove-Mojang-Profiler.patch b/patches/server/0016-Completely-remove-Mojang-Profiler.patch index 2d9eeaf..eb6d6ae 100644 --- a/patches/server/0016-Completely-remove-Mojang-Profiler.patch +++ b/patches/server/0016-Completely-remove-Mojang-Profiler.patch @@ -65,7 +65,7 @@ index 38854a047c6da7e2551f206478d17628e765168d..c989f0ddca966cb522fca68734baa5cc public int forkLimit() { return this.forkLimit; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 791e958f2277d277ed50a9c94e94e99d29e5d90a..91264d763a28f5ddeb2096be7a73ed091dcc6def 100644 +index 3815df35f3cabbe0f238f4333d908c8fe8ee1078..a801db24aaa6b16e16831147129dc7020127794d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -113,16 +113,18 @@ import net.minecraft.util.Unit; @@ -103,7 +103,7 @@ index 791e958f2277d277ed50a9c94e94e99d29e5d90a..91264d763a28f5ddeb2096be7a73ed09 @Nullable private MinecraftServer.TimeProfiler debugCommandProfiler; private boolean debugCommandProfilerDelayStart; -@@ -2482,10 +2486,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2748,12 +2755,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resultConsumer, Consumer dumpConsumer) { @@ -139,7 +139,7 @@ index 791e958f2277d277ed50a9c94e94e99d29e5d90a..91264d763a28f5ddeb2096be7a73ed09 } public void stopRecordingMetrics() { -@@ -2768,6 +2775,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, Object2ObjectLinkedOpenHashMap>> map1 = Maps.newHashMap(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 04a9ee3eb58afcb328302cb202684af911a1f540..ac16b4aefc4bcc95aa9ac10a354a6a3a912842e7 100644 +index 93ba0cef1d55b2ded2cb4bdf0518c976ca92bf8d..dec7350a665af5dd7077629a2a573e9becd8419a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -41,7 +41,7 @@ import net.minecraft.sounds.SoundSource; diff --git a/patches/server/0019-Apply-various-optimizations.patch b/patches/server/0019-Apply-various-optimizations.patch index d11e6cb..6c67bf8 100644 --- a/patches/server/0019-Apply-various-optimizations.patch +++ b/patches/server/0019-Apply-various-optimizations.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Apply various optimizations Akarin - Swaps the predicate order of collision diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 453828b2239b82f99b3bd837b354c901add38644..a3db8a329fe30b63704c068223684492e9d30e9c 100644 +index e3322c3263280a8e206af7a84db3518ef0916439..dc0d312a41e80a757e58168005cda60ae7351d3e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2144,8 +2144,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2145,8 +2145,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void playerTouch(Player player) {} public void push(Entity entity) { @@ -21,7 +21,7 @@ index 453828b2239b82f99b3bd837b354c901add38644..a3db8a329fe30b63704c068223684492 if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant double d0 = entity.getX() - this.getX(); double d1 = entity.getZ() - this.getZ(); -@@ -2173,8 +2174,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2174,8 +2175,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S entity.push(d0, 0.0D, d1); } } diff --git a/patches/server/0035-Reduce-allocations.patch b/patches/server/0035-Reduce-allocations.patch index 802672a..0db58e3 100644 --- a/patches/server/0035-Reduce-allocations.patch +++ b/patches/server/0035-Reduce-allocations.patch @@ -411,10 +411,10 @@ index ccdc2345465313991f065e1176b58fb7d5e8722f..bb50e69a4d84e4753db77be071cc6fc7 // Paper end - Multi Block Change API diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f5c5a6d32074bf737dc4876afb6ba13b3fb03a7d..db84a32edf006ee61f716de673de34b1890fc837 100644 +index 2ab66feae898d7316e8a5d0a3103d462e93c81b6..6ad66f23c80181bb8e6da0e1d07f3acf22f82847 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1500,13 +1500,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop loadStatusIcon() { @@ -558,7 +558,7 @@ index 8757db8c7f9dc4fbdaf2324f6da639cbf1514b5d..3a995fb30a00b313d9b4de52ad11eac5 ServerConfigurationPacketListenerImpl serverconfigurationpacketlistenerimpl = new ServerConfigurationPacketListenerImpl(this.server, this.connection, commonlistenercookie, this.player); // CraftBukkit diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d8b0f270369e28da1226cd2ad4480dea3f347593..796d51bd84fea602d94df1c849f81e7b1efc81e8 100644 +index c9e1f0d3dce8c0124f100818dab054ca728b341a..71c49f7458a1b54cda9a7e07162de981e7a53bb2 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -715,7 +715,7 @@ public abstract class PlayerList {