diff --git a/README.md b/README.md index 15089ade..7f16a9eb 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ > [!WARNING] -> Leaf is a performance-oriented fork. Make sure to take backups **before** switching to it. Everyone is welcome to contribute optimizations or report issues to help us improve. +> Current Leaf 1.21.9 is a temp branch which is isolated from the 1.21.8 branch. \ +> Update Paper upstream will be done every month, and will not receive fixes from Leaf 1.21.8, until Leaf 1.21.8 becomes stable again. \ +> It's only for people want to try or test 1.21.9, **DO NOT** use in production! **English** | [中文](public/readme/README_CN.md) diff --git a/leaf-server/minecraft-patches/features/0001-Rebrand.patch b/leaf-server/minecraft-patches/features/0001-Rebrand.patch index 254db63b..8ddaa439 100644 --- a/leaf-server/minecraft-patches/features/0001-Rebrand.patch +++ b/leaf-server/minecraft-patches/features/0001-Rebrand.patch @@ -48,10 +48,10 @@ index bb021fc9de91f8c4f79e6a753d57fa157efbbda7..9926848124f0b74ebb615fbbc45d95eb final DamageSource damageSource = this.copy(); damageSource.eventEntityDamager = entity; diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 384f2cd090d6d23bd1308d6e82c24338f2bf55d1..3634d68c77ee99567b51a9a848d7cbbb218a0ba7 100644 +index 8ea830f561f5b7d6ff6ca3c38adc7fe8e54e4cc7..55c329b758f53cb292f130723a167e6c2142a4f5 100644 --- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -308,7 +308,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise +@@ -309,7 +309,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise // Paper start private static void printOversizedLog(String msg, Path file, int x, int z) { diff --git a/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch b/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch index 6337923d..18674754 100644 --- a/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch +++ b/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch @@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index d6dcb6d146d89a8fb96e7c669e5deb802223abd6..84f4f0c87f904a31f3f972e9fb1da8a01474dfca 100644 +index 7d3d12f10bab86ac77caf1a4369cfcb65df91bf3..adce3c9357e555ae1fcce45a15c7602e8b5ebc20 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation -@@ -471,6 +472,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), dispatcher); // Paper - create paper world configs; Async-Anti-Xray: Pass executor -+ super(serverLevelData, dimension, server.registryAccess(), levelStem.type(), false, isDebug, biomeZoomSeed, server.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), spigotConfig -> server.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), dispatcher); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration - this.pvpMode = server.isPvpAllowed(); - this.levelStorageAccess = levelStorageAccess; +- super(levelData, dimension, server.registryAccess(), levelStem.type(), false, isDebug, biomeZoomSeed, server.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(storageSource.levelDirectory.path(), levelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), levelData.getGameRules())), dispatcher); // Paper - create paper world configsAsync-Anti-Xray: Pass executor ++ super(levelData, dimension, server.registryAccess(), levelStem.type(), false, isDebug, biomeZoomSeed, server.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(storageSource.levelDirectory.path(), levelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), levelData.getGameRules())), spigotConfig -> server.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(storageSource.levelDirectory.path(), levelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), levelData.getGameRules())), dispatcher); // Paper - create paper world configsAsync-Anti-Xray: Pass executor // Gale - Gale configuration + this.levelStorageAccess = storageSource; this.uuid = org.bukkit.craftbukkit.util.WorldUUID.getOrCreate(levelStorageAccess.levelDirectory.path().toFile()); + this.levelLoadListener = new net.minecraft.server.level.progress.LoggingLevelLoadListener(false, this); diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index c41df4b1fff1f65532256e835dc30fadbb4f8c8b..4b96e512905aca3b69408145054c0658ee932eed 100644 +index a0cc94561c77b5e20b9dcee3190fe26cdaf55036..65a1ef05643f5eb65bb0b815c3975579c7374dcd 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -159,6 +159,12 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -164,6 +164,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl return this.paperConfig; } // Paper end - add paper world config @@ -122,7 +123,7 @@ index c41df4b1fff1f65532256e835dc30fadbb4f8c8b..4b96e512905aca3b69408145054c0658 public static @Nullable BlockPos lastPhysicsProblem; // Spigot private int tileTickPosition; -@@ -827,6 +833,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -832,6 +838,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl org.bukkit.World.Environment environment, // Paper java.util.function.Function paperWorldConfigCreator, // Paper - create paper world config @@ -131,7 +132,7 @@ index c41df4b1fff1f65532256e835dc30fadbb4f8c8b..4b96e512905aca3b69408145054c0658 java.util.concurrent.Executor executor // Paper - Anti-Xray ) { // Paper start - getblock optimisations - cache world height/sections -@@ -840,6 +848,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -845,6 +853,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Paper end - getblock optimisations - cache world height/sections this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config diff --git a/leaf-server/minecraft-patches/features/0003-Leaf-config.patch b/leaf-server/minecraft-patches/features/0003-Leaf-config.patch index 75ae390b..a6c4a8c9 100644 --- a/leaf-server/minecraft-patches/features/0003-Leaf-config.patch +++ b/leaf-server/minecraft-patches/features/0003-Leaf-config.patch @@ -13,10 +13,10 @@ Update config reload: (Or sync reload) diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java -index fd3553bdc1c3cdbf6aa3dc00e0a4987f8eaa4fb8..b16f3f515a76ddbbd74d73464396cf094cb30599 100644 +index 8d299a75c80fddc61a2aa4dc5b0dc5948aef5a0d..307187a16a3a5219b432237845f9cf6c4a6f897d 100644 --- a/net/minecraft/server/Main.java +++ b/net/minecraft/server/Main.java -@@ -109,10 +109,12 @@ public class Main { +@@ -107,10 +107,12 @@ public class Main { JvmProfiler.INSTANCE.start(Environment.SERVER); } @@ -30,10 +30,10 @@ index fd3553bdc1c3cdbf6aa3dc00e0a4987f8eaa4fb8..b16f3f515a76ddbbd74d73464396cf09 DedicatedServerSettings dedicatedServerSettings = new DedicatedServerSettings(optionSet); // CraftBukkit - CLI argument support dedicatedServerSettings.forceSave(); diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index b737c4a6ae23342d71efeec99bee61eee1f1a67d..a795aa7a812a1773ba76d03ab8dba6e9b1ecf298 100644 +index adce3c9357e555ae1fcce45a15c7602e8b5ebc20..a43a0ecdc073ef1d8544f8e8cf8cf9146de89c51 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -1186,6 +1186,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop contextChain = finishParsing(parseResults, command, commandSourceStack); try { -@@ -387,8 +383,6 @@ public class Commands { +@@ -394,8 +390,6 @@ public class Commands { commandSourceStack.sendFailure(Component.literal(Util.describeError(var12))); LOGGER.error("'/{}' threw an exception", command, var12); } @@ -81,7 +81,7 @@ index ec1cced129ef42be65d7b2b622638bfae8bd895e..f6017445c495c65fc71b10d2a8ed4f5d } } -@@ -445,7 +439,7 @@ public class Commands { +@@ -452,7 +446,7 @@ public class Commands { int max = Math.max(1, server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_CHAIN_LENGTH)); int _int = server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT); @@ -169,11 +169,11 @@ index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..e30bb9c4046200c1a6e4e917d15b205f } } diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index a795aa7a812a1773ba76d03ab8dba6e9b1ecf298..d3cf7176903bede5c8c7a7e3dae3f585027f8354 100644 +index a43a0ecdc073ef1d8544f8e8cf8cf9146de89c51..e7226c5056a493126d28a38416ffa909304aa9be 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -114,19 +114,8 @@ import net.minecraft.util.TimeUtil; - import net.minecraft.util.debugchart.RemoteDebugSampleType; +@@ -117,20 +117,9 @@ import net.minecraft.util.TimeUtil; + import net.minecraft.util.debug.ServerDebugSubscribers; import net.minecraft.util.debugchart.SampleLogger; import net.minecraft.util.debugchart.TpsDebugDimensions; -import net.minecraft.util.profiling.EmptyProfileResults; @@ -182,6 +182,7 @@ index a795aa7a812a1773ba76d03ab8dba6e9b1ecf298..d3cf7176903bede5c8c7a7e3dae3f585 -import net.minecraft.util.profiling.ProfilerFiller; -import net.minecraft.util.profiling.ResultField; -import net.minecraft.util.profiling.SingleTickProfiler; + import net.minecraft.util.profiling.jfr.Environment; import net.minecraft.util.profiling.jfr.JvmProfiler; import net.minecraft.util.profiling.jfr.callback.ProfiledDuration; -import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; @@ -192,7 +193,7 @@ index a795aa7a812a1773ba76d03ab8dba6e9b1ecf298..d3cf7176903bede5c8c7a7e3dae3f585 import net.minecraft.util.thread.ReentrantBlockableEventLoop; import net.minecraft.world.Difficulty; import net.minecraft.world.RandomSequences; -@@ -199,13 +188,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList(); @@ -204,19 +205,19 @@ index a795aa7a812a1773ba76d03ab8dba6e9b1ecf298..d3cf7176903bede5c8c7a7e3dae3f585 - private MinecraftServer.TimeProfiler debugCommandProfiler; - private boolean debugCommandProfilerDelayStart; private ServerConnectionListener connection; - public final ChunkProgressListenerFactory progressListenerFactory; + // Paper - per world load listener - moved LevelLoadListener to ServerLevel @Nullable -@@ -992,9 +974,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop false : this::haveTime); // Paper start - rewrite chunk system -@@ -1262,7 +1234,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; -@@ -1559,10 +1523,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop serverPlayer1.connection.suspendFlushing()); this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit // Paper start - optimise Folia entity scheduler -@@ -1676,9 +1632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - Add EntityMoveEvent serverLevel.updateLagCompensationTick(); // Paper - lag compensation net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = serverLevel.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers @@ -348,7 +360,7 @@ index a795aa7a812a1773ba76d03ab8dba6e9b1ecf298..d3cf7176903bede5c8c7a7e3dae3f585 try { serverLevel.tick(hasTimeLeft); } catch (Throwable var7) { -@@ -1732,34 +1681,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop filteredSpawningCategories; -@@ -586,14 +565,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -580,14 +560,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon List list = this.spawningChunks; try { -- profiler.push("filteringSpawningChunks"); +- profiler.popPush("filteringSpawningChunks"); this.chunkMap.collectSpawningChunks(list); - profiler.popPush("shuffleSpawningChunks"); // Paper start - chunk tick iteration optimisation @@ -869,18 +876,22 @@ index 2882cd829d4d8e1f8615f085f6908efcdf68ac62..6020b71802babb35ef60aca65afe9c26 for (LevelChunk levelChunk : list) { this.tickSpawningChunk(levelChunk, timeInhabited, filteredSpawningCategories, spawnState); -@@ -602,10 +578,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -596,14 +573,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon list.clear(); } - profiler.popPush("tickTickingChunks"); this.iterateTickingChunksFaster(); // Paper - chunk tick iteration optimisations -- profiler.pop(); -- profiler.popPush("customSpawners"); if (_boolean) { - this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); +- profiler.popPush("customSpawners"); + this.level.tickCustomSpawners(this.spawnEnemies); } -@@ -817,7 +790,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +- +- profiler.pop(); + } + + private void tickSpawningChunk(LevelChunk chunk, long timeInhabited, List spawnCategories, NaturalSpawner.SpawnState spawnState) { +@@ -824,7 +797,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @Override protected void doRunTask(Runnable task) { @@ -889,19 +900,19 @@ index 2882cd829d4d8e1f8615f085f6908efcdf68ac62..6020b71802babb35ef60aca65afe9c26 } diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8912c24bc 100644 +index 65757a85d6836fbfb4bebf0273d9f4291a64ee88..2a8d613a2c041ea1ed034d66b20955845a4c0255 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -75,8 +75,6 @@ import net.minecraft.util.Mth; - import net.minecraft.util.ProgressListener; - import net.minecraft.util.RandomSource; +@@ -77,8 +77,6 @@ import net.minecraft.util.RandomSource; import net.minecraft.util.datafix.DataFixTypes; + import net.minecraft.util.debug.DebugSubscriptions; + import net.minecraft.util.debug.LevelDebugSynchronizers; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.random.WeightedList; import net.minecraft.util.valueproviders.IntProvider; import net.minecraft.util.valueproviders.UniformInt; - import net.minecraft.world.DifficultyInstance; -@@ -708,16 +706,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -725,16 +723,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } public void tick(BooleanSupplier hasTimeLeft) { @@ -918,7 +929,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 } int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); -@@ -751,41 +745,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -768,30 +762,22 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.tickTime(); } @@ -946,12 +957,13 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 this.handlingTick = false; - profilerFiller.pop(); - boolean flag = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this - if (flag) { + boolean hasActiveTickets = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || this.chunkSource.hasActiveTickets(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this + if (hasActiveTickets) { this.resetEmptyTime(); +@@ -802,11 +788,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } - if (flag || this.emptyTime++ < 300) { + if (this.emptyTime < 300) { - profilerFiller.push("entities"); if (this.dragonFight != null && runsNormally) { - profilerFiller.push("dragonFight"); @@ -960,7 +972,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 } io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR -@@ -794,9 +777,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -815,9 +798,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe entity -> { if (!entity.isRemoved()) { if (!tickRateManager.isEntityFrozen(entity)) { @@ -970,7 +982,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 if (true) { // Paper - rewrite chunk system Entity vehicle = entity.getVehicle(); if (vehicle != null) { -@@ -807,21 +788,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -828,23 +809,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe entity.stopRiding(); } @@ -982,17 +994,27 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 } } ); -- profilerFiller.pop(); +- profilerFiller.popPush("blockEntities"); this.tickBlockEntities(); +- profilerFiller.pop(); } -- + - profilerFiller.push("entityManagement"); // Paper - rewrite chunk system +- profilerFiller.pop(); +- profilerFiller.push("debugSynchronizers"); + if (this.debugSynchronizers.hasAnySubscriberFor(DebugSubscriptions.NEIGHBOR_UPDATES)) { + this.neighborUpdater + .setDebugListener(blockPos -> this.debugSynchronizers.broadcastEventToTracking(blockPos, DebugSubscriptions.NEIGHBOR_UPDATES, blockPos)); +@@ -853,7 +827,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } + + this.debugSynchronizers.tick(this.server.debugSubscribers()); - profilerFiller.pop(); } @Override -@@ -836,9 +811,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -868,9 +841,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe if (this.tickTime) { long l = this.levelData.getGameTime() + 1L; this.serverLevelData.setGameTime(l); @@ -1002,7 +1024,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { this.setDayTime(this.levelData.getDayTime() + 1L); } -@@ -917,8 +890,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -949,8 +920,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe ChunkPos pos = chunk.getPos(); int minBlockX = pos.getMinBlockX(); int minBlockZ = pos.getMinBlockZ(); @@ -1011,7 +1033,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow for (int i = 0; i < randomTickSpeed; i++) { -@@ -928,12 +899,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -960,12 +929,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } } // Paper - Option to disable ice and snow @@ -1024,7 +1046,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 } public void tickThunder(LevelChunk chunk) { -@@ -941,8 +909,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -973,8 +939,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe boolean isRaining = this.isRaining(); int minBlockX = pos.getMinBlockX(); int minBlockZ = pos.getMinBlockZ(); @@ -1033,7 +1055,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15)); if (this.isRainingAt(blockPos)) { -@@ -968,8 +934,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1000,8 +964,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } } } @@ -1042,7 +1064,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 } @VisibleForTesting -@@ -1267,17 +1231,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1299,17 +1261,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } // Paper end - log detailed entity tick information entity.setOldPosAndRot(); @@ -1060,7 +1082,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 for (Entity entity1 : entity.getPassengers()) { this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2 -@@ -1298,9 +1258,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1330,9 +1288,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe passengerEntity.setOldPosAndRot(); passengerEntity.tickCount++; passengerEntity.totalEntityAge++; // Paper - age-like counter for all entities @@ -1070,7 +1092,7 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 // Paper start - EAR 2 if (isActive) { passengerEntity.rideTick(); -@@ -1312,7 +1269,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1344,7 +1299,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe ridingEntity.positionRider(passengerEntity); } // Paper end - EAR 2 @@ -1079,19 +1101,19 @@ index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8 for (Entity entity : passengerEntity.getPassengers()) { this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2 diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 9cbc3e1de1a1d0419b72ce074cfa01497a1fdd72..822691293834c4da31adb2573fbc87467db2daa5 100644 +index 1778c27a0942708d4417e9faf0c54d9d9d7d38ec..2edec1f0a6b456959139f897c41d96af55365156 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -106,8 +106,6 @@ import net.minecraft.util.HashOps; - import net.minecraft.util.Mth; - import net.minecraft.util.RandomSource; +@@ -110,8 +110,6 @@ import net.minecraft.util.Mth; + import net.minecraft.util.ProblemReporter; import net.minecraft.util.Unit; + import net.minecraft.util.debug.DebugSubscription; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.Container; import net.minecraft.world.Difficulty; import net.minecraft.world.InteractionHand; -@@ -1418,14 +1416,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1529,14 +1527,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.unsetRemoved(); */ // CraftBukkit end @@ -1106,7 +1128,7 @@ index 9cbc3e1de1a1d0419b72ce074cfa01497a1fdd72..822691293834c4da31adb2573fbc8746 // CraftBukkit start this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds LevelData worlddata = level.getLevelData(); -@@ -1442,7 +1436,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1553,7 +1547,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); level.addDuringTeleport(this); @@ -1115,18 +1137,18 @@ index 9cbc3e1de1a1d0419b72ce074cfa01497a1fdd72..822691293834c4da31adb2573fbc8746 this.stopUsingItem(); this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index f02800e4e941b05bde6f0d5fac76e2b6ec5b9832..149660c1196481275ca03830d64cf33b5ce98163 100644 +index c6db2c96db96453daaf49779f588f75f7c3d3d60..40ef10d088b21e51dd74897c9724f37dc7c2d467 100644 --- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -26,7 +26,6 @@ import net.minecraft.network.protocol.cookie.ServerboundCookieResponsePacket; - import net.minecraft.server.MinecraftServer; +@@ -27,7 +27,6 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ClientInformation; + import net.minecraft.server.players.NameAndId; import net.minecraft.util.VisibleForDebug; -import net.minecraft.util.profiling.Profiler; import org.slf4j.Logger; public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener { -@@ -260,7 +259,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -261,7 +260,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } protected void keepConnectionAlive() { @@ -1134,7 +1156,7 @@ index f02800e4e941b05bde6f0d5fac76e2b6ec5b9832..149660c1196481275ca03830d64cf33b long millis = Util.getMillis(); // Paper start - improve keepalives if (this.checkIfClosed(millis) && !this.processedDisconnect) { -@@ -281,8 +279,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -282,8 +280,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack // Paper end - improve keepalives } } @@ -1144,7 +1166,7 @@ index f02800e4e941b05bde6f0d5fac76e2b6ec5b9832..149660c1196481275ca03830d64cf33b private boolean checkIfClosed(long time) { diff --git a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java -index f0e2bca572c6f1790772980cd3ec651e9077382d..954e4103c9c359bc13c9a07bec885af90df14cb5 100644 +index 2a4acd6630d22c5004febcfb7e1298282523d1e1..06043c8fadeb6250a2950499ee67e8b677c39f4f 100644 --- a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java +++ b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java @@ -9,8 +9,6 @@ import java.util.concurrent.TimeUnit; @@ -1184,10 +1206,10 @@ index 51cec338f5948b69ad1cff896ce19dc3adb74380..be7fd9e55957ba6fa70c711d1ea4d42e @Override diff --git a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -index 407bd4b8026869bc14ee5e79ff80e7bdd1a07bcb..6e2a3d4171dbb2a30ba18f165723691713fac0f6 100644 +index 09d5e178614f73dfe332220f4f02b71183ee8df7..1e8ebdcde6b433fae7beb069c374ce8aac6cda06 100644 --- a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +++ b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -@@ -3,20 +3,13 @@ package net.minecraft.server.packs.resources; +@@ -3,8 +3,6 @@ package net.minecraft.server.packs.resources; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import net.minecraft.util.Unit; @@ -1196,21 +1218,22 @@ index 407bd4b8026869bc14ee5e79ff80e7bdd1a07bcb..6e2a3d4171dbb2a30ba18f1657236917 public interface ResourceManagerReloadListener extends PreparableReloadListener { @Override - default CompletableFuture reload( - PreparableReloadListener.PreparationBarrier barrier, ResourceManager manager, Executor backgroundExecutor, Executor gameExecutor +@@ -12,12 +10,7 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener + PreparableReloadListener.SharedState sharedState, Executor exectutor, PreparableReloadListener.PreparationBarrier barrier, Executor applyExectutor ) { + ResourceManager resourceManager = sharedState.resourceManager(); - return barrier.wait(Unit.INSTANCE).thenRunAsync(() -> { - ProfilerFiller profilerFiller = Profiler.get(); - profilerFiller.push("listener"); -- this.onResourceManagerReload(manager); +- this.onResourceManagerReload(resourceManager); - profilerFiller.pop(); -- }, gameExecutor); -+ return barrier.wait(Unit.INSTANCE).thenRunAsync(() -> this.onResourceManagerReload(manager), gameExecutor); // Gale - Purpur - remove vanilla profiler +- }, applyExectutor); ++ return barrier.wait(Unit.INSTANCE).thenRunAsync(() -> this.onResourceManagerReload(resourceManager), applyExectutor); // Gale - Purpur - remove vanilla profiler } void onResourceManagerReload(ResourceManager resourceManager); diff --git a/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java -index 64b0508ef21952c65b0b967b756b2a4c64d96899..b6b03fbbd669e6331b30255df5419611c38e0495 100644 +index 11884fc390d73b476632c372eb2d3d7876cdb7fd..8169d790a6b97f3e5ea66d71198db1230a7b1a9a 100644 --- a/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +++ b/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java @@ -2,7 +2,6 @@ package net.minecraft.server.packs.resources; @@ -1221,32 +1244,32 @@ index 64b0508ef21952c65b0b967b756b2a4c64d96899..b6b03fbbd669e6331b30255df5419611 import net.minecraft.util.profiling.ProfilerFiller; public abstract class SimplePreparableReloadListener implements PreparableReloadListener { -@@ -10,9 +9,9 @@ public abstract class SimplePreparableReloadListener implements PreparableRel - public final CompletableFuture reload( - PreparableReloadListener.PreparationBarrier barrier, ResourceManager manager, Executor backgroundExecutor, Executor gameExecutor +@@ -11,9 +10,9 @@ public abstract class SimplePreparableReloadListener implements PreparableRel + PreparableReloadListener.SharedState sharedState, Executor exectutor, PreparableReloadListener.PreparationBarrier barrier, Executor applyExectutor ) { -- return CompletableFuture.supplyAsync(() -> this.prepare(manager, Profiler.get()), backgroundExecutor) -+ return CompletableFuture.supplyAsync(() -> this.prepare(manager, net.minecraft.util.profiling.InactiveProfiler.INSTANCE), backgroundExecutor) // Gale - Purpur - remove vanilla profiler + ResourceManager resourceManager = sharedState.resourceManager(); +- return CompletableFuture.supplyAsync(() -> this.prepare(resourceManager, Profiler.get()), exectutor) ++ return CompletableFuture.supplyAsync(() -> this.prepare(resourceManager, net.minecraft.util.profiling.InactiveProfiler.INSTANCE), exectutor) // Gale - Purpur - remove vanilla profiler .thenCompose(barrier::wait) -- .thenAcceptAsync(object -> this.apply((T)object, manager, Profiler.get()), gameExecutor); -+ .thenAcceptAsync(object -> this.apply((T)object, manager, net.minecraft.util.profiling.InactiveProfiler.INSTANCE), gameExecutor); // Gale - Purpur - remove vanilla profiler +- .thenAcceptAsync(object -> this.apply((T)object, resourceManager, Profiler.get()), applyExectutor); ++ .thenAcceptAsync(object -> this.apply((T)object, resourceManager, net.minecraft.util.profiling.InactiveProfiler.INSTANCE), applyExectutor); // Gale - Purpur - remove vanilla profiler } protected abstract T prepare(ResourceManager resourceManager, ProfilerFiller profiler); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532c50564d5 100644 +index 98773bf5a1ad39f405bf0f3bb92ea406813dde67..f871c40148fdb6b0798ea2e3291fc92b886f98a7 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -80,8 +80,6 @@ import net.minecraft.tags.TagKey; - import net.minecraft.util.Mth; - import net.minecraft.util.ProblemReporter; - import net.minecraft.util.RandomSource; +@@ -82,8 +82,6 @@ import net.minecraft.util.RandomSource; + import net.minecraft.util.debug.DebugEntityBlockIntersection; + import net.minecraft.util.debug.DebugSubscriptions; + import net.minecraft.util.debug.DebugValueSource; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.Nameable; -@@ -841,8 +839,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -847,8 +845,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name // CraftBukkit end public void baseTick() { @@ -1255,7 +1278,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups this.inBlockState = null; if (this.isPassenger() && this.getVehicle().isRemoved()) { -@@ -896,8 +892,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -902,8 +898,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name if (this.level() instanceof ServerLevel serverLevelx && this instanceof Leashable) { Leashable.tickLeash(serverLevelx, (Entity & Leashable)this); } @@ -1264,7 +1287,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 } public void setSharedFlagOnFire(boolean isOnFire) { -@@ -1117,8 +1111,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1127,8 +1121,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name } } @@ -1273,7 +1296,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7) { movement = movement.multiply(this.stuckSpeedMultiplier); this.stuckSpeedMultiplier = Vec3.ZERO; -@@ -1127,7 +1119,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1137,7 +1129,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name // Paper start - ignore movement changes while inactive. if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) { setDeltaMovement(Vec3.ZERO); @@ -1281,8 +1304,8 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 return; } // Paper end -@@ -1152,8 +1143,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - this.setPos(vec32); +@@ -1162,8 +1153,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name + this.setPos(vec33); } - profilerFiller.pop(); @@ -1290,7 +1313,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 boolean flag = !Mth.equal(movement.x, vec3.x); boolean flag1 = !Mth.equal(movement.z, vec3.z); this.horizontalCollision = flag || flag1; -@@ -1176,7 +1165,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1186,7 +1175,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name } if (this.isRemoved()) { @@ -1298,7 +1321,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 } else { if (this.horizontalCollision) { Vec3 deltaMovement = this.getDeltaMovement(); -@@ -1220,7 +1208,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1230,7 +1218,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name float blockSpeedFactor = this.getBlockSpeedFactor(); this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor)); @@ -1306,7 +1329,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 } } // Paper start - detailed watchdog information -@@ -3406,8 +3393,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3472,8 +3459,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name this.processPortalCooldown(); if (this.portalProcess != null) { if (this.portalProcess.processPortalTeleportation(serverLevel, this, this.canUsePortal(false))) { @@ -1315,7 +1338,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 this.setPortalCooldown(); TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this); if (portalDestination != null) { -@@ -3418,7 +3403,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3484,7 +3469,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name } } @@ -1323,7 +1346,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 } else if (this.portalProcess.hasExpired()) { this.portalProcess = null; } -@@ -3985,15 +3969,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4051,15 +4035,12 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name entity.teleport(this.calculatePassengerTransition(teleportTransition, entity)); } @@ -1339,7 +1362,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 return this; } -@@ -4009,11 +3990,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4076,11 +4057,8 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name } } @@ -1351,7 +1374,7 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 return null; } else { // Paper start - Fix item duplication and teleport issues -@@ -4033,7 +4011,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4100,7 +4078,6 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name newLevel.resetEmptyTime(); teleportTransition.postTeleportTransition().onTransition(entityx); this.teleportSpectators(teleportTransition, oldLevel); @@ -1360,10 +1383,10 @@ index d8c2d88a0a533cbdce666ce3753de8aa210cdd3b..e45c92dc6e9b934b19bbd33e1fd65532 } } diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90dc1068ed 100644 +index 1a5ce901d6bcf6fdc476ea8bf64b1c5aac55a555..ca46c3a7ba5ffb6cd552cc1313db615c28bd7509 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -69,8 +69,6 @@ import net.minecraft.tags.FluidTags; +@@ -70,8 +70,6 @@ import net.minecraft.tags.FluidTags; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.util.Mth; @@ -1372,24 +1395,24 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 import net.minecraft.world.Difficulty; import net.minecraft.world.InteractionHand; import net.minecraft.world.damagesource.CombatRules; -@@ -429,8 +427,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -436,8 +434,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin } super.baseTick(); - ProfilerFiller profilerFiller = Profiler.get(); - profilerFiller.push("livingEntityBaseTick"); - if (this.fireImmune() || this.level().isClientSide) { - this.clearFire(); - } -@@ -515,7 +511,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + if (this.isAlive() && this.level() instanceof ServerLevel serverLevel1) { + boolean flag = this instanceof Player; + if (this.isInWall()) { +@@ -518,7 +514,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin this.yBodyRotO = this.yBodyRot; this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); - profilerFiller.pop(); } - @Override -@@ -3285,11 +3280,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + protected boolean shouldTakeDrowningDamage() { +@@ -3317,11 +3312,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin f1 = this.getYRot(); } @@ -1401,7 +1424,7 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 // Paper start - stop large pitch and yaw changes from crashing the server this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; -@@ -3301,7 +3292,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3333,7 +3324,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; // Paper end - stop large pitch and yaw changes from crashing the server @@ -1409,7 +1432,7 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 if (this.isFallFlying()) { this.fallFlyTicks++; } else { -@@ -3477,21 +3467,15 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3509,21 +3499,15 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin } this.setDeltaMovement(d, d1, d2); @@ -1420,7 +1443,7 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 this.jumping = false; this.xxa = 0.0F; this.zza = 0.0F; - } else if (this.isEffectiveAi() && !this.level().isClientSide) { + } else if (this.isEffectiveAi() && !this.level().isClientSide()) { - profilerFiller.push("newAi"); this.serverAiStep(); - profilerFiller.pop(); @@ -1431,7 +1454,7 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 if (this.jumping && this.isAffectedByFluids()) { double fluidHeight; if (this.isInLava()) { -@@ -3520,8 +3504,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3552,8 +3536,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin this.noJumpDelay = 0; } @@ -1440,7 +1463,7 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 if (this.isFallFlying()) { this.updateFallFlying(); } -@@ -3546,9 +3528,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3578,9 +3560,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin this.calculateEntityAnimation(this instanceof FlyingAnimal); } @@ -1450,7 +1473,7 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 if ((!this.isInPowderSnow || !this.canFreeze()) && !this.freezeLocked) { // Paper - Freeze Tick Lock API this.setTicksFrozen(Math.max(0, this.getTicksFrozen() - 2)); } -@@ -3558,18 +3538,14 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3590,18 +3570,14 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin if (this.tickCount % 40 == 0 && this.isFullyFrozen() && this.canFreeze()) { this.hurtServer(serverLevel, this.damageSources().freeze(), 1.0F); } @@ -1470,19 +1493,19 @@ index c3c3b7dfb01317c902687b7de192f8a5a910a565..c2f93f2e71ea5cab84a5821d952a6f90 if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof Player)) { if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java -index e0b3cb2b2694768803ed347a1026b881fd624951..c620341e33dc1805f1c033a969d0a15e1484c176 100644 +index 4994dcb209dd82d60559cfc453198b75cbfa1511..925cb690e3c6dfd558aab355e33dd2505f0ec427 100644 --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -26,8 +26,6 @@ import net.minecraft.sounds.SoundEvent; - import net.minecraft.tags.TagKey; - import net.minecraft.util.Mth; - import net.minecraft.util.RandomSource; +@@ -31,8 +31,6 @@ import net.minecraft.util.debug.DebugGoalInfo; + import net.minecraft.util.debug.DebugPathInfo; + import net.minecraft.util.debug.DebugSubscriptions; + import net.minecraft.util.debug.DebugValueSource; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.Container; import net.minecraft.world.Difficulty; import net.minecraft.world.DifficultyInstance; -@@ -320,14 +318,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -330,14 +328,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override public void baseTick() { super.baseTick(); @@ -1497,7 +1520,7 @@ index e0b3cb2b2694768803ed347a1026b881fd624951..c620341e33dc1805f1c033a969d0a15e } @Override -@@ -509,8 +503,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -524,8 +518,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override public void aiStep() { super.aiStep(); @@ -1506,7 +1529,7 @@ index e0b3cb2b2694768803ed347a1026b881fd624951..c620341e33dc1805f1c033a969d0a15e if (this.level() instanceof ServerLevel serverLevel && this.canPickUpLoot() && this.isAlive() -@@ -533,8 +525,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -548,8 +540,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab } } } @@ -1515,7 +1538,7 @@ index e0b3cb2b2694768803ed347a1026b881fd624951..c620341e33dc1805f1c033a969d0a15e } protected Vec3i getPickupReach() { -@@ -754,42 +744,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -765,42 +755,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab return; } // Paper end - Allow nerfed mobs to jump and float @@ -1555,9 +1578,9 @@ index e0b3cb2b2694768803ed347a1026b881fd624951..c620341e33dc1805f1c033a969d0a15e this.jumpControl.tick(); - profilerFiller.pop(); - profilerFiller.pop(); - this.sendDebugPackets(); } + protected void customServerAiStep(ServerLevel level) { diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java index 859b859d29b637200cf7c9a0bd52d9f712413e3d..653c58c7637c46c8b46a5082f671324a2221d431 100644 --- a/net/minecraft/world/entity/ai/goal/GoalSelector.java @@ -1613,19 +1636,19 @@ index 859b859d29b637200cf7c9a0bd52d9f712413e3d..653c58c7637c46c8b46a5082f671324a public Set getAvailableGoals() { diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java -index dd1a95111d965bcd7f53be9d4224dd213e4e0705..24dd92449f70144c79f25bf24942ebd666655ed2 100644 +index 3e427a7e8be0e15bf867948ee21e838a8a9c3408..1f45b389553cd5782972193537ce7adcd9c7c600 100644 --- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java -@@ -10,8 +10,6 @@ import net.minecraft.core.Vec3i; - import net.minecraft.network.protocol.game.DebugPackets; - import net.minecraft.tags.BlockTags; +@@ -12,8 +12,6 @@ import net.minecraft.tags.BlockTags; import net.minecraft.util.Mth; + import net.minecraft.util.debug.DebugSubscriptions; + import net.minecraft.util.debug.ServerDebugSubscribers; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.Attributes; -@@ -189,13 +187,10 @@ public abstract class PathNavigation { +@@ -195,13 +193,10 @@ public abstract class PathNavigation { } } // Paper end - EntityPathfindEvent @@ -1664,10 +1687,10 @@ index c569074403b1d8b443aaa98ba9cf9bbd0e98bd2d..b1aa7294f9479f45fcde77c5ea46db9f this.seen.add(id); } else { diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java -index 272f57aca640e045efca64dd018b221335c667ee..f07dcf7d45b1b717faeae0c4129fb00a22fb7d57 100644 +index 4d13d33fc40e42fe924f8aeca737e15b9a4ee136..7375a1b2440962a4b42646f5b217e8ef4c0493e3 100644 --- a/net/minecraft/world/entity/animal/HappyGhast.java +++ b/net/minecraft/world/entity/animal/HappyGhast.java -@@ -14,8 +14,6 @@ import net.minecraft.sounds.SoundEvents; +@@ -13,8 +13,6 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.tags.ItemTags; import net.minecraft.util.Mth; @@ -1676,7 +1699,7 @@ index 272f57aca640e045efca64dd018b221335c667ee..f07dcf7d45b1b717faeae0c4129fb00a import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -@@ -385,13 +383,8 @@ public class HappyGhast extends Animal { +@@ -389,13 +387,8 @@ public class HappyGhast extends Animal { @Override protected void customServerAiStep(ServerLevel level) { if (this.isBaby()) { @@ -1691,10 +1714,10 @@ index 272f57aca640e045efca64dd018b221335c667ee..f07dcf7d45b1b717faeae0c4129fb00a this.checkRestriction(); diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java -index b7b964bd4e2d611a3e48ece072d5787193077a92..de3bf0b62371f06ecb5d2035638e352ca0c06182 100644 +index 2cd30038c9b82d074408be33447d1401de876fb8..83fb267fe5e4fc5adb67e698ec62d6403228b0a9 100644 --- a/net/minecraft/world/entity/animal/allay/Allay.java +++ b/net/minecraft/world/entity/animal/allay/Allay.java -@@ -25,8 +25,6 @@ import net.minecraft.tags.GameEventTags; +@@ -24,8 +24,6 @@ import net.minecraft.tags.GameEventTags; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.util.Mth; @@ -1703,7 +1726,7 @@ index b7b964bd4e2d611a3e48ece072d5787193077a92..de3bf0b62371f06ecb5d2035638e352c import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.SimpleContainer; -@@ -226,13 +224,8 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS +@@ -225,13 +223,8 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS @Override protected void customServerAiStep(ServerLevel level) { @@ -1718,10 +1741,10 @@ index b7b964bd4e2d611a3e48ece072d5787193077a92..de3bf0b62371f06ecb5d2035638e352c } diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java -index c1798db2972c8f2a343cf6e16fd9354ff212d906..ee2c6c86631ba50a4e8503131c678596bc2c0363 100644 +index 4792e7e6b720a315d64f18d9c3b12f703da8fb21..6118a4f0fa03aaefa35ccff71c1d0bba9c45c158 100644 --- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java +++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java -@@ -23,8 +23,6 @@ import net.minecraft.util.ByIdMap; +@@ -22,8 +22,6 @@ import net.minecraft.util.ByIdMap; import net.minecraft.util.RandomSource; import net.minecraft.util.StringRepresentable; import net.minecraft.util.TimeUtil; @@ -1730,7 +1753,7 @@ index c1798db2972c8f2a343cf6e16fd9354ff212d906..ee2c6c86631ba50a4e8503131c678596 import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -@@ -135,13 +133,8 @@ public class Armadillo extends Animal { +@@ -129,13 +127,8 @@ public class Armadillo extends Animal { @Override protected void customServerAiStep(ServerLevel level) { @@ -1745,10 +1768,10 @@ index c1798db2972c8f2a343cf6e16fd9354ff212d906..ee2c6c86631ba50a4e8503131c678596 this.forceDrops = true; // CraftBukkit if (this.dropFromGiftLootTable(level, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) { diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index b0467750dab4c6f411fd2f318009d25f83d94bc0..6a5e9e9582e322aaa1555933de97e545ba74f8f4 100644 +index 3cf26691c453aff306194b28c0610168cf75c950..7862a094f7d173123197cfc2feaa5819fe5158d1 100644 --- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java -@@ -31,8 +31,6 @@ import net.minecraft.util.ByIdMap; +@@ -30,8 +30,6 @@ import net.minecraft.util.ByIdMap; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.util.StringRepresentable; @@ -1757,7 +1780,7 @@ index b0467750dab4c6f411fd2f318009d25f83d94bc0..6a5e9e9582e322aaa1555933de97e545 import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -329,13 +327,8 @@ public class Axolotl extends Animal implements Bucketable { +@@ -328,13 +326,8 @@ public class Axolotl extends Animal implements Bucketable { @Override protected void customServerAiStep(ServerLevel level) { @@ -1772,10 +1795,10 @@ index b0467750dab4c6f411fd2f318009d25f83d94bc0..6a5e9e9582e322aaa1555933de97e545 Optional memory = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); this.setPlayingDead(memory.isPresent() && memory.get() > 0); diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java -index 757b63ee059c95e673a098706b4ee7ab4fc21f70..adc336c6cec601b8855c1013adf1eebf018597f0 100644 +index 9ad94aca22a100dddaded5833763f9acd2a0ce56..0cf88d97503349364a17f85926ed14b5e681f2f7 100644 --- a/net/minecraft/world/entity/animal/camel/Camel.java +++ b/net/minecraft/world/entity/animal/camel/Camel.java -@@ -18,8 +18,6 @@ import net.minecraft.tags.BlockTags; +@@ -17,8 +17,6 @@ import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; @@ -1784,7 +1807,7 @@ index 757b63ee059c95e673a098706b4ee7ab4fc21f70..adc336c6cec601b8855c1013adf1eebf import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -159,14 +157,9 @@ public class Camel extends AbstractHorse { +@@ -158,14 +156,9 @@ public class Camel extends AbstractHorse { @Override protected void customServerAiStep(ServerLevel level) { @@ -1800,10 +1823,10 @@ index 757b63ee059c95e673a098706b4ee7ab4fc21f70..adc336c6cec601b8855c1013adf1eebf } diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java -index 66f503e045ccb0985ec718b39be07eea538fad8d..b8703409dd3dc8e3020ed81b44ce4812984c88c3 100644 +index 7d63881ec187f11544947a487fd0445561228247..1a0f797880b4dc577a4a92cf4f1a778753f5702c 100644 --- a/net/minecraft/world/entity/animal/frog/Frog.java +++ b/net/minecraft/world/entity/animal/frog/Frog.java -@@ -28,8 +28,6 @@ import net.minecraft.tags.ItemTags; +@@ -27,8 +27,6 @@ import net.minecraft.tags.ItemTags; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.util.Unit; @@ -1812,7 +1835,7 @@ index 66f503e045ccb0985ec718b39be07eea538fad8d..b8703409dd3dc8e3020ed81b44ce4812 import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.AgeableMob; -@@ -204,13 +202,8 @@ public class Frog extends Animal { +@@ -203,13 +201,8 @@ public class Frog extends Animal { @Override protected void customServerAiStep(ServerLevel level) { @@ -1827,10 +1850,10 @@ index 66f503e045ccb0985ec718b39be07eea538fad8d..b8703409dd3dc8e3020ed81b44ce4812 } diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java -index 17f58246849ed407821a987b200cc765eb7943f9..c1510a6f1146f446ed65a1f08984af6c29de439a 100644 +index d216c2fbf2fe846c0d9b7164d24eb3815b7235ff..c468d0f2c6d22fe461763633821e2108bda5bce8 100644 --- a/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/net/minecraft/world/entity/animal/frog/Tadpole.java -@@ -12,8 +12,6 @@ import net.minecraft.server.level.ServerLevel; +@@ -11,8 +11,6 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.ItemTags; @@ -1839,7 +1862,7 @@ index 17f58246849ed407821a987b200cc765eb7943f9..c1510a6f1146f446ed65a1f08984af6c import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -@@ -100,13 +98,8 @@ public class Tadpole extends AbstractFish { +@@ -99,13 +97,8 @@ public class Tadpole extends AbstractFish { @Override protected void customServerAiStep(ServerLevel level) { @@ -1854,10 +1877,10 @@ index 17f58246849ed407821a987b200cc765eb7943f9..c1510a6f1146f446ed65a1f08984af6c } diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java -index 75af1b92a0a60cffa3317d83bd599a3d4d26f93c..bdac4929db71a39fc02985109cedc9cd316ec3cc 100644 +index fe4dff673d583a2572b203f035e8d1d66d3f780a..bbf281cdd8cf0f69726ea2d8ac42fb4adc8d0123 100644 --- a/net/minecraft/world/entity/animal/goat/Goat.java +++ b/net/minecraft/world/entity/animal/goat/Goat.java -@@ -20,8 +20,6 @@ import net.minecraft.tags.ItemTags; +@@ -19,8 +19,6 @@ import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; @@ -1866,7 +1889,7 @@ index 75af1b92a0a60cffa3317d83bd599a3d4d26f93c..bdac4929db71a39fc02985109cedc9cd import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -190,13 +188,8 @@ public class Goat extends Animal { +@@ -189,13 +187,8 @@ public class Goat extends Animal { @Override protected void customServerAiStep(ServerLevel level) { @@ -1881,10 +1904,10 @@ index 75af1b92a0a60cffa3317d83bd599a3d4d26f93c..bdac4929db71a39fc02985109cedc9cd } diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index 6a9f31c1f39cc14ad7b5ae3af85908bc7a4caae4..05d269b51715a71fa653900e7187b07d001afdb7 100644 +index 9736ecdeefa2c8ed9f618672f2b63492cac2a6be..9ad30992fdef7773256046dd5471082ee30fcb44 100644 --- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -29,8 +29,6 @@ import net.minecraft.tags.BlockTags; +@@ -28,8 +28,6 @@ import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; import net.minecraft.util.ByIdMap; import net.minecraft.util.Mth; @@ -1893,7 +1916,7 @@ index 6a9f31c1f39cc14ad7b5ae3af85908bc7a4caae4..05d269b51715a71fa653900e7187b07d import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -@@ -465,12 +463,8 @@ public class Sniffer extends Animal { +@@ -464,12 +462,8 @@ public class Sniffer extends Animal { @Override protected void customServerAiStep(ServerLevel level) { @@ -1907,10 +1930,10 @@ index 6a9f31c1f39cc14ad7b5ae3af85908bc7a4caae4..05d269b51715a71fa653900e7187b07d } diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java -index 0dbc528bcad2b2f79585e2462a265d43fcbebe76..662b95d27f6630ec27fd88ca279e395438faa96b 100644 +index 4feaa6167d82278a104a37c3b10257e24b299e6c..2bd41d469394ae7eecf2581dc41cca6fbea11015 100644 --- a/net/minecraft/world/entity/monster/Zoglin.java +++ b/net/minecraft/world/entity/monster/Zoglin.java -@@ -14,8 +14,6 @@ import net.minecraft.network.syncher.SynchedEntityData; +@@ -13,8 +13,6 @@ import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; @@ -1919,7 +1942,7 @@ index 0dbc528bcad2b2f79585e2462a265d43fcbebe76..662b95d27f6630ec27fd88ca279e3954 import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; -@@ -250,10 +248,7 @@ public class Zoglin extends Monster implements HoglinBase { +@@ -249,10 +247,7 @@ public class Zoglin extends Monster implements HoglinBase { @Override protected void customServerAiStep(ServerLevel level) { @@ -1931,19 +1954,19 @@ index 0dbc528bcad2b2f79585e2462a265d43fcbebe76..662b95d27f6630ec27fd88ca279e3954 } diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java -index c12653070d62c44b97a07676f24caf7ab570cd2a..d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5 100644 +index c1e391bac9976f74f5fe3f5b0d91130c927ebec2..cb24eea0d50b4c40216c9f263c7cbcbe466944f7 100644 --- a/net/minecraft/world/entity/monster/breeze/Breeze.java +++ b/net/minecraft/world/entity/monster/breeze/Breeze.java -@@ -12,8 +12,6 @@ import net.minecraft.sounds.SoundEvent; - import net.minecraft.sounds.SoundEvents; - import net.minecraft.sounds.SoundSource; - import net.minecraft.tags.EntityTypeTags; +@@ -14,8 +14,6 @@ import net.minecraft.tags.EntityTypeTags; + import net.minecraft.util.debug.DebugBreezeInfo; + import net.minecraft.util.debug.DebugSubscriptions; + import net.minecraft.util.debug.DebugValueSource; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.AnimationState; import net.minecraft.world.entity.Entity; -@@ -232,12 +230,8 @@ public class Breeze extends Monster { +@@ -234,12 +232,8 @@ public class Breeze extends Monster { @Override protected void customServerAiStep(ServerLevel level) { @@ -1957,10 +1980,10 @@ index c12653070d62c44b97a07676f24caf7ab570cd2a..d91ce14cc39b1b6ccd558f53ed605d4c } diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java -index 567e7952efec69b4222563fae724d18a9902bb05..f66bd6cc4aab828e847b990b193be54cd0d0dc01 100644 +index f18b893cf7c7f87edb18beb3ef8781d892f6fc86..c5f4572c85a4bcbb484dcee72733dd566998cfd9 100644 --- a/net/minecraft/world/entity/monster/creaking/Creaking.java +++ b/net/minecraft/world/entity/monster/creaking/Creaking.java -@@ -16,8 +16,6 @@ import net.minecraft.server.level.ServerLevel; +@@ -15,8 +15,6 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.DamageTypeTags; @@ -1969,7 +1992,7 @@ index 567e7952efec69b4222563fae724d18a9902bb05..f66bd6cc4aab828e847b990b193be54c import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.AnimationState; import net.minecraft.world.entity.Entity; -@@ -205,10 +203,7 @@ public class Creaking extends Monster { +@@ -204,10 +202,7 @@ public class Creaking extends Monster { @Override protected void customServerAiStep(ServerLevel level) { @@ -1981,10 +2004,10 @@ index 567e7952efec69b4222563fae724d18a9902bb05..f66bd6cc4aab828e847b990b193be54c } diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java -index 0ecf8533f6cad081df8713856feb74db93028f71..bde6f9d9d1cc7a5ee8334ee9207afae304ddcfa9 100644 +index 422401ebe7ed5bbf69cad7083b333b9279978494..794ba36444f6a920259b9b761620393e1868fa24 100644 --- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java +++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java -@@ -15,8 +15,6 @@ import net.minecraft.sounds.SoundEvents; +@@ -14,8 +14,6 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.tags.ItemTags; import net.minecraft.util.RandomSource; @@ -1993,7 +2016,7 @@ index 0ecf8533f6cad081df8713856feb74db93028f71..bde6f9d9d1cc7a5ee8334ee9207afae3 import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -162,10 +160,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { +@@ -161,10 +159,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { @Override protected void customServerAiStep(ServerLevel level) { @@ -2005,7 +2028,7 @@ index 0ecf8533f6cad081df8713856feb74db93028f71..bde6f9d9d1cc7a5ee8334ee9207afae3 if (this.isConverting()) { this.timeInOverworld++; diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java -index 8392ff1316f0c5be685a6ded7ccd08933c10ff4e..689f200554d8c03313b3d194f209c527f315c29a 100644 +index d220e8f1517cf68a6083fc4791cb34ca926dd165..b99a9bb6fbc30a3834301feac5a3fabba30cccb3 100644 --- a/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/net/minecraft/world/entity/monster/piglin/Piglin.java @@ -16,8 +16,6 @@ import net.minecraft.tags.ItemTags; @@ -2017,7 +2040,7 @@ index 8392ff1316f0c5be685a6ded7ccd08933c10ff4e..689f200554d8c03313b3d194f209c527 import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -320,10 +318,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -308,10 +306,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override protected void customServerAiStep(ServerLevel level) { @@ -2053,10 +2076,10 @@ index 219978cb0341b2d691f44c1146707d875788881e..589a130f8855f464c1930a0aa8b54c03 PiglinBruteAi.maybePlayActivitySound(this); super.customServerAiStep(level); diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java -index 4a4cc7f9c95d4f4b6ad4948e3ed3504efbbcef15..dd6666bd8b8df4148a1557627ce2a6ddab245ed6 100644 +index 45fa724f7f6ff911a09d4c20811386fe2a10a80a..010872aeced18debc3c7d352bedf1c5d10a1255a 100644 --- a/net/minecraft/world/entity/monster/warden/Warden.java +++ b/net/minecraft/world/entity/monster/warden/Warden.java -@@ -27,8 +27,6 @@ import net.minecraft.tags.TagKey; +@@ -26,8 +26,6 @@ import net.minecraft.tags.TagKey; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.util.Unit; @@ -2065,7 +2088,7 @@ index 4a4cc7f9c95d4f4b6ad4948e3ed3504efbbcef15..dd6666bd8b8df4148a1557627ce2a6dd import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffectInstance; -@@ -279,10 +277,7 @@ public class Warden extends Monster implements VibrationSystem { +@@ -278,10 +276,7 @@ public class Warden extends Monster implements VibrationSystem { @Override protected void customServerAiStep(ServerLevel level) { @@ -2077,7 +2100,7 @@ index 4a4cc7f9c95d4f4b6ad4948e3ed3504efbbcef15..dd6666bd8b8df4148a1557627ce2a6dd if ((this.tickCount + this.getId()) % 120 == 0) { applyDarknessAround(level, this.position(), this, 20); diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java -index e1e2bdb35866a8f32a41f6efd24ad77cf916b2e9..6cf2af33d22d3df8374746f5926f3f2d5093431d 100644 +index ae2f000083556cdc1cbb637e6210c4c4e22c974f..7a09ac3a26c73672acce43c72c00c581b9521262 100644 --- a/net/minecraft/world/entity/npc/Villager.java +++ b/net/minecraft/world/entity/npc/Villager.java @@ -35,8 +35,6 @@ import net.minecraft.stats.Stats; @@ -2101,19 +2124,18 @@ index e1e2bdb35866a8f32a41f6efd24ad77cf916b2e9..6cf2af33d22d3df8374746f5926f3f2d this.assignProfessionWhenSpawned = false; } diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 623ecd274667a8f91d5694d3284d14b8432f4c7a..f3fcfbc5dcf3ead4b2826e8f09b0ff6c7450f945 100644 +index 65a1ef05643f5eb65bb0b815c3975579c7374dcd..406f5f758370d3d53dcd32c1abc65d2851d2235e 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -35,8 +35,6 @@ import net.minecraft.util.AbortableIterationConsumer; +@@ -36,7 +36,6 @@ import net.minecraft.util.AbortableIterationConsumer; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.util.StringRepresentable; -import net.minecraft.util.profiling.Profiler; --import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.random.WeightedList; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.TickRateManager; - import net.minecraft.world.damagesource.DamageSource; -@@ -215,7 +213,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -220,7 +219,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public final List getEntitiesOfClass(final Class entityClass, final AABB boundingBox, final Predicate predicate) { @@ -2121,7 +2143,7 @@ index 623ecd274667a8f91d5694d3284d14b8432f4c7a..f3fcfbc5dcf3ead4b2826e8f09b0ff6c final List ret = new java.util.ArrayList<>(); ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate); -@@ -225,7 +222,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -230,7 +228,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public final List moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate predicate) { @@ -2129,24 +2151,7 @@ index 623ecd274667a8f91d5694d3284d14b8432f4c7a..f3fcfbc5dcf3ead4b2826e8f09b0ff6c final List ret = new java.util.ArrayList<>(); ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate); -@@ -1452,8 +1448,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl - } - - protected void tickBlockEntities() { -- ProfilerFiller profilerFiller = Profiler.get(); -- profilerFiller.push("blockEntities"); - this.tickingBlockEntities = true; - if (!this.pendingBlockEntityTickers.isEmpty()) { - this.blockEntityTickers.addAll(this.pendingBlockEntityTickers); -@@ -1483,7 +1477,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl - this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 - - this.tickingBlockEntities = false; -- profilerFiller.pop(); - this.spigotConfig.currentPrimedTnt = 0; // Spigot - } - -@@ -1735,7 +1728,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -1691,7 +1688,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public List getEntities(@Nullable Entity entity, AABB boundingBox, Predicate predicate) { @@ -2154,7 +2159,7 @@ index 623ecd274667a8f91d5694d3284d14b8432f4c7a..f3fcfbc5dcf3ead4b2826e8f09b0ff6c List list = Lists.newArrayList(); // Paper start - rewrite chunk system -@@ -1764,8 +1756,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -1720,8 +1716,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public void getEntities(final EntityTypeTest entityTypeTest, final AABB boundingBox, final Predicate predicate, final List into, final int maxCount) { @@ -2163,11 +2168,19 @@ index 623ecd274667a8f91d5694d3284d14b8432f4c7a..f3fcfbc5dcf3ead4b2826e8f09b0ff6c if (entityTypeTest instanceof net.minecraft.world.entity.EntityType byType) { if (maxCount != Integer.MAX_VALUE) { ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(byType, boundingBox, into, predicate, maxCount); +@@ -1806,7 +1800,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + // Paper end - rewrite chunk system + + public boolean hasEntities(EntityTypeTest entityTypeTest, AABB bounds, Predicate predicate) { +- Profiler.get().incrementCounter("hasEntities"); + MutableBoolean mutableBoolean = new MutableBoolean(); + this.getEntities().get(entityTypeTest, bounds, value -> { + if (predicate.test(value)) { diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java -index 4f647507d06d45a65b4b1793219d90c65e110225..ccbeda714085118b4dddf9fac6f3de2ed7a6426e 100644 +index 6198d6d4952088f1fef28e84f65f22e702b4435d..1340d4d15dbc244a2bdef4cbec5c3fd1da97f174 100644 --- a/net/minecraft/world/level/NaturalSpawner.java +++ b/net/minecraft/world/level/NaturalSpawner.java -@@ -23,8 +23,6 @@ import net.minecraft.tags.BlockTags; +@@ -24,8 +24,6 @@ import net.minecraft.tags.BlockTags; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.util.VisibleForDebug; @@ -2176,7 +2189,7 @@ index 4f647507d06d45a65b4b1793219d90c65e110225..ccbeda714085118b4dddf9fac6f3de2e import net.minecraft.util.random.WeightedList; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntitySpawnReason; -@@ -152,9 +150,6 @@ public final class NaturalSpawner { +@@ -154,9 +152,6 @@ public final class NaturalSpawner { } public static void spawnForChunk(ServerLevel level, LevelChunk chunk, NaturalSpawner.SpawnState spawnState, List categories) { @@ -2186,7 +2199,7 @@ index 4f647507d06d45a65b4b1793219d90c65e110225..ccbeda714085118b4dddf9fac6f3de2e for (MobCategory mobCategory : categories) { // Paper start - Optional per player mob spawns final boolean canSpawn; -@@ -189,8 +184,6 @@ public final class NaturalSpawner { +@@ -191,8 +186,6 @@ public final class NaturalSpawner { // Paper end - Optional per player mob spawns } } @@ -2196,19 +2209,19 @@ index 4f647507d06d45a65b4b1793219d90c65e110225..ccbeda714085118b4dddf9fac6f3de2e // Paper start - Add mobcaps commands diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index 07e4025ca6c9c31905db2e6921138a0ded479dde..fa4695b7ee56724b4d47ce4da0a5aeb8b5467db4 100644 +index 1c521f9f32340cf75310686c90777e521ac3ae5c..78c4450ee097ca0b53b7c5fbef4cd42c35654b66 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java -@@ -13,8 +13,6 @@ import net.minecraft.Util; - import net.minecraft.core.BlockPos; +@@ -14,8 +14,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; + import net.minecraft.tags.EntityTypeTags; import net.minecraft.util.Mth; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; -@@ -652,10 +650,7 @@ public class ServerExplosion implements Explosion { +@@ -640,10 +638,7 @@ public class ServerExplosion implements Explosion { List list = this.calculateExplodedPositions(); this.hurtEntities(); if (this.interactsWithBlocks()) { @@ -2220,19 +2233,19 @@ index 07e4025ca6c9c31905db2e6921138a0ded479dde..fa4695b7ee56724b4d47ce4da0a5aeb8 if (this.fire) { diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 75578e6ed7233a03d9b6cd3c6d3997f1c6148392..b88254fb3c12b99684c6ede1ae8a6671ffbe9ad6 100644 +index 4dcec2e8a3120a3dfa078e8cf6857ba99ca01a2d..5fe908727c0131bf5e04c6f5bc64f52c19a013a0 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java -@@ -24,8 +24,6 @@ import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData; - import net.minecraft.server.level.FullChunkStatus; - import net.minecraft.server.level.ServerLevel; - import net.minecraft.util.ProblemReporter; +@@ -28,8 +28,6 @@ import net.minecraft.util.ProblemReporter; + import net.minecraft.util.debug.DebugStructureInfo; + import net.minecraft.util.debug.DebugSubscriptions; + import net.minecraft.util.debug.DebugValueSource; -import net.minecraft.util.profiling.Profiler; -import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.Level; -@@ -385,12 +383,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -392,12 +390,8 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot } if (LightEngine.hasDifferentLightProperties(blockState, state)) { @@ -2245,7 +2258,7 @@ index 75578e6ed7233a03d9b6cd3c6d3997f1c6148392..b88254fb3c12b99684c6ede1ae8a6671 } boolean flag = !blockState.is(block); -@@ -922,8 +916,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -956,8 +950,6 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot BlockPos blockPos = this.blockEntity.getBlockPos(); if (LevelChunk.this.isTicking(blockPos)) { try { @@ -2254,7 +2267,7 @@ index 75578e6ed7233a03d9b6cd3c6d3997f1c6148392..b88254fb3c12b99684c6ede1ae8a6671 BlockState blockState = LevelChunk.this.getBlockState(blockPos); if (this.blockEntity.getType().isValid(blockState)) { this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity); -@@ -937,8 +929,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -971,8 +963,6 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot } // Paper end - Remove the Block Entity if it's invalid } @@ -2264,10 +2277,10 @@ index 75578e6ed7233a03d9b6cd3c6d3997f1c6148392..b88254fb3c12b99684c6ede1ae8a6671 // Paper start - Prevent block entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java -index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe 100644 +index b84c03cb0bddfc6fdc362a5e1432b25f67e7e23d..98abda72d88fb38a5427a15cc59094f3a7db30dc 100644 --- a/net/minecraft/world/level/pathfinder/PathFinder.java +++ b/net/minecraft/world/level/pathfinder/PathFinder.java -@@ -12,9 +12,6 @@ import java.util.function.Function; +@@ -13,9 +13,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -2277,17 +2290,17 @@ index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..c2baadcdceb1df6a881d6f73aa4eb4dd import net.minecraft.world.entity.Mob; import net.minecraft.world.level.PathNavigationRegion; -@@ -57,9 +54,6 @@ public class PathFinder { +@@ -62,9 +59,6 @@ public class PathFinder { @Nullable private Path findPath(Node node, List> positions, float maxRange, int accuracy, float searchDepthMultiplier) { // Paper - optimize collection - ProfilerFiller profilerFiller = Profiler.get(); - profilerFiller.push("find_path"); - profilerFiller.markForCharting(MetricCategory.PATH_FINDING); - // Set set = targetPositions.keySet(); // Paper + // Set set = targetPositions.keySet(); // Paper - unused node.g = 0.0F; node.h = this.getBestH(node, positions); // Paper - optimize collection -@@ -129,7 +123,6 @@ public class PathFinder { +@@ -136,7 +130,6 @@ public class PathFinder { best = path; } } diff --git a/leaf-server/minecraft-patches/features/0006-Use-platform-math-functions.patch b/leaf-server/minecraft-patches/features/0006-Use-platform-math-functions.patch index 256f08e2..d517d6bb 100644 --- a/leaf-server/minecraft-patches/features/0006-Use-platform-math-functions.patch +++ b/leaf-server/minecraft-patches/features/0006-Use-platform-math-functions.patch @@ -99,7 +99,7 @@ public class Main { ``` diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java -index ab3a221c115992d0f4ea921aa92cf0976b815ff4..75da3011058918e1da6936522f19a2ccdb843d73 100644 +index 0713d164851216483247da09ff7901f8bfbe2eb9..65ad3ea9439fed47766ec7576760380d259ddfe5 100644 --- a/net/minecraft/util/Mth.java +++ b/net/minecraft/util/Mth.java @@ -58,18 +58,15 @@ public class Mth { @@ -139,21 +139,4 @@ index ab3a221c115992d0f4ea921aa92cf0976b815ff4..75da3011058918e1da6936522f19a2cc + return (int) Math.ceil(value); // Gale - use platform math functions } - public static int clamp(int value, int min, int max) { -@@ -123,15 +118,7 @@ public class Mth { - } - - public static double absMax(double x, double y) { -- if (x < 0.0) { -- x = -x; -- } -- -- if (y < 0.0) { -- y = -y; -- } -- -- return Math.max(x, y); -+ return Math.max(Math.abs(x), Math.abs(y)); // Gale - use platform math functions - } - - public static int floorDiv(int dividend, int divisor) { + public static long ceilLong(double value) { diff --git a/leaf-server/minecraft-patches/features/0007-Faster-floating-point-positive-modulo.patch b/leaf-server/minecraft-patches/features/0007-Faster-floating-point-positive-modulo.patch index 77652834..c6ae8ced 100644 --- a/leaf-server/minecraft-patches/features/0007-Faster-floating-point-positive-modulo.patch +++ b/leaf-server/minecraft-patches/features/0007-Faster-floating-point-positive-modulo.patch @@ -9,10 +9,10 @@ Gale - https://galemc.org The JMH benchmark of this patch can be found in SunBox's `FasterFloatingPointPositiveModulo` diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java -index 75da3011058918e1da6936522f19a2ccdb843d73..1b60fa34e4d6a5c00a983bf94e4d16d1eb46c665 100644 +index 65ad3ea9439fed47766ec7576760380d259ddfe5..3cd7364363863bde9f7a89a5830d7cf80f2a045d 100644 --- a/net/minecraft/util/Mth.java +++ b/net/minecraft/util/Mth.java -@@ -149,14 +149,26 @@ public class Mth { +@@ -154,14 +154,26 @@ public class Mth { return Math.floorMod(x, y); } @@ -42,10 +42,10 @@ index 75da3011058918e1da6936522f19a2ccdb843d73..1b60fa34e4d6a5c00a983bf94e4d16d1 return number % multiple == 0; } diff --git a/net/minecraft/world/level/levelgen/blending/Blender.java b/net/minecraft/world/level/levelgen/blending/Blender.java -index 01e5b29d6e9a5c53c0e23b61ed0c1d7be1a0fe08..314a189e2099e3688fd23e7100120abea6886ccd 100644 +index 78c77a25c0e81496336611d6999cc0da05094ca2..c3edcedcc87f474cc1d40fcea23047662fce9739 100644 --- a/net/minecraft/world/level/levelgen/blending/Blender.java +++ b/net/minecraft/world/level/levelgen/blending/Blender.java -@@ -144,7 +144,7 @@ public class Blender { +@@ -149,7 +149,7 @@ public class Blender { private static double heightToOffset(double height) { double d = 1.0; double d1 = height + 0.5; diff --git a/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch b/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch index 8203eb83..1f006fc8 100644 --- a/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch +++ b/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch @@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java -index ee16a05b8b2747ce95fcae1616c96143a5dec74e..36124bfd4189e35208875e971733889410242641 100644 +index d538b1df2b07abd1c4257726891238696bf7a718..d4a8ec0effa773b85519f0d428e4f23181f36335 100644 --- a/net/minecraft/world/entity/projectile/Projectile.java +++ b/net/minecraft/world/entity/projectile/Projectile.java -@@ -50,6 +50,55 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -51,6 +51,55 @@ public abstract class Projectile extends Entity implements TraceableEntity { super(entityType, level); } @@ -89,4 +89,4 @@ index ee16a05b8b2747ce95fcae1616c96143a5dec74e..36124bfd4189e35208875e9717338894 + protected void setOwner(@Nullable EntityReference owner) { this.owner = owner; - } + this.refreshProjectileSource(false); // Paper diff --git a/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch b/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch index 00d6fda6..df01986c 100644 --- a/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch +++ b/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch @@ -19,10 +19,10 @@ require it to be initialized earlier. By moving it to the superclass, we initialize it earlier, ensuring that it is available sooner. diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 1413511500ce8ae25cc4af1d54fc33c8912c24bc..0665c2ec275086b8c555c550af93dfef197fba07 100644 +index 2a8d613a2c041ea1ed034d66b20955845a4c0255..d02ffa4ed99e44bdaa07bd1d7c7465007f667d3a 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -834,8 +834,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -864,8 +864,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } // Paper start - optimise random ticking @@ -32,10 +32,10 @@ index 1413511500ce8ae25cc4af1d54fc33c8912c24bc..0665c2ec275086b8c555c550af93dfef final LevelChunkSection[] sections = chunk.getSections(); final int minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection((ServerLevel)(Object)this); diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 9f630dda781dd540ab5655bd7ce916949eeee61c..19a9b37bad1d465440047cbde9a00b12ba5d9a4b 100644 +index 406f5f758370d3d53dcd32c1abc65d2851d2235e..9b6d21735c10d89b618c6ae4632e6b9ad34dc735 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -168,6 +168,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -174,6 +174,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl private int tileTickPosition; public final Map explosionDensityCache = new java.util.HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here diff --git a/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch b/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch index fc037015..db9203fd 100644 --- a/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch +++ b/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch @@ -52,10 +52,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index 6020b71802babb35ef60aca65afe9c2612c05bb7..e53440bd5f0e659db0745a009540520f6dc41238 100644 +index b0a699f967e4078dd1363261bfa58f519ec3d6c2..49595e4cc8de3200608d2e8afff52da64642e8b0 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -500,6 +500,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -495,6 +495,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon long l = gameTime - this.lastInhabitedUpdate; this.lastInhabitedUpdate = gameTime; if (!this.level.isDebug()) { @@ -64,10 +64,10 @@ index 6020b71802babb35ef60aca65afe9c2612c05bb7..e53440bd5f0e659db0745a009540520f this.tickChunks(l); // Gale - Purpur - remove vanilla profiler } diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 0665c2ec275086b8c555c550af93dfef197fba07..6bc70c1d53049a1f75268ab9944bfb1557ca74ee 100644 +index d02ffa4ed99e44bdaa07bd1d7c7465007f667d3a..413bc3ccd89cbf04b52c5e60fec2880f5ea72e32 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -883,13 +883,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -913,13 +913,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } // Paper end - optimise random ticking @@ -84,7 +84,7 @@ index 0665c2ec275086b8c555c550af93dfef197fba07..6bc70c1d53049a1f75268ab9944bfb15 for (int i = 0; i < randomTickSpeed; i++) { if (simpleRandom.nextInt(48) == 0) { // Paper - optimise random ticking this.tickPrecipitation(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15)); -@@ -907,7 +909,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -937,7 +939,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe boolean isRaining = this.isRaining(); int minBlockX = pos.getMinBlockX(); int minBlockZ = pos.getMinBlockZ(); @@ -94,10 +94,10 @@ index 0665c2ec275086b8c555c550af93dfef197fba07..6bc70c1d53049a1f75268ab9944bfb15 if (this.isRainingAt(blockPos)) { DifficultyInstance currentDifficultyAt = this.getCurrentDifficultyAt(blockPos); diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index b88254fb3c12b99684c6ede1ae8a6671ffbe9ad6..9e2debee38bc4b25281c8a8c6e7082cca1f7b569 100644 +index 5fe908727c0131bf5e04c6f5bc64f52c19a013a0..f7c0629c3495d048a19b14d54815b669dee95229 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java -@@ -128,6 +128,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -135,6 +135,18 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot } // Paper end - get block chunk optimisation @@ -116,7 +116,7 @@ index b88254fb3c12b99684c6ede1ae8a6671ffbe9ad6..9e2debee38bc4b25281c8a8c6e7082cc public LevelChunk(Level level, ChunkPos pos) { this(level, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, null, null, null); } -@@ -164,6 +176,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -171,6 +183,8 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot this.debug = !empty && this.level.isDebug(); this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE; // Paper end - get block chunk optimisation diff --git a/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch b/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch index 9f584756..c25d11c9 100644 --- a/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch +++ b/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch @@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java -index 4edd94ac765d2ab107612504b67e6e07da609313..9b0235c50426accde002cbb0a09a992f13b05cd7 100644 +index dcb49e8305aa8b9215da9f77fa147f701fdbbef0..9d23d413cc76f90c856387659169b4e9a44f690f 100644 --- a/net/minecraft/world/entity/monster/EnderMan.java +++ b/net/minecraft/world/entity/monster/EnderMan.java -@@ -296,11 +296,19 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -302,11 +302,19 @@ public class EnderMan extends Monster implements NeutralMob { private boolean teleport(double x, double y, double z) { BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(x, y, z); diff --git a/leaf-server/minecraft-patches/features/0015-Cache-on-climbable-check.patch b/leaf-server/minecraft-patches/features/0015-Cache-on-climbable-check.patch index 4f95f747..08fbf5fd 100644 --- a/leaf-server/minecraft-patches/features/0015-Cache-on-climbable-check.patch +++ b/leaf-server/minecraft-patches/features/0015-Cache-on-climbable-check.patch @@ -44,10 +44,10 @@ index ae2bb9a73106febfe5f0d090abd4252bbb5fd27e..eee9c41e40402e52b73f34a734b4cbde } if (entity instanceof final Mob mob && mob.getTarget() != null) { diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index c2f93f2e71ea5cab84a5821d952a6f90dc1068ed..bd22f0bca65be702a92641a95e944e43f882e440 100644 +index ca46c3a7ba5ffb6cd552cc1313db615c28bd7509..b51c565c9785bc22306380744f8f855ebe9e2b11 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -2115,6 +2115,21 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -2147,6 +2147,21 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin return this.lastClimbablePos; } diff --git a/leaf-server/minecraft-patches/features/0016-Make-EntityCollisionContext-a-live-representation.patch b/leaf-server/minecraft-patches/features/0016-Make-EntityCollisionContext-a-live-representation.patch index 050a9800..780f6d68 100644 --- a/leaf-server/minecraft-patches/features/0016-Make-EntityCollisionContext-a-live-representation.patch +++ b/leaf-server/minecraft-patches/features/0016-Make-EntityCollisionContext-a-live-representation.patch @@ -40,28 +40,29 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/net/minecraft/world/phys/shapes/EntityCollisionContext.java b/net/minecraft/world/phys/shapes/EntityCollisionContext.java -index ebc9360ea64a248418fcac8b446664b0dd019335..b09d1b7c76410580663f2419e3b5e917fedabd54 100644 +index a2467db9f096368810e3c1ab8ddabf610fa38379..59edec180a3f2aa4665e380651b213bcd0d45cba 100644 --- a/net/minecraft/world/phys/shapes/EntityCollisionContext.java +++ b/net/minecraft/world/phys/shapes/EntityCollisionContext.java -@@ -19,27 +19,39 @@ public class EntityCollisionContext implements CollisionContext { - return canAscend; - } - }; +@@ -12,27 +12,41 @@ import net.minecraft.world.level.block.state.BlockState; + import net.minecraft.world.level.material.FluidState; + + public class EntityCollisionContext implements CollisionContext { + // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them + /* private final boolean descending; private final double entityBottom; private final boolean placement; private final ItemStack heldItem; - private final Predicate canStandOnFluid; + private final boolean alwaysCollideWithFluid; + */ -+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them + private final boolean placement; ++ private final boolean alwaysCollideWithFluid; ++ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them @Nullable private final Entity entity; protected EntityCollisionContext( - boolean descending, boolean placement, double entityBottom, ItemStack heldItem, Predicate canStandOnFluid, @Nullable Entity entity + boolean descending, boolean placement, double entityBottom, ItemStack heldItem, boolean alwaysCollideWithFluid, @Nullable Entity entity ) { + // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them + /* @@ -69,10 +70,11 @@ index ebc9360ea64a248418fcac8b446664b0dd019335..b09d1b7c76410580663f2419e3b5e917 this.placement = placement; this.entityBottom = entityBottom; this.heldItem = heldItem; - this.canStandOnFluid = canStandOnFluid; + this.alwaysCollideWithFluid = alwaysCollideWithFluid; + */ -+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them + this.placement = placement; ++ this.alwaysCollideWithFluid = alwaysCollideWithFluid; ++ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them this.entity = entity; } @@ -83,12 +85,13 @@ index ebc9360ea64a248418fcac8b446664b0dd019335..b09d1b7c76410580663f2419e3b5e917 this( entity.isDescending(), placement, -@@ -50,16 +62,20 @@ public class EntityCollisionContext implements CollisionContext { - : (entity instanceof LivingEntity livingEntity ? fluidState -> livingEntity.canStandOnFluid(fluidState) : fluidState -> false), +@@ -41,11 +55,16 @@ public class EntityCollisionContext implements CollisionContext { + canStandOnFluid, entity ); + */ + this.placement = placement; ++ this.alwaysCollideWithFluid = canStandOnFluid; + this.entity = entity; + // Gale end - Airplane - make EntityCollisionContext a live representation - remove unneeded things } @@ -100,13 +103,7 @@ index ebc9360ea64a248418fcac8b446664b0dd019335..b09d1b7c76410580663f2419e3b5e917 } @Override - public boolean canStandOnFluid(FluidState fluid1, FluidState fluid2) { -- return this.canStandOnFluid.test(fluid2) && !fluid1.getType().isSame(fluid2.getType()); -+ return this.entity instanceof LivingEntity livingEntity && livingEntity.canStandOnFluid(fluid2) && !fluid1.getType().isSame(fluid2.getType()); // Gale - Airplane - make EntityCollisionContext a live representation - } - - @Override -@@ -69,12 +85,12 @@ public class EntityCollisionContext implements CollisionContext { +@@ -65,12 +84,12 @@ public class EntityCollisionContext implements CollisionContext { @Override public boolean isDescending() { diff --git a/leaf-server/minecraft-patches/features/0017-Better-checking-for-useless-move-packets.patch b/leaf-server/minecraft-patches/features/0017-Better-checking-for-useless-move-packets.patch index 269068a5..992dc2a4 100644 --- a/leaf-server/minecraft-patches/features/0017-Better-checking-for-useless-move-packets.patch +++ b/leaf-server/minecraft-patches/features/0017-Better-checking-for-useless-move-packets.patch @@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java -index e958972ca09eb0ab07d81990e661076ab0371850..5df8ee3955593e70f0e67e91431e464d177bdeeb 100644 +index 39daebffb12628a47c8e7c3055ecb911e457917e..29ded5aa70a4a2d6de4533e487170eaf0dc61fdf 100644 --- a/net/minecraft/server/level/ServerEntity.java +++ b/net/minecraft/server/level/ServerEntity.java -@@ -193,19 +193,25 @@ public class ServerEntity { +@@ -181,19 +181,25 @@ public class ServerEntity { packet = ClientboundEntityPositionSyncPacket.of(this.entity); flag3 = true; flag4 = true; diff --git a/leaf-server/minecraft-patches/features/0019-Remove-lambda-from-ticking-guard.patch b/leaf-server/minecraft-patches/features/0019-Remove-lambda-from-ticking-guard.patch index 9d6148ac..41e64674 100644 --- a/leaf-server/minecraft-patches/features/0019-Remove-lambda-from-ticking-guard.patch +++ b/leaf-server/minecraft-patches/features/0019-Remove-lambda-from-ticking-guard.patch @@ -33,10 +33,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 6bc70c1d53049a1f75268ab9944bfb1557ca74ee..a9c2f419200483673f6743ed94af110a8e875e71 100644 +index 413bc3ccd89cbf04b52c5e60fec2880f5ea72e32..24f3954645dfd5142de2f2ae964ba5caf12582ac 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -788,7 +788,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -809,7 +809,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe entity.stopRiding(); } @@ -58,10 +58,10 @@ index 6bc70c1d53049a1f75268ab9944bfb1557ca74ee..a9c2f419200483673f6743ed94af110a } } diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index a4c915c8fdd167bfa2c5ef20c5ec7acc53c89726..a0254e85fccebb66ce02bd58f9d461addd8ad73d 100644 +index 9b6d21735c10d89b618c6ae4632e6b9ad34dc735..e49d7bc1b060ee3922bb171ba0e7723148c601df 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -1489,10 +1489,10 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -1443,10 +1443,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl 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, var6); getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, var6))); // Paper - ServerExceptionEvent diff --git a/leaf-server/minecraft-patches/features/0020-SIMD-support.patch b/leaf-server/minecraft-patches/features/0020-SIMD-support.patch index bb1bb191..2ee7cf9e 100644 --- a/leaf-server/minecraft-patches/features/0020-SIMD-support.patch +++ b/leaf-server/minecraft-patches/features/0020-SIMD-support.patch @@ -13,10 +13,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java -index b63f1b27c60faf90b3d991b9a88b0642afa29a93..38266ae67c440e94d30cd16ab09232906e1e8d7d 100644 +index 1e8aec79decfe160e8c19b907f1441637b2832be..f58799f368071b1a7bc3b5814261177c002d13f6 100644 --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -190,6 +190,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -283,6 +283,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now @@ -27,6 +27,6 @@ index b63f1b27c60faf90b3d991b9a88b0642afa29a93..38266ae67c440e94d30cd16ab0923290 + } catch (Throwable ignored) {} + // Gale end - Pufferfish - SIMD support + - this.setPvpAllowed(properties.pvp); - this.setFlightAllowed(properties.allowFlight); - this.setMotd(properties.motd); + // this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading + LOGGER.info("Default game type: {}", properties.gameMode.get()); + // Paper start - Unix domain socket support diff --git a/leaf-server/minecraft-patches/features/0021-Make-book-writing-configurable.patch b/leaf-server/minecraft-patches/features/0021-Make-book-writing-configurable.patch index c0c3a1dd..0fd2244e 100644 --- a/leaf-server/minecraft-patches/features/0021-Make-book-writing-configurable.patch +++ b/leaf-server/minecraft-patches/features/0021-Make-book-writing-configurable.patch @@ -22,10 +22,10 @@ you to easily disable books, should you want to preemptively remove this functionality before additional exploits are found. diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ca13dd72f173be6714965c506f2d48dcd3c9e569..81d6bad5ef230de7852c79a607eb2f5aa32768da 100644 +index edbf335a758c2bdd4b581e57fc3167bb0341e00a..8a4256925045f70990805c4bef1e5f8de2beea37 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1269,6 +1269,11 @@ public class ServerGamePacketListenerImpl +@@ -1275,6 +1275,11 @@ public class ServerGamePacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { diff --git a/leaf-server/minecraft-patches/features/0022-Reduce-in-wall-checks.patch b/leaf-server/minecraft-patches/features/0022-Reduce-in-wall-checks.patch index 303458d1..76208512 100644 --- a/leaf-server/minecraft-patches/features/0022-Reduce-in-wall-checks.patch +++ b/leaf-server/minecraft-patches/features/0022-Reduce-in-wall-checks.patch @@ -28,11 +28,11 @@ but is so much cheaper than the suffocation check that it's worth keeping it. diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index bd22f0bca65be702a92641a95e944e43f882e440..1b7d8a8838e9b75bc12ce4b9f30429110e9af913 100644 +index b51c565c9785bc22306380744f8f855ebe9e2b11..6bd80817991a0f21d650c89e24193e4c4f98769e 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -433,7 +433,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin - +@@ -436,7 +436,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + super.baseTick(); if (this.isAlive() && this.level() instanceof ServerLevel serverLevel1) { boolean flag = this instanceof Player; - if (this.isInWall()) { @@ -42,8 +42,8 @@ index bd22f0bca65be702a92641a95e944e43f882e440..1b7d8a8838e9b75bc12ce4b9f3042911 + // Gale end - Pufferfish - reduce in wall checks this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F); } else if (flag && !serverLevel1.getWorldBorder().isWithinBounds(this.getBoundingBox())) { - double d = serverLevel1.getWorldBorder().getDistanceToBorder(this) + serverLevel1.getWorldBorder().getDamageSafeZone(); -@@ -1399,6 +1402,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + double d = serverLevel1.getWorldBorder().getDistanceToBorder(this) + serverLevel1.getWorldBorder().getSafeZone(); +@@ -1406,6 +1409,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin return this.getHealth() <= 0.0F; } diff --git a/leaf-server/minecraft-patches/features/0026-Reduce-hopper-item-checks.patch b/leaf-server/minecraft-patches/features/0026-Reduce-hopper-item-checks.patch index 9191909b..0a90d496 100644 --- a/leaf-server/minecraft-patches/features/0026-Reduce-hopper-item-checks.patch +++ b/leaf-server/minecraft-patches/features/0026-Reduce-hopper-item-checks.patch @@ -17,10 +17,10 @@ Licensed under: MIT (https://opensource.org/licenses/MIT) Only do an item "suck in" action once per second diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java -index 51804b611f469f2ab53e455e8c633b867b00cc88..fcb1f6806908eb66592dc52f2b57286498cf7032 100644 +index e9a7630b7f2a4b49e2794fcd64dc19b7002d27a1..8b176f5783d810b41a37db09b328992157986099 100644 --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java -@@ -148,7 +148,13 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -139,7 +139,13 @@ public class ItemEntity extends Entity implements TraceableEntity { } // CraftBukkit end this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause @@ -34,7 +34,7 @@ index 51804b611f469f2ab53e455e8c633b867b00cc88..fcb1f6806908eb66592dc52f2b572864 } // Paper end - EAR 2 -@@ -232,9 +238,31 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -223,9 +229,31 @@ public class ItemEntity extends Entity implements TraceableEntity { } // CraftBukkit end this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause @@ -67,7 +67,7 @@ index 51804b611f469f2ab53e455e8c633b867b00cc88..fcb1f6806908eb66592dc52f2b572864 @Override public BlockPos getBlockPosBelowThatAffectsMyMovement() { diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java -index 41a6ec508a10a49a37539d2f10171d15c233b280..fb099517927f3c2699a348ea7692772c5420b8d1 100644 +index 99e7fad89a55909e345e15b3bec0b10471a72f22..a0928f913ec3863198d09f09b65119f7702852e6 100644 --- a/net/minecraft/world/entity/vehicle/MinecartHopper.java +++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java @@ -23,6 +23,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper @@ -105,10 +105,10 @@ index 484c2ba2752fbf3ad929e46c2f078e906f6f0637..6ced5a7e27703a7cf5a7495dc3a1a290 double getLevelY(); diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 01ed25d1f895d94485b5fecd98476534cbb26930..c1fcd9e0ab47332ce48e391c6cd1455960340df3 100644 +index 28348e3881c3c8591053a01b193fb2a956f79726..737344e0ca9babd4aaafb6c162eb44df920fac98 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -544,7 +544,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -545,7 +545,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen return false; } else { boolean flag = hopper.isGridAligned() && blockState.isCollisionShapeFullBlock(level, blockPos) && !blockState.is(BlockTags.DOES_NOT_BLOCK_HOPPERS); @@ -117,7 +117,7 @@ index 01ed25d1f895d94485b5fecd98476534cbb26930..c1fcd9e0ab47332ce48e391c6cd14559 for (ItemEntity itemEntity : getItemsAtAndAbove(level, hopper)) { if (addItem(hopper, itemEntity)) { return true; -@@ -822,6 +822,34 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -823,6 +823,34 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen return stack1.getCount() < stack1.getMaxStackSize() && ItemStack.isSameItemSameComponents(stack1, stack2); // Paper - Perf: Optimize Hoppers; used to return true for full itemstacks?! } diff --git a/leaf-server/minecraft-patches/features/0029-Do-not-process-chat-commands-before-player-has-joine.patch b/leaf-server/minecraft-patches/features/0029-Do-not-process-chat-commands-before-player-has-joine.patch index e6ba981b..cf1ff451 100644 --- a/leaf-server/minecraft-patches/features/0029-Do-not-process-chat-commands-before-player-has-joine.patch +++ b/leaf-server/minecraft-patches/features/0029-Do-not-process-chat-commands-before-player-has-joine.patch @@ -13,24 +13,24 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 822691293834c4da31adb2573fbc87467db2daa5..917908e69154c5c5c9f847ae47548ee3d9221bc2 100644 +index 2edec1f0a6b456959139f897c41d96af55365156..636f9ae7320a9f4a06459b2e8682099f309fa3f7 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -424,6 +424,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -437,6 +437,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc public boolean sentListPacket = false; - public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready + public boolean suppressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready // CraftBukkit end + public boolean didPlayerJoinEvent = false; // Gale - EMC - do not process chat/commands before player has joined public boolean isRealPlayer; // Paper public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 81d6bad5ef230de7852c79a607eb2f5aa32768da..08c0b02e8f70dfc349da2b534435b5f09f99e2b8 100644 +index 8a4256925045f70990805c4bef1e5f8de2beea37..e318003a58db37d5d278e7f6a35f6a2983d3e673 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2443,7 +2443,7 @@ public class ServerGamePacketListenerImpl +@@ -2450,7 +2450,7 @@ public class ServerGamePacketListenerImpl this.disconnectAsync(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add proper async disconnect - } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales + } else if (this.player.isRemoved() || (!bypassHiddenChat && this.player.getChatVisibility() == ChatVisiblity.HIDDEN)) { // CraftBukkit - dead men tell no tales this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); - } else { + } else if (player.didPlayerJoinEvent) { // Gale - EMC - do not process chat/commands before player has joined @@ -38,15 +38,15 @@ index 81d6bad5ef230de7852c79a607eb2f5aa32768da..08c0b02e8f70dfc349da2b534435b5f0 // CraftBukkit start if (sync) { diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 33b1a6fdf169001093642cc8200d2789e80692b0..c0129b6e5c74a5412546c167fb03b705686c996f 100644 +index cacd56bfe256f34b3d9211fea8bd9c933fad11cb..0ed0e3db7909fe0a24a405ab96cc5e3067eb011c 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -335,6 +335,8 @@ public abstract class PlayerList { - return; - } +@@ -238,6 +238,8 @@ public abstract class PlayerList { + return; + } -+ player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined ++ player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined + - final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); + final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); - if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure + if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure diff --git a/leaf-server/minecraft-patches/features/0031-Do-not-log-empty-message-warnings.patch b/leaf-server/minecraft-patches/features/0031-Do-not-log-empty-message-warnings.patch index a1d8480c..dc16ffb8 100644 --- a/leaf-server/minecraft-patches/features/0031-Do-not-log-empty-message-warnings.patch +++ b/leaf-server/minecraft-patches/features/0031-Do-not-log-empty-message-warnings.patch @@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 08c0b02e8f70dfc349da2b534435b5f09f99e2b8..7b4eb3773bc88cc5b5287b55388a4dab2a2f562b 100644 +index e318003a58db37d5d278e7f6a35f6a2983d3e673..4bbf8c56f71f68cc7062927aafe59ac85b1ada12 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2525,7 +2525,7 @@ public class ServerGamePacketListenerImpl +@@ -2532,7 +2532,7 @@ public class ServerGamePacketListenerImpl // CraftBukkit start String rawMessage = message.signedContent(); if (rawMessage.isEmpty()) { diff --git a/leaf-server/minecraft-patches/features/0036-Do-not-log-Not-Secure-marker.patch b/leaf-server/minecraft-patches/features/0036-Do-not-log-Not-Secure-marker.patch index 3641843a..9b1a591b 100644 --- a/leaf-server/minecraft-patches/features/0036-Do-not-log-Not-Secure-marker.patch +++ b/leaf-server/minecraft-patches/features/0036-Do-not-log-Not-Secure-marker.patch @@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index c0129b6e5c74a5412546c167fb03b705686c996f..0509c3b79a01a18ddb1a6ed41c1668ee5d3c50e7 100644 +index 0ed0e3db7909fe0a24a405ab96cc5e3067eb011c..31fd2ce06f173db7228e5addb6e3cf407df4cadc 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -1256,7 +1256,7 @@ public abstract class PlayerList { +@@ -1180,7 +1180,7 @@ public abstract class PlayerList { public void broadcastChatMessage(PlayerChatMessage message, Predicate shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function unsignedFunction) { // Paper end boolean flag = this.verifyChatTrusted(message); diff --git a/leaf-server/minecraft-patches/features/0037-Do-not-log-disconnections-with-null-id.patch b/leaf-server/minecraft-patches/features/0037-Do-not-log-disconnections-with-null-id.patch index b5c0489c..c18122ec 100644 --- a/leaf-server/minecraft-patches/features/0037-Do-not-log-disconnections-with-null-id.patch +++ b/leaf-server/minecraft-patches/features/0037-Do-not-log-disconnections-with-null-id.patch @@ -17,10 +17,10 @@ Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) This can help to hide annoying scanning bots from showing up in console. diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index ebf4d4516233c002b33084f1679044b23869d848..5bac1c0ba691e516f2d603583971df7fe7ac212c 100644 +index c5d071c591c844b11667013131d1d3bae8e3bac6..c2ce73976568bc1538ea82d70175e004943b4585 100644 --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -124,6 +124,15 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -125,6 +125,15 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, public void disconnect(Component reason) { try { diff --git a/leaf-server/minecraft-patches/features/0038-Do-not-log-run-as-root-warning.patch b/leaf-server/minecraft-patches/features/0038-Do-not-log-run-as-root-warning.patch index 28a06993..2c7f1497 100644 --- a/leaf-server/minecraft-patches/features/0038-Do-not-log-run-as-root-warning.patch +++ b/leaf-server/minecraft-patches/features/0038-Do-not-log-run-as-root-warning.patch @@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java -index 38266ae67c440e94d30cd16ab09232906e1e8d7d..e7e4262981bcbf75a5c6a76f4588c91de15bf975 100644 +index f58799f368071b1a7bc3b5814261177c002d13f6..ab2c4451374916faf62bf3859b40cc513197de38 100644 --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -142,7 +142,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -235,7 +235,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } // Paper start - detect running as root diff --git a/leaf-server/minecraft-patches/features/0039-Do-not-log-offline-mode-warning.patch b/leaf-server/minecraft-patches/features/0039-Do-not-log-offline-mode-warning.patch index bb7e4ba8..61833435 100644 --- a/leaf-server/minecraft-patches/features/0039-Do-not-log-offline-mode-warning.patch +++ b/leaf-server/minecraft-patches/features/0039-Do-not-log-offline-mode-warning.patch @@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java -index e7e4262981bcbf75a5c6a76f4588c91de15bf975..9c8d88e81ad9d06966bcec0ef134c8e658b9b51e 100644 +index ab2c4451374916faf62bf3859b40cc513197de38..42fedf1f09d72303cad70d96ba6fced4b9be052d 100644 --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -253,7 +253,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -341,7 +341,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord"; String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/"; // Paper end - Add Velocity IP Forwarding Support diff --git a/leaf-server/minecraft-patches/features/0043-Make-arrow-movement-resetting-despawn-counter-config.patch b/leaf-server/minecraft-patches/features/0043-Make-arrow-movement-resetting-despawn-counter-config.patch index 3873ff46..446cc60e 100644 --- a/leaf-server/minecraft-patches/features/0043-Make-arrow-movement-resetting-despawn-counter-config.patch +++ b/leaf-server/minecraft-patches/features/0043-Make-arrow-movement-resetting-despawn-counter-config.patch @@ -42,10 +42,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java -index 11adb3eacce9d46f15e6c5216e9b2494df158baf..fe738894f82480c6a7c2ff8fde895daaa0ba8bc6 100644 +index 7e1dd3c6a2f8852ab4471e0331f590d4c2015cfc..e21f08b8e073794cb4c7e3378894cc4a23dd53bf 100644 --- a/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -349,7 +349,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -350,7 +350,7 @@ public abstract class AbstractArrow extends Projectile { this.setInGround(false); Vec3 deltaMovement = this.getDeltaMovement(); this.setDeltaMovement(deltaMovement.multiply(this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F)); diff --git a/leaf-server/minecraft-patches/features/0044-Make-logging-login-locations-configurable.patch b/leaf-server/minecraft-patches/features/0044-Make-logging-login-locations-configurable.patch index a90a2e55..cd141d2d 100644 --- a/leaf-server/minecraft-patches/features/0044-Make-logging-login-locations-configurable.patch +++ b/leaf-server/minecraft-patches/features/0044-Make-logging-login-locations-configurable.patch @@ -13,20 +13,26 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 0509c3b79a01a18ddb1a6ed41c1668ee5d3c50e7..f4a73d3f56d6a10493752653bd50c8caeda63a94 100644 +index 31fd2ce06f173db7228e5addb6e3cf407df4cadc..2406f4d7debd0615ddfa40a307b29edac11451b7 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -403,7 +403,13 @@ public abstract class PlayerList { - scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); - } - // Paper end - Configurable player collision -+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable - PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); -+ // Gale start - JettPack - make logging login location configurable -+ } else { -+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), loggableAddress, player.getId()); -+ } -+ // Gale end - JettPack - make logging login location configurable - // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead - if (player.isDeadOrDying()) { - net.minecraft.core.Holder plains = serverLevel.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME) +@@ -306,6 +306,7 @@ public abstract class PlayerList { + scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); + } + // Paper end - Configurable player collision ++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable + // CraftBukkit start - moved down + LOGGER.info( + "{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // CraftBukkit - add world name +@@ -318,6 +319,11 @@ public abstract class PlayerList { + player.getZ() + ); + // CraftBukkit end - moved down ++ // Gale start - JettPack - make logging login location configurable ++ } else { ++ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getPlainTextName(), loggableAddress, player.getId()); ++ } ++ // Gale end - JettPack - make logging login location configurable + // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead + if (player.isDeadOrDying()) { + net.minecraft.core.Holder plains = serverLevel.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME) diff --git a/leaf-server/minecraft-patches/features/0045-Reduce-array-allocations.patch b/leaf-server/minecraft-patches/features/0045-Reduce-array-allocations.patch index 88535dee..8aa7ba26 100644 --- a/leaf-server/minecraft-patches/features/0045-Reduce-array-allocations.patch +++ b/leaf-server/minecraft-patches/features/0045-Reduce-array-allocations.patch @@ -57,7 +57,7 @@ index b2bcfb3557a0326fd7ec1059f95d6da4568dfd80..fee4a7452178c274eb835d758b718d8e } else { this.storage = Arrays.copyOf(this.storage, this.storage.length * 2); diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java -index 82824ae7ffbced513a8bcace684af94916135e84..47a600204ae1a1e7f166284dc26a1a7afc1dbecc 100644 +index a42938e1abd371dba6806e65552fde71b178a096..7960594a8ee61fbd223ad5df3c50a4dcd35427cb 100644 --- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java +++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java @@ -19,10 +19,8 @@ import net.minecraft.world.level.entity.LevelCallback; @@ -127,7 +127,7 @@ index 121685cacef111fbec0057d386f748497bc3a36d..b4a4fafec1a8e279ec1e31e58fee2d5d protected CipherBase(Cipher cipher) { this.cipher = cipher; diff --git a/net/minecraft/network/chat/contents/TranslatableContents.java b/net/minecraft/network/chat/contents/TranslatableContents.java -index 8ef16f98996b1ec0c9c3f158248ac95f1b07328f..6780b2493d625603b74e635c4996bb8303ce5b9a 100644 +index db7bb1dbd485ec51a0131caa10682330312a2778..4900efb298a5ff6b24926dff88543d48d7338bd5 100644 --- a/net/minecraft/network/chat/contents/TranslatableContents.java +++ b/net/minecraft/network/chat/contents/TranslatableContents.java @@ -29,7 +29,7 @@ import net.minecraft.util.ExtraCodecs; @@ -140,10 +140,10 @@ index 8ef16f98996b1ec0c9c3f158248ac95f1b07328f..6780b2493d625603b74e635c4996bb83 private static final Codec ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC) .xmap( diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java -index 5df8ee3955593e70f0e67e91431e464d177bdeeb..b7581796dda77bca66c03e421f2a83a920f44ef1 100644 +index 29ded5aa70a4a2d6de4533e487170eaf0dc61fdf..4e1a33e27f4fcfb21991ac71f8ab4ceb08f899bf 100644 --- a/net/minecraft/server/level/ServerEntity.java +++ b/net/minecraft/server/level/ServerEntity.java -@@ -366,7 +366,7 @@ public class ServerEntity { +@@ -347,7 +347,7 @@ public class ServerEntity { if (this.entity instanceof LivingEntity livingEntityx) { List> list = Lists.newArrayList(); @@ -153,10 +153,10 @@ index 5df8ee3955593e70f0e67e91431e464d177bdeeb..b7581796dda77bca66c03e421f2a83a9 if (!itemBySlot.isEmpty()) { list.add(Pair.of(equipmentSlot, itemBySlot.copy())); diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index a9c2f419200483673f6743ed94af110a8e875e71..617eb1b9d30d499124576c5d7cb5152571cc6b84 100644 +index 24f3954645dfd5142de2f2ae964ba5caf12582ac..75d0ba4e2407b6b10c14b33fe6c50108be1dad8b 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -1228,7 +1228,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1258,7 +1258,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe public static List getCurrentlyTickingEntities() { Entity ticking = currentlyTickingEntity.get(); @@ -166,10 +166,10 @@ index a9c2f419200483673f6743ed94af110a8e875e71..617eb1b9d30d499124576c5d7cb51525 return ret; } diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 917908e69154c5c5c9f847ae47548ee3d9221bc2..e4976eff4d18a1a1a752956c7e214122ddb05401 100644 +index 636f9ae7320a9f4a06459b2e8682099f309fa3f7..8f9ca82adea0c07fef37b3b800ddeebbe3d29c21 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -1104,7 +1104,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1210,7 +1210,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.getInventory().getNonEquipmentItems().set(i, net.minecraft.world.item.ItemStack.EMPTY); } } @@ -179,10 +179,10 @@ index 917908e69154c5c5c9f847ae47548ee3d9221bc2..e4976eff4d18a1a1a752956c7e214122 this.getInventory().equipment.set(value, net.minecraft.world.item.ItemStack.EMPTY); } diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7b4eb3773bc88cc5b5287b55388a4dab2a2f562b..a2e43621a9ad2eb7eef0b4a5d7c9bf0f627b9bc9 100644 +index 4bbf8c56f71f68cc7062927aafe59ac85b1ada12..4415125bef926f39e8904400242b8afcd65162d0 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2795,7 +2795,7 @@ public class ServerGamePacketListenerImpl +@@ -2802,7 +2802,7 @@ public class ServerGamePacketListenerImpl // SPIGOT-7136 - Allays if (target instanceof net.minecraft.world.entity.animal.allay.Allay || target instanceof net.minecraft.world.entity.animal.horse.AbstractHorse) { // Paper - Fix horse armor desync ServerGamePacketListenerImpl.this.send(new net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket( @@ -192,10 +192,10 @@ index 7b4eb3773bc88cc5b5287b55388a4dab2a2f562b..a2e43621a9ad2eb7eef0b4a5d7c9bf0f .collect(Collectors.toList()), true)); // Paper - sanitize player.containerMenu.sendAllDataToRemote(); diff --git a/net/minecraft/server/players/StoredUserList.java b/net/minecraft/server/players/StoredUserList.java -index d445e8f126f077d8419c52fa5436ea963a1a42a4..39483f7b453d6faedeccc1ab1eda76669395ea5a 100644 +index 7ba3f7937d9c51690b735f26fb45dc0a8f94b31f..4488de18871e412556976048a0d2982fb75d91e1 100644 --- a/net/minecraft/server/players/StoredUserList.java +++ b/net/minecraft/server/players/StoredUserList.java -@@ -70,7 +70,7 @@ public abstract class StoredUserList> { +@@ -97,7 +97,7 @@ public abstract class StoredUserList> { } public String[] getUserList() { @@ -218,7 +218,7 @@ index 09fd99c9cbd23b5f3c899bfb00c9b89651948ed8..5c1103ef028e5ffe6ce0eadc861dd3b2 public ZeroBitStorage(int size) { diff --git a/net/minecraft/world/entity/ConversionType.java b/net/minecraft/world/entity/ConversionType.java -index 3eea236bd1fd401fefdf7c5cc553a3db335029c7..3739272cbc73b7c4f15a2fbe874905cf06175f64 100644 +index ba24d1b56d4923d740330fad65bbc1097df49f0f..c009fd0c03e15e86fd25cbd04f769619c53dab8b 100644 --- a/net/minecraft/world/entity/ConversionType.java +++ b/net/minecraft/world/entity/ConversionType.java @@ -37,7 +37,7 @@ public enum ConversionType { @@ -231,10 +231,10 @@ index 3eea236bd1fd401fefdf7c5cc553a3db335029c7..3739272cbc73b7c4f15a2fbe874905cf if (!itemBySlot.isEmpty()) { newMob.setItemSlot(equipmentSlot, itemBySlot.copyAndClear()); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index f22af336ac2949a91a6aebde6eaf4fef8545cb59..e81774a2fbcafb5909b966f71d31379c8b5a7426 100644 +index f871c40148fdb6b0798ea2e3291fc92b886f98a7..13ffe66a5161188c253f71c6ed5264261d886b74 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -3076,7 +3076,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3123,7 +3123,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name } private boolean attemptToShearEquipment(Player player, InteractionHand hand, ItemStack stack, Mob mob) { @@ -289,10 +289,10 @@ index b383836c200ca9f7bd84639367aa81b57868fb25..3af4a6dcc81afaf2860325fe5852c9a9 private static Map createForAllSlots(List equipmentSlots, float dropChance) { diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 1b7d8a8838e9b75bc12ce4b9f30429110e9af913..82354cc62df5b7793ef13c6731d84457cee42092 100644 +index 6bd80817991a0f21d650c89e24193e4c4f98769e..c4bda5d975cce38a725b8590261d97fcfac3d95d 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3358,7 +3358,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3390,7 +3390,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin Map equipmentChanges = null; // Paper end - EntityEquipmentChangedEvent @@ -301,7 +301,7 @@ index 1b7d8a8838e9b75bc12ce4b9f30429110e9af913..82354cc62df5b7793ef13c6731d84457 ItemStack itemStack = this.lastEquipmentItems.get(equipmentSlot); ItemStack itemBySlot = this.getItemBySlot(equipmentSlot); if (this.equipmentHasChanged(itemStack, itemBySlot)) { -@@ -3630,7 +3630,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3662,7 +3662,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin public boolean canGlide() { if (!this.onGround() && !this.isPassenger() && !this.hasEffect(MobEffects.LEVITATION)) { @@ -311,10 +311,10 @@ index 1b7d8a8838e9b75bc12ce4b9f30429110e9af913..82354cc62df5b7793ef13c6731d84457 return true; } diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java -index c620341e33dc1805f1c033a969d0a15e1484c176..4aec1fd4efbb3dd139542c55d06503716723f326 100644 +index 925cb690e3c6dfd558aab355e33dd2505f0ec427..65a406b6684117d2379033ce09808543303ef374 100644 --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -339,7 +339,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -349,7 +349,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab if (this.xpReward > 0) { int i = this.xpReward; @@ -323,7 +323,7 @@ index c620341e33dc1805f1c033a969d0a15e1484c176..4aec1fd4efbb3dd139542c55d0650371 if (equipmentSlot.canIncreaseExperience()) { ItemStack itemBySlot = this.getItemBySlot(equipmentSlot); if (!itemBySlot.isEmpty() && this.dropChances.byEquipment(equipmentSlot) <= 1.0F) { -@@ -963,7 +963,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -969,7 +969,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab protected void dropCustomDeathLoot(ServerLevel level, DamageSource damageSource, boolean recentlyHit) { super.dropCustomDeathLoot(level, damageSource, recentlyHit); @@ -332,7 +332,7 @@ index c620341e33dc1805f1c033a969d0a15e1484c176..4aec1fd4efbb3dd139542c55d0650371 if (this.shouldSkipLoot(equipmentSlot)) continue; // Paper ItemStack itemBySlot = this.getItemBySlot(equipmentSlot); float f = this.dropChances.byEquipment(equipmentSlot); -@@ -1007,7 +1007,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1013,7 +1013,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab public Set dropPreservedEquipment(ServerLevel level, Predicate filter) { Set set = new HashSet<>(); @@ -341,7 +341,7 @@ index c620341e33dc1805f1c033a969d0a15e1484c176..4aec1fd4efbb3dd139542c55d0650371 ItemStack itemBySlot = this.getItemBySlot(equipmentSlot); if (!itemBySlot.isEmpty()) { if (!filter.test(itemBySlot)) { -@@ -1135,7 +1135,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1144,7 +1144,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab protected void populateDefaultEquipmentEnchantments(ServerLevelAccessor level, RandomSource random, DifficultyInstance difficulty) { this.enchantSpawnedWeapon(level, random, difficulty); @@ -350,7 +350,7 @@ index c620341e33dc1805f1c033a969d0a15e1484c176..4aec1fd4efbb3dd139542c55d0650371 if (equipmentSlot.getType() == EquipmentSlot.Type.HUMANOID_ARMOR) { this.enchantSpawnedArmor(level, random, equipmentSlot, difficulty); } -@@ -1552,7 +1552,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1571,7 +1571,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab protected void removeAfterChangingDimensions() { super.removeAfterChangingDimensions(); @@ -360,7 +360,7 @@ index c620341e33dc1805f1c033a969d0a15e1484c176..4aec1fd4efbb3dd139542c55d0650371 if (!itemBySlot.isEmpty()) { itemBySlot.setCount(0); diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java -index 5ee368580d878a3845349c3d50cc0dc549c42cab..9952e84dd94b8773c5ba8fcc4526e7714ebc2136 100644 +index a82fb56e876df9cbc95b16f81021d12fcb3b146c..041126086d1f4be6ed3a54337ed1c909044fba0c 100644 --- a/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/net/minecraft/world/entity/decoration/ArmorStand.java @@ -456,7 +456,7 @@ public class ArmorStand extends LivingEntity { @@ -382,10 +382,10 @@ index 5ee368580d878a3845349c3d50cc0dc549c42cab..9952e84dd94b8773c5ba8fcc4526e771 } } diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index e5e08dbefead90e9fe2bb05e4f0257f7aa4c0686..5160c349f1ace36d6de11f23e0f957f37fc19165 100644 +index 1bebcdf328cb83d8a2f754eeb13936bbc4abf204..7984529672ec1cedfd69ff78ec8d5501a33870cf 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -413,7 +413,7 @@ public abstract class Player extends LivingEntity { +@@ -349,7 +349,7 @@ public abstract class Player extends Avatar implements ContainerUser { } private boolean isEquipped(Item item) { @@ -395,10 +395,10 @@ index e5e08dbefead90e9fe2bb05e4f0257f7aa4c0686..5160c349f1ace36d6de11f23e0f957f3 Equippable equippable = itemBySlot.get(DataComponents.EQUIPPABLE); if (itemBySlot.is(item) && equippable != null && equippable.slot() == equipmentSlot) { diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java -index da16f4831c875e07c25d7ed041bed493db614658..951c86278e8cb5cd801a5db2ebfabef8c6d813ef 100644 +index 25bc90eb527547487fb5191dc135f2c6030f3a19..41aed4ca479c84337dbe368e1f752af498c5de24 100644 --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java -@@ -1149,7 +1149,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -1153,7 +1153,7 @@ public final class ItemStack implements DataComponentHolder { private void addAttributeTooltips(Consumer tooltipAdder, TooltipDisplay tooltipDisplay, @Nullable Player player) { if (tooltipDisplay.shows(DataComponents.ATTRIBUTE_MODIFIERS)) { @@ -434,7 +434,7 @@ index 7a620eb92b1e672cedd72ec4d986c01eba337686..0460da0124d2c48b7fed45fa182537fd ItemStack itemBySlot = entity.getItemBySlot(equipmentSlot); if (!itemBySlot.isEmpty()) { diff --git a/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index 66234431b265e0596275ca468cd40f8da98c22e2..b20415b47e209aedbc60ff17238e575dfe33849a 100644 +index e59faaa4e72ef64fd7103f1844396e8b0ace161c..8d06c797c713fafba6b051a28bacd4ba79be8fd1 100644 --- a/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/net/minecraft/world/item/enchantment/EnchantmentHelper.java @@ -153,7 +153,7 @@ public class EnchantmentHelper { @@ -456,10 +456,10 @@ index 66234431b265e0596275ca468cd40f8da98c22e2..b20415b47e209aedbc60ff17238e575d if (filter.test(itemBySlot)) { ItemEnchantments itemEnchantments = itemBySlot.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index a0254e85fccebb66ce02bd58f9d461addd8ad73d..1f7b3db02e59c4cbc93bc0e4e42bd20e0031c4bd 100644 +index e49d7bc1b060ee3922bb171ba0e7723148c601df..bfbc3e32c6007bd5413be38227b918c6def96e4c 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -1825,7 +1825,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -1785,7 +1785,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) { ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices slices = ((ServerLevel)this).moonrise$getEntityLookup().getChunk(chunkX, chunkZ); if (slices == null) { @@ -468,7 +468,7 @@ index a0254e85fccebb66ce02bd58f9d461addd8ad73d..1f7b3db02e59c4cbc93bc0e4e42bd20e } List ret = new java.util.ArrayList<>(); -@@ -1836,7 +1836,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl +@@ -1796,7 +1796,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } } @@ -478,7 +478,7 @@ index a0254e85fccebb66ce02bd58f9d461addd8ad73d..1f7b3db02e59c4cbc93bc0e4e42bd20e // Paper end - rewrite chunk system diff --git a/net/minecraft/world/level/block/ComposterBlock.java b/net/minecraft/world/level/block/ComposterBlock.java -index a647d76d365a60b95a3eb7927ac426bf70d417f3..7977ecd013c55359f179b4b7f895099b7eb02294 100644 +index 5d434ebe7bb7cfea02d1a7dc05825ff59eac23d1..b845f1c02bf0efa4799255d94043f25ed2a04f07 100644 --- a/net/minecraft/world/level/block/ComposterBlock.java +++ b/net/minecraft/world/level/block/ComposterBlock.java @@ -419,7 +419,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @@ -522,7 +522,7 @@ index 36a72a11d28f99bfe85868461925b778cc01478e..ca2cab797fc16f0961ce994fcb450295 private static final int[] SLOTS_FOR_SIDES = new int[]{1}; public static final int DATA_LIT_DURATION = 1; diff --git a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index c8f23011a8942a5be970c606f67142cbd202b97e..98971a07757d29d6926a0aa05f229b8020af42b6 100644 +index 0c1d4038224ba9776674ff29211b47ccab09236e..af68bdde29137b2cc8d3939f54dd4639dde29add 100644 --- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java @@ -258,7 +258,7 @@ public class MapItemSavedData extends SavedData { diff --git a/leaf-server/minecraft-patches/features/0046-Optimize-sun-burn-tick.patch b/leaf-server/minecraft-patches/features/0046-Optimize-sun-burn-tick.patch index a59bd10f..dfb3a752 100644 --- a/leaf-server/minecraft-patches/features/0046-Optimize-sun-burn-tick.patch +++ b/leaf-server/minecraft-patches/features/0046-Optimize-sun-burn-tick.patch @@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index e81774a2fbcafb5909b966f71d31379c8b5a7426..229daac5767e8d65b2d0c37303d3490ef97e21ff 100644 +index 13ffe66a5161188c253f71c6ed5264261d886b74..508eb961b14564d46b420f1f40ac2fd13a121884 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -2087,10 +2087,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2139,10 +2139,20 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name @Deprecated public float getLightLevelDependentMagicValue() { @@ -39,10 +39,10 @@ index e81774a2fbcafb5909b966f71d31379c8b5a7426..229daac5767e8d65b2d0c37303d3490e public void absSnapTo(double x, double y, double z, float yRot, float xRot) { this.absSnapTo(x, y, z); diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java -index 4aec1fd4efbb3dd139542c55d06503716723f326..37c6567701fe10011a364b8def9ebf3391376592 100644 +index 65a406b6684117d2379033ce09808543303ef374..fc6c5cf5991d9d359fd9e4ebb0f71a18c52e6273 100644 --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -1513,20 +1513,31 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1532,20 +1532,31 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab protected void playAttackSound() { } @@ -51,7 +51,7 @@ index 4aec1fd4efbb3dd139542c55d06503716723f326..37c6567701fe10011a364b8def9ebf33 + private net.minecraft.world.phys.Vec3 cached_position; + // Gale end - JettPack - optimize sun burn tick - cache eye blockpos public boolean isSunBurnTick() { - if (this.level().isBrightOutside() && !this.level().isClientSide) { + if (this.level().isBrightOutside() && !this.level().isClientSide()) { - float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue(); - BlockPos blockPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ()); - boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow; diff --git a/leaf-server/minecraft-patches/features/0048-Replace-game-rules-map-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0048-Replace-game-rules-map-with-optimized-collection.patch index f76f8ee0..bcc7a418 100644 --- a/leaf-server/minecraft-patches/features/0048-Replace-game-rules-map-with-optimized-collection.patch +++ b/leaf-server/minecraft-patches/features/0048-Replace-game-rules-map-with-optimized-collection.patch @@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java -index d5536dd40a1e9a2e05967652f690abbbca287852..966ca1e0e828e4176e12cbcf8c4a6b16489708de 100644 +index 5b148c977efad9f312acfc0304356f70a6cb1170..3a4a208217df4dbe5056fb2619cadd65b4f5fbc4 100644 --- a/net/minecraft/world/level/GameRules.java +++ b/net/minecraft/world/level/GameRules.java -@@ -288,7 +288,7 @@ public class GameRules { +@@ -303,7 +303,7 @@ public class GameRules { } private GameRules(Map, GameRules.Value> rules, FeatureFlagSet enabledFeatures) { diff --git a/leaf-server/minecraft-patches/features/0052-Cache-ShapePairKey-hash.patch b/leaf-server/minecraft-patches/features/0052-Cache-ShapePairKey-hash.patch index 92815446..bd3494d5 100644 --- a/leaf-server/minecraft-patches/features/0052-Cache-ShapePairKey-hash.patch +++ b/leaf-server/minecraft-patches/features/0052-Cache-ShapePairKey-hash.patch @@ -9,10 +9,10 @@ Gale - https://galemc.org The JMH benchmark of this patch can be found in SunBox's `RecordHashCode` diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java -index be6f37f91569c659c609e5e8d38671ca86f8cd95..cc5e4e82c2339d17edf76b9212774c9dfd8e514d 100644 +index 4fd746ccfd0018f5e551490e24aa68265d609295..3b89a899a191f8b3f3d8643d11bf9468b2592897 100644 --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -610,7 +610,20 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -649,7 +649,20 @@ public class Block extends BlockBehaviour implements ItemLike { } // CraftBukkit end @@ -34,7 +34,7 @@ index be6f37f91569c659c609e5e8d38671ca86f8cd95..cc5e4e82c2339d17edf76b9212774c9d @Override public boolean equals(Object other) { return other instanceof Block.ShapePairKey shapePairKey && this.first == shapePairKey.first && this.second == shapePairKey.second; -@@ -618,7 +631,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -657,7 +670,7 @@ public class Block extends BlockBehaviour implements ItemLike { @Override public int hashCode() { diff --git a/leaf-server/minecraft-patches/features/0055-Check-frozen-ticks-before-landing-block.patch b/leaf-server/minecraft-patches/features/0055-Check-frozen-ticks-before-landing-block.patch index 362bd5ec..54e85e43 100644 --- a/leaf-server/minecraft-patches/features/0055-Check-frozen-ticks-before-landing-block.patch +++ b/leaf-server/minecraft-patches/features/0055-Check-frozen-ticks-before-landing-block.patch @@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 82354cc62df5b7793ef13c6731d84457cee42092..55277151febdf464e0a4679336a1464d3e4069b8 100644 +index c4bda5d975cce38a725b8590261d97fcfac3d95d..39b3b17dd9cafa59393d40bf0090edeadacde428 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -535,10 +535,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -542,10 +542,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin } protected void tryAddFrost() { @@ -28,7 +28,7 @@ index 82354cc62df5b7793ef13c6731d84457cee42092..55277151febdf464e0a4679336a1464d if (attribute == null) { return; } -@@ -546,7 +545,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -553,7 +552,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin float f = -0.05F * this.getPercentFrozen(); attribute.addTransientModifier(new AttributeModifier(SPEED_MODIFIER_POWDER_SNOW_ID, f, AttributeModifier.Operation.ADD_VALUE)); } diff --git a/leaf-server/minecraft-patches/features/0057-Update-boss-bar-within-tick.patch b/leaf-server/minecraft-patches/features/0056-Update-boss-bar-within-tick.patch similarity index 89% rename from leaf-server/minecraft-patches/features/0057-Update-boss-bar-within-tick.patch rename to leaf-server/minecraft-patches/features/0056-Update-boss-bar-within-tick.patch index a446950c..deffebd6 100644 --- a/leaf-server/minecraft-patches/features/0057-Update-boss-bar-within-tick.patch +++ b/leaf-server/minecraft-patches/features/0056-Update-boss-bar-within-tick.patch @@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java -index b3a29ce523fb5de71589c7c17598bba17622f988..afcf185c4e2c0648c96a872fbe1fbebb6012d513 100644 +index 5181a9334066a15e0d502d3522c23337e5eef2b5..dcfade2efe209b87a169738fc2ff23d8e24b53a6 100644 --- a/net/minecraft/world/entity/raid/Raid.java +++ b/net/minecraft/world/entity/raid/Raid.java -@@ -126,6 +126,7 @@ public class Raid { +@@ -128,6 +128,7 @@ public class Raid { private Raid.RaidStatus status; private int celebrationTicks; private Optional waveSpawnPos = Optional.empty(); @@ -24,7 +24,7 @@ index b3a29ce523fb5de71589c7c17598bba17622f988..afcf185c4e2c0648c96a872fbe1fbebb public Raid(BlockPos center, Difficulty difficulty) { this.active = true; -@@ -278,6 +279,12 @@ public class Raid { +@@ -280,6 +281,12 @@ public class Raid { } public void tick(ServerLevel level) { @@ -37,7 +37,7 @@ index b3a29ce523fb5de71589c7c17598bba17622f988..afcf185c4e2c0648c96a872fbe1fbebb if (!this.isStopped()) { if (this.status == Raid.RaidStatus.ONGOING) { boolean flag = this.active; -@@ -588,6 +595,12 @@ public class Raid { +@@ -610,6 +617,12 @@ public class Raid { } public void updateBossbar() { diff --git a/leaf-server/minecraft-patches/features/0058-Skip-secondary-POI-sensor-if-absent.patch b/leaf-server/minecraft-patches/features/0057-Skip-secondary-POI-sensor-if-absent.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0058-Skip-secondary-POI-sensor-if-absent.patch rename to leaf-server/minecraft-patches/features/0057-Skip-secondary-POI-sensor-if-absent.patch diff --git a/leaf-server/minecraft-patches/features/0059-Skip-entity-move-if-movement-is-zero.patch b/leaf-server/minecraft-patches/features/0058-Skip-entity-move-if-movement-is-zero.patch similarity index 83% rename from leaf-server/minecraft-patches/features/0059-Skip-entity-move-if-movement-is-zero.patch rename to leaf-server/minecraft-patches/features/0058-Skip-entity-move-if-movement-is-zero.patch index abfc4a48..329a16af 100644 --- a/leaf-server/minecraft-patches/features/0059-Skip-entity-move-if-movement-is-zero.patch +++ b/leaf-server/minecraft-patches/features/0058-Skip-entity-move-if-movement-is-zero.patch @@ -13,10 +13,10 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 229daac5767e8d65b2d0c37303d3490ef97e21ff..6a4eaccf82e4d94dad657318e307a24d1ce2b9c1 100644 +index 508eb961b14564d46b420f1f40ac2fd13a121884..1d3cc87b5dcfa749ca3f2e10658f2696c75c18df 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -260,6 +260,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -262,6 +262,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name public float yRotO; public float xRotO; private AABB bb = INITIAL_AABB; @@ -24,7 +24,7 @@ index 229daac5767e8d65b2d0c37303d3490ef97e21ff..6a4eaccf82e4d94dad657318e307a24d public boolean onGround; public boolean horizontalCollision; public boolean verticalCollision; -@@ -1086,6 +1087,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1092,6 +1093,11 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name // Paper end - detailed watchdog information public void move(MoverType type, Vec3 movement) { @@ -36,7 +36,7 @@ index 229daac5767e8d65b2d0c37303d3490ef97e21ff..6a4eaccf82e4d94dad657318e307a24d final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity // Paper start - detailed watchdog information ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main"); -@@ -4375,6 +4381,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4449,6 +4455,11 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name } public final void setBoundingBox(AABB bb) { diff --git a/leaf-server/minecraft-patches/features/0060-Store-mob-counts-in-an-array.patch b/leaf-server/minecraft-patches/features/0059-Store-mob-counts-in-an-array.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0060-Store-mob-counts-in-an-array.patch rename to leaf-server/minecraft-patches/features/0059-Store-mob-counts-in-an-array.patch diff --git a/leaf-server/minecraft-patches/features/0061-Use-linked-map-for-entity-trackers.patch b/leaf-server/minecraft-patches/features/0060-Use-linked-map-for-entity-trackers.patch similarity index 88% rename from leaf-server/minecraft-patches/features/0061-Use-linked-map-for-entity-trackers.patch rename to leaf-server/minecraft-patches/features/0060-Use-linked-map-for-entity-trackers.patch index e3dc2db8..87dd74be 100644 --- a/leaf-server/minecraft-patches/features/0061-Use-linked-map-for-entity-trackers.patch +++ b/leaf-server/minecraft-patches/features/0060-Use-linked-map-for-entity-trackers.patch @@ -13,11 +13,11 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java -index edda52a8430386238be4963e8ea2406f0c2d4df3..78040fb6b6fd168e62494d3953006bfb38c2909f 100644 +index 27e892eef8d5ed029a2ccd4160bd0de679cd4330..42f5e8a1eb10525aa8466e89699cc8be1a098c11 100644 --- a/net/minecraft/server/level/ChunkMap.java +++ b/net/minecraft/server/level/ChunkMap.java @@ -132,7 +132,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - public final AtomicInteger tickingGenerated = new AtomicInteger(); // Paper - public + public final ChunkMap.DistanceManager distanceManager; private final String storageName; private final PlayerMap playerMap = new PlayerMap(); - public final Int2ObjectMap entityMap = new Int2ObjectOpenHashMap<>(); diff --git a/leaf-server/minecraft-patches/features/0062-Optimize-noise-generation.patch b/leaf-server/minecraft-patches/features/0061-Optimize-noise-generation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0062-Optimize-noise-generation.patch rename to leaf-server/minecraft-patches/features/0061-Optimize-noise-generation.patch diff --git a/leaf-server/minecraft-patches/features/0063-Optimize-sheep-offspring-color.patch b/leaf-server/minecraft-patches/features/0062-Optimize-sheep-offspring-color.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0063-Optimize-sheep-offspring-color.patch rename to leaf-server/minecraft-patches/features/0062-Optimize-sheep-offspring-color.patch diff --git a/leaf-server/minecraft-patches/features/0064-Hide-flames-on-entities-with-fire-resistance.patch b/leaf-server/minecraft-patches/features/0063-Hide-flames-on-entities-with-fire-resistance.patch similarity index 85% rename from leaf-server/minecraft-patches/features/0064-Hide-flames-on-entities-with-fire-resistance.patch rename to leaf-server/minecraft-patches/features/0063-Hide-flames-on-entities-with-fire-resistance.patch index 39db93f0..2f201c59 100644 --- a/leaf-server/minecraft-patches/features/0064-Hide-flames-on-entities-with-fire-resistance.patch +++ b/leaf-server/minecraft-patches/features/0063-Hide-flames-on-entities-with-fire-resistance.patch @@ -13,13 +13,13 @@ As part of: Slice (https://github.com/Cryptite/Slice) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 6a4eaccf82e4d94dad657318e307a24d1ce2b9c1..c845bea5d31296efa03d07e5133e988ef3c57808 100644 +index 1d3cc87b5dcfa749ca3f2e10658f2696c75c18df..faacc8b73cb0a06c797abe461fbfacfebe95648f 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -886,7 +886,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -892,7 +892,13 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name this.checkBelowWorld(); - if (!this.level().isClientSide) { + if (!this.level().isClientSide()) { + // Gale start - Slice - hide flames on entities with fire resistance + if (this instanceof net.minecraft.world.entity.LivingEntity livingEntity) { + this.setSharedFlagOnFire(this.remainingFireTicks > 0 && (!this.level.galeConfig().gameplayMechanics.hideFlamesOnEntitiesWithFireResistance || !livingEntity.hasEffect(net.minecraft.world.effect.MobEffects.FIRE_RESISTANCE))); diff --git a/leaf-server/minecraft-patches/features/0065-Skip-cloning-advancement-criteria.patch b/leaf-server/minecraft-patches/features/0064-Skip-cloning-advancement-criteria.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0065-Skip-cloning-advancement-criteria.patch rename to leaf-server/minecraft-patches/features/0064-Skip-cloning-advancement-criteria.patch index cde155f5..3830c78f 100644 --- a/leaf-server/minecraft-patches/features/0065-Skip-cloning-advancement-criteria.patch +++ b/leaf-server/minecraft-patches/features/0064-Skip-cloning-advancement-criteria.patch @@ -13,7 +13,7 @@ As part of: Mirai (https://github.com/etil2jz/Mirai) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/advancements/Advancement.java b/net/minecraft/advancements/Advancement.java -index ac6a85ddf6eb326b3fd53341a4a5db7bd00b7ce2..7f7ad8492dc848e9549d1e05f6d800ebb0788dc4 100644 +index 23f448a2d2361f09f3b7099cdde73fd881fa8ee4..e23dea490bb2f0781ac327df8403538478fc484c 100644 --- a/net/minecraft/advancements/Advancement.java +++ b/net/minecraft/advancements/Advancement.java @@ -61,7 +61,7 @@ public record Advancement( diff --git a/leaf-server/minecraft-patches/features/0066-Reduce-block-destruction-packet-allocations.patch b/leaf-server/minecraft-patches/features/0065-Reduce-block-destruction-packet-allocations.patch similarity index 89% rename from leaf-server/minecraft-patches/features/0066-Reduce-block-destruction-packet-allocations.patch rename to leaf-server/minecraft-patches/features/0065-Reduce-block-destruction-packet-allocations.patch index 15a83d16..e19095bb 100644 --- a/leaf-server/minecraft-patches/features/0066-Reduce-block-destruction-packet-allocations.patch +++ b/leaf-server/minecraft-patches/features/0065-Reduce-block-destruction-packet-allocations.patch @@ -13,10 +13,10 @@ As part of: SportPaper (https://github.com/Electroid/SportPaper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 617eb1b9d30d499124576c5d7cb5152571cc6b84..ad114ca013e0d09d40755acbe916586868a519ed 100644 +index 75d0ba4e2407b6b10c14b33fe6c50108be1dad8b..dcd508e9dfc2fd05ee1f4222b39e007abc4a0944 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -1579,6 +1579,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1607,6 +1607,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @Override public void destroyBlockProgress(int breakerId, BlockPos pos, int progress) { @@ -32,7 +32,7 @@ index 617eb1b9d30d499124576c5d7cb5152571cc6b84..ad114ca013e0d09d40755acbe9165868 // CraftBukkit start Player breakerPlayer = null; Entity entity = this.getEntity(breakerId); -@@ -1595,7 +1604,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1623,7 +1632,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe .callEvent(); } // Paper end - Add BlockBreakProgressUpdateEvent @@ -41,7 +41,7 @@ index 617eb1b9d30d499124576c5d7cb5152571cc6b84..ad114ca013e0d09d40755acbe9165868 if (serverPlayer != null && serverPlayer.level() == this && serverPlayer.getId() != breakerId) { double d = pos.getX() - serverPlayer.getX(); double d1 = pos.getY() - serverPlayer.getY(); -@@ -1606,7 +1615,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1634,7 +1643,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } // CraftBukkit end if (d * d + d1 * d1 + d2 * d2 < 1024.0) { diff --git a/leaf-server/minecraft-patches/features/0067-Spread-out-sending-all-player-info.patch b/leaf-server/minecraft-patches/features/0066-Spread-out-sending-all-player-info.patch similarity index 82% rename from leaf-server/minecraft-patches/features/0067-Spread-out-sending-all-player-info.patch rename to leaf-server/minecraft-patches/features/0066-Spread-out-sending-all-player-info.patch index 4221c85b..ff8e8149 100644 --- a/leaf-server/minecraft-patches/features/0067-Spread-out-sending-all-player-info.patch +++ b/leaf-server/minecraft-patches/features/0066-Spread-out-sending-all-player-info.patch @@ -37,26 +37,26 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index f4a73d3f56d6a10493752653bd50c8caeda63a94..366d476730923c70f6734e12b21ba3d7f9750643 100644 +index 2406f4d7debd0615ddfa40a307b29edac11451b7..b478e22321be0edd31290945fafa02caa46c1778 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -113,6 +113,7 @@ public abstract class PlayerList { +@@ -111,6 +111,7 @@ public abstract class PlayerList { private final MinecraftServer server; public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety private final Map playersByUUID = Maps.newHashMap(); + private final ServerPlayer[][] sendAllPlayerInfoBuckets = new ServerPlayer[SEND_PLAYER_INFO_INTERVAL][]; // Gale - Purpur - spread out sending all player info - private final UserBanList bans = new UserBanList(USERBANLIST_FILE); - private final IpBanList ipBans = new IpBanList(IPBANLIST_FILE); - private final ServerOpList ops = new ServerOpList(OPLIST_FILE); -@@ -312,6 +313,7 @@ public abstract class PlayerList { - this.players.add(player); - this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot - this.playersByUUID.put(player.getUUID(), player); -+ this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info - // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below - // Paper start - Fire PlayerJoinEvent when Player is actually ready; correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks - player.supressTrackerForLogin = true; -@@ -583,6 +585,7 @@ public abstract class PlayerList { + private final UserBanList bans; + private final IpBanList ipBans; + private final ServerOpList ops; +@@ -217,6 +218,7 @@ public abstract class PlayerList { + this.players.add(player); + this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot + this.playersByUUID.put(player.getUUID(), player); ++ this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info + // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below + // Paper start - Fire PlayerJoinEvent when Player is actually ready; correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks + player.suppressTrackerForLogin = true; +@@ -499,6 +501,7 @@ public abstract class PlayerList { player.getAdvancements().stopListening(); this.players.remove(player); this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot @@ -64,15 +64,15 @@ index f4a73d3f56d6a10493752653bd50c8caeda63a94..366d476730923c70f6734e12b21ba3d7 this.server.getCustomBossEvents().onPlayerDisconnect(player); UUID uuid = player.getUUID(); ServerPlayer serverPlayer = this.playersByUUID.get(uuid); -@@ -685,6 +688,7 @@ public abstract class PlayerList { - player.stopRiding(); // CraftBukkit +@@ -603,6 +606,7 @@ public abstract class PlayerList { + // TeleportTransition teleportTransition = player.findRespawnPositionAndUseSpawnBlock(!keepInventory, TeleportTransition.DO_NOTHING); this.players.remove(player); this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot + this.removeFromSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info player.level().removePlayerImmediately(player, reason); - // TeleportTransition teleportTransition = player.findRespawnPositionAndUseSpawnBlock(!keepInventory, TeleportTransition.DO_NOTHING); // ServerLevel level = teleportTransition.newLevel(); -@@ -763,6 +767,7 @@ public abstract class PlayerList { + // ServerPlayer serverPlayer = new ServerPlayer(this.server, level, player.getGameProfile(), player.clientInformation()); +@@ -680,6 +684,7 @@ public abstract class PlayerList { this.players.add(serverPlayer); this.playersByName.put(serverPlayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT), serverPlayer); // Spigot this.playersByUUID.put(serverPlayer.getUUID(), serverPlayer); @@ -80,7 +80,7 @@ index f4a73d3f56d6a10493752653bd50c8caeda63a94..366d476730923c70f6734e12b21ba3d7 } // serverPlayer.initInventoryMenu(); serverPlayer.setHealth(serverPlayer.getHealth()); -@@ -865,18 +870,58 @@ public abstract class PlayerList { +@@ -782,18 +787,58 @@ public abstract class PlayerList { } public void tick() { @@ -145,10 +145,10 @@ index f4a73d3f56d6a10493752653bd50c8caeda63a94..366d476730923c70f6734e12b21ba3d7 public void broadcastAll(Packet packet, net.minecraft.world.entity.player.Player entityhuman) { for (ServerPlayer entityplayer : this.players) { // Paper - replace for i with for each for thread safety diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index 5160c349f1ace36d6de11f23e0f957f37fc19165..6207ffb19f8d98ea6496e4d80495bf590b1be7ca 100644 +index 7984529672ec1cedfd69ff78ec8d5501a33870cf..3a1517771b500995d4082185a877cb6e8be21b98 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -230,9 +230,12 @@ public abstract class Player extends LivingEntity { +@@ -191,9 +191,12 @@ public abstract class Player extends Avatar implements ContainerUser { } // CraftBukkit end @@ -156,8 +156,8 @@ index 5160c349f1ace36d6de11f23e0f957f37fc19165..6207ffb19f8d98ea6496e4d80495bf59 + public Player(Level level, GameProfile gameProfile) { super(EntityType.PLAYER, level); - this.setUUID(gameProfile.getId()); + this.setUUID(gameProfile.id()); + this.sendAllPlayerInfoBucketIndex = Math.floorMod(this.uuid.hashCode(), net.minecraft.server.players.PlayerList.SEND_PLAYER_INFO_INTERVAL); // Gale - Purpur - spread out sending all player info this.gameProfile = gameProfile; this.inventory = new Inventory(this, this.equipment); - this.inventoryMenu = new InventoryMenu(this.inventory, !level.isClientSide, this); + this.inventoryMenu = new InventoryMenu(this.inventory, !level.isClientSide(), this); diff --git a/leaf-server/minecraft-patches/features/0068-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/leaf-server/minecraft-patches/features/0067-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0068-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch rename to leaf-server/minecraft-patches/features/0067-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch index 1e7dd2aa..ea3df4bf 100644 --- a/leaf-server/minecraft-patches/features/0068-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch +++ b/leaf-server/minecraft-patches/features/0067-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch @@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java -index f6017445c495c65fc71b10d2a8ed4f5d3d225668..e00624a738e65ab14ec68a8d0e7861522fa32e82 100644 +index 8b7db6b8789f5c544bdb6e5d2164292ed84d9899..c8e3b6b6fe4a9047a45497575a7ab796b4072d48 100644 --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -498,6 +498,7 @@ public class Commands { +@@ -505,6 +505,7 @@ public class Commands { private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode rootCommandNode) { // Paper end - Perf: Async command map building new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(player.getBukkitEntity(), (RootCommandNode) rootCommandNode, true).callEvent(); // Paper - Brigadier API @@ -48,7 +48,7 @@ index f6017445c495c65fc71b10d2a8ed4f5d3d225668..e00624a738e65ab14ec68a8d0e786152 org.bukkit.event.player.PlayerCommandSendEvent event = new org.bukkit.event.player.PlayerCommandSendEvent(player.getBukkitEntity(), new java.util.LinkedHashSet<>(bukkit)); event.getPlayer().getServer().getPluginManager().callEvent(event); -@@ -508,6 +509,7 @@ public class Commands { +@@ -515,6 +516,7 @@ public class Commands { } } // CraftBukkit end diff --git a/leaf-server/minecraft-patches/features/0069-Send-multiple-keep-alive-packets.patch b/leaf-server/minecraft-patches/features/0068-Send-multiple-keep-alive-packets.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0069-Send-multiple-keep-alive-packets.patch rename to leaf-server/minecraft-patches/features/0068-Send-multiple-keep-alive-packets.patch index 4d83a2aa..7b955037 100644 --- a/leaf-server/minecraft-patches/features/0069-Send-multiple-keep-alive-packets.patch +++ b/leaf-server/minecraft-patches/features/0068-Send-multiple-keep-alive-packets.patch @@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 149660c1196481275ca03830d64cf33b5ce98163..37de0c46b065851ea0f0d01e415980e47cc3cfb5 100644 +index 40ef10d088b21e51dd74897c9724f37dc7c2d467..ff878c13bc1b55f2d7c3ab025a50746ab782da6c 100644 --- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -38,10 +38,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -39,10 +39,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack public final Connection connection; // Paper private final boolean transferred; //private long keepAliveTime; // Paper - improve keepalives @@ -53,7 +53,7 @@ index 149660c1196481275ca03830d64cf33b5ce98163..37de0c46b065851ea0f0d01e415980e4 private volatile int latency; // Paper - improve keepalives - make volatile private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives private volatile boolean suspendFlushingOnServerThread = false; -@@ -50,7 +51,10 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -51,7 +52,10 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack public boolean processedDisconnect; // CraftBukkit end public final java.util.Map packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks @@ -65,7 +65,7 @@ index 149660c1196481275ca03830d64cf33b5ce98163..37de0c46b065851ea0f0d01e415980e4 protected static final net.minecraft.resources.ResourceLocation MINECRAFT_BRAND = net.minecraft.resources.ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support // Paper start - retain certain values public @Nullable String playerBrand; -@@ -103,6 +107,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -104,6 +108,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack // Paper start - improve keepalives long now = System.nanoTime(); io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek(); @@ -84,7 +84,7 @@ index 149660c1196481275ca03830d64cf33b5ce98163..37de0c46b065851ea0f0d01e415980e4 if (pending != null && pending.challengeId() == packet.getId()) { this.keepAlive.pendingKeepAlives.remove(pending); -@@ -114,6 +130,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -115,6 +131,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack this.latency = this.keepAlive.pingCalculator5s.getAvgLatencyMS(); return; } @@ -92,7 +92,7 @@ index 149660c1196481275ca03830d64cf33b5ce98163..37de0c46b065851ea0f0d01e415980e4 for (java.util.Iterator itr = this.keepAlive.pendingKeepAlives.iterator(); itr.hasNext();) { io.papermc.paper.util.KeepAlive.PendingKeepAlive ka = itr.next(); -@@ -261,6 +278,23 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -262,6 +279,23 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack protected void keepConnectionAlive() { long millis = Util.getMillis(); // Paper start - improve keepalives @@ -116,7 +116,7 @@ index 149660c1196481275ca03830d64cf33b5ce98163..37de0c46b065851ea0f0d01e415980e4 if (this.checkIfClosed(millis) && !this.processedDisconnect) { long currTime = System.nanoTime(); -@@ -279,6 +313,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -280,6 +314,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack // Paper end - improve keepalives } } diff --git a/leaf-server/minecraft-patches/features/0070-Make-slow-login-timeout-configurable.patch b/leaf-server/minecraft-patches/features/0069-Make-slow-login-timeout-configurable.patch similarity index 88% rename from leaf-server/minecraft-patches/features/0070-Make-slow-login-timeout-configurable.patch rename to leaf-server/minecraft-patches/features/0069-Make-slow-login-timeout-configurable.patch index ae37bf19..0dcd2ca5 100644 --- a/leaf-server/minecraft-patches/features/0070-Make-slow-login-timeout-configurable.patch +++ b/leaf-server/minecraft-patches/features/0069-Make-slow-login-timeout-configurable.patch @@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 5bac1c0ba691e516f2d603583971df7fe7ac212c..f9fad100d3e5e4b44a5b0f88e288e6fac7a250f7 100644 +index c2ce73976568bc1538ea82d70175e004943b4585..cc7f467a394413c3cc1a5975d77ff8880ad0fafa 100644 --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -105,7 +105,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -106,7 +106,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } public void tickTimeout() { // Paper end - login cookie API diff --git a/leaf-server/minecraft-patches/features/0071-Don-t-load-chunks-to-spawn-phantoms.patch b/leaf-server/minecraft-patches/features/0070-Don-t-load-chunks-to-spawn-phantoms.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0071-Don-t-load-chunks-to-spawn-phantoms.patch rename to leaf-server/minecraft-patches/features/0070-Don-t-load-chunks-to-spawn-phantoms.patch index 458214b2..fa950b79 100644 --- a/leaf-server/minecraft-patches/features/0071-Don-t-load-chunks-to-spawn-phantoms.patch +++ b/leaf-server/minecraft-patches/features/0070-Don-t-load-chunks-to-spawn-phantoms.patch @@ -13,7 +13,7 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java -index b3cfab9c82fe12694f5d2f56bd922828e51df680..77ecbcdec8e176b1a45e87d33f64b1a12c532e26 100644 +index 801a50ba4d202df0289339f26968e7f6bb9ca767..0c9c58a2f57b11f907c70440bf8bd5a513ce8243 100644 --- a/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java @@ -52,8 +52,16 @@ public class PhantomSpawner implements CustomSpawner { diff --git a/leaf-server/minecraft-patches/features/0072-Don-t-load-chunks-to-activate-climbing-entities.patch b/leaf-server/minecraft-patches/features/0071-Don-t-load-chunks-to-activate-climbing-entities.patch similarity index 88% rename from leaf-server/minecraft-patches/features/0072-Don-t-load-chunks-to-activate-climbing-entities.patch rename to leaf-server/minecraft-patches/features/0071-Don-t-load-chunks-to-activate-climbing-entities.patch index c12846c5..c7749ec0 100644 --- a/leaf-server/minecraft-patches/features/0072-Don-t-load-chunks-to-activate-climbing-entities.patch +++ b/leaf-server/minecraft-patches/features/0071-Don-t-load-chunks-to-activate-climbing-entities.patch @@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index c845bea5d31296efa03d07e5133e988ef3c57808..515bc3de097bf9edda42584e56fa173727455b5a 100644 +index faacc8b73cb0a06c797abe461fbfacfebe95648f..a58dd6d8e69736163b7099d66b0ebcb1a4a9e527 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -4873,6 +4873,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4938,6 +4938,16 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name return this.inBlockState; } @@ -28,10 +28,10 @@ index c845bea5d31296efa03d07e5133e988ef3c57808..515bc3de097bf9edda42584e56fa1737 return this.chunkPosition; } diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 55277151febdf464e0a4679336a1464d3e4069b8..d54c09c48edbfc999abd834b68ea5ceea13f39d2 100644 +index 39b3b17dd9cafa59393d40bf0090edeadacde428..3c972e39a66c1aa9253eaae818eab6feac94c66d 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -2129,8 +2129,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -2161,8 +2161,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin public boolean onClimbableCached() { if (!this.blockPosition().equals(this.lastClimbingPosition)) { @@ -51,7 +51,7 @@ index 55277151febdf464e0a4679336a1464d3e4069b8..d54c09c48edbfc999abd834b68ea5cee } return this.cachedOnClimbable; -@@ -2138,11 +2147,25 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -2170,11 +2179,25 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin // Gale end - Airplane - cache on climbable check public boolean onClimbable() { diff --git a/leaf-server/minecraft-patches/features/0073-Broadcast-crit-animations-as-the-entity-being-critte.patch b/leaf-server/minecraft-patches/features/0072-Broadcast-crit-animations-as-the-entity-being-critte.patch similarity index 63% rename from leaf-server/minecraft-patches/features/0073-Broadcast-crit-animations-as-the-entity-being-critte.patch rename to leaf-server/minecraft-patches/features/0072-Broadcast-crit-animations-as-the-entity-being-critte.patch index 94917242..53118f7a 100644 --- a/leaf-server/minecraft-patches/features/0073-Broadcast-crit-animations-as-the-entity-being-critte.patch +++ b/leaf-server/minecraft-patches/features/0072-Broadcast-crit-animations-as-the-entity-being-critte.patch @@ -13,26 +13,26 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index e4976eff4d18a1a1a752956c7e214122ddb05401..ee2671510d46a92732934cd5df0a0e42c4cae1f6 100644 +index 8f9ca82adea0c07fef37b3b800ddeebbe3d29c21..b5f666d69cf15fc81c6cc0e3f7030501567b205c 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -2128,12 +2128,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -2243,12 +2243,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc @Override public void crit(Entity entityHit) { -- this.level().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 4)); +- this.level().getChunkSource().sendToTrackingPlayersAndSelf(this, new ClientboundAnimatePacket(entityHit, 4)); + // Gale start - MultiPaper - broadcast crit animations as the entity being critted + var level = this.level(); -+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 4)); ++ level.getChunkSource().sendToTrackingPlayersAndSelf(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 4)); + // Gale end - MultiPaper - broadcast crit animations as the entity being critte } @Override public void magicCrit(Entity entityHit) { -- this.level().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 5)); +- this.level().getChunkSource().sendToTrackingPlayersAndSelf(this, new ClientboundAnimatePacket(entityHit, 5)); + // Gale start - MultiPaper - broadcast crit animations as the entity being critted + var level = this.level(); -+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 5)); ++ level.getChunkSource().sendToTrackingPlayersAndSelf(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 5)); + // Gale end - MultiPaper - broadcast crit animations as the entity being critted } diff --git a/leaf-server/minecraft-patches/features/0074-Ignore-null-legacy-structure-data.patch b/leaf-server/minecraft-patches/features/0073-Ignore-null-legacy-structure-data.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0074-Ignore-null-legacy-structure-data.patch rename to leaf-server/minecraft-patches/features/0073-Ignore-null-legacy-structure-data.patch diff --git a/leaf-server/minecraft-patches/features/0075-Prevent-entities-random-strolling-into-non-ticking-c.patch b/leaf-server/minecraft-patches/features/0074-Prevent-entities-random-strolling-into-non-ticking-c.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0075-Prevent-entities-random-strolling-into-non-ticking-c.patch rename to leaf-server/minecraft-patches/features/0074-Prevent-entities-random-strolling-into-non-ticking-c.patch index 77c61468..3f18e29e 100644 --- a/leaf-server/minecraft-patches/features/0075-Prevent-entities-random-strolling-into-non-ticking-c.patch +++ b/leaf-server/minecraft-patches/features/0074-Prevent-entities-random-strolling-into-non-ticking-c.patch @@ -13,7 +13,7 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java b/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java -index bad57b0017c78d4d1d32c239fae5bc2ea20bc3c3..28f770d40f5ada6d547e91cd3147969702e1ae75 100644 +index ca19fc7ffc86b82fa793f330dfa73889246d23ac..f548f417ed57c18064d9bad2c26b7dc1a179a31b 100644 --- a/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java +++ b/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java @@ -49,7 +49,7 @@ public class RandomStrollGoal extends Goal { diff --git a/leaf-server/minecraft-patches/features/0077-Global-EULA-file.patch b/leaf-server/minecraft-patches/features/0075-Global-EULA-file.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0077-Global-EULA-file.patch rename to leaf-server/minecraft-patches/features/0075-Global-EULA-file.patch diff --git a/leaf-server/minecraft-patches/features/0078-5-second-TPS-average.patch b/leaf-server/minecraft-patches/features/0076-5-second-TPS-average.patch similarity index 92% rename from leaf-server/minecraft-patches/features/0078-5-second-TPS-average.patch rename to leaf-server/minecraft-patches/features/0076-5-second-TPS-average.patch index 8548c54b..34eeb9c4 100644 --- a/leaf-server/minecraft-patches/features/0078-5-second-TPS-average.patch +++ b/leaf-server/minecraft-patches/features/0076-5-second-TPS-average.patch @@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index d3cf7176903bede5c8c7a7e3dae3f585027f8354..c5ab5079c953ce9263491b791ebe421032e8f74d 100644 +index e7226c5056a493126d28a38416ffa909304aa9be..fd2cbb708b9eaf41d6fe8c9f22003d27883ff1c3 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -1094,6 +1094,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop() { -@@ -54,6 +58,11 @@ public final class MoonriseCommon { + public static final long WORKER_QUEUE_HOLD_TIME = (long)(20.0e6); // 20ms + public static final BalancedPrioritisedThreadPool WORKER_POOL = new BalancedPrioritisedThreadPool( +@@ -51,6 +55,11 @@ public final class MoonriseCommon { final int ioThreads = Math.max(1, configIoThreads); @@ -34,7 +34,7 @@ index 632920e04686d8a0fd0a60e87348be1fe7862a3c..ba0dd850f90564fab3a5b922bb28d244 IO_POOL.adjustThreadCount(ioThreads); diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 6abc57669e87f7f98f3b76af3c0e50825fea6eb1..aa9dd6b75e8d3cfa1c527ef28e195b06772e5ade 100644 +index 9f4d73fd321f6f0cd19fdd1b63068d2ea6c0816b..8cafbe5c2975cbd01bb1f39a92864af91c8b79bd 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { diff --git a/leaf-server/paper-patches/features/0004-Gale-configuration.patch b/leaf-server/paper-patches/features/0004-Gale-configuration.patch index 8637169a..46b4410d 100644 --- a/leaf-server/paper-patches/features/0004-Gale-configuration.patch +++ b/leaf-server/paper-patches/features/0004-Gale-configuration.patch @@ -70,10 +70,10 @@ index d0c4037c3cc60c54ea4c60ffc2c227107fecd01c..c01f3bd5022371b71f2bdc00ebf9d134 + } diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -index a972eeddbdc59e53279a7c5c704e28c2fcdf7290..c18f917171a5ba62afbeedd3638f020117394aff 100644 +index 940f60cd846107a82c1c523d73f9028b50a929d9..f6658f1b3c83e82f68ec0019bc6d40b98df6f1b8 100644 --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -@@ -341,13 +341,13 @@ public class PaperConfigurations extends Configurations > [!WARNING] -> Leaf 是一个面向性能的分支。在迁移到 Leaf 之前,请务必**提前备份**。欢迎任何人贡献优化或报告问题来帮助我们改进。 +> 当前 Leaf 1.21.9 是一个临时分支,与 1.21.8 分支隔离。 \ +> 上游更新 Paper 将每月进行一次,并且不会从 Leaf 1.21.8 接收修复,直到 Leaf 1.21.8 再次宣布稳定。 \ +> 它仅供想要尝鲜 1.21.9 的用户使用,**请勿**在生产环境中使用! [English](../../README.md) | **中文**