diff --git a/patches/server/0002-Dev-import-deobfuscation-fixes.patch b/patches/server/0002-Dev-import-deobfuscation-fixes.patch index 950d1c3..b354d50 100644 --- a/patches/server/0002-Dev-import-deobfuscation-fixes.patch +++ b/patches/server/0002-Dev-import-deobfuscation-fixes.patch @@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/net/minecraft/server/network/TextFilterClient.java b/src/main/java/net/minecraft/server/network/TextFilterClient.java -index 92a60fc35145b7dd5fe17ea9b6823a919f483945..2393b6a5f3f12c2b17b172ee8ca42ead218e2a10 100644 +index e0c6783071b1a6ff841842f8a88a990d0fe83180..4b3d2280326c7eeda4952c36edff141cbff90e16 100644 --- a/src/main/java/net/minecraft/server/network/TextFilterClient.java +++ b/src/main/java/net/minecraft/server/network/TextFilterClient.java @@ -98,38 +98,44 @@ public class TextFilterClient implements AutoCloseable { @@ -92,3 +92,29 @@ index 50a9f33aa31e9273c7c52d4bb2b02f0f884f7ba5..19779298b2b2ecbe30f9308dad1d8037 return this.allInstances.stream().filter(typeClass::isInstance).collect(Collectors.toList()); }); return Collections.unmodifiableCollection(list); +diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +index 5956a7759964f5e4939f062e93714fba64f53141..51ad507a3b625201ecca50bd92f8f089f3b4d60a 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +@@ -182,7 +182,7 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { + + @Override + public Brain getBrain() { +- return super.getBrain(); ++ return (Brain) super.getBrain(); // Gale - dev import deobfuscation fixes + } + + protected void updateActivity() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +index ac75c54e897565e340b66823caeed92ba1d1641a..e44eec821eaa1cd77569814000d4aa36253fb13d 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +@@ -70,7 +70,7 @@ public class PiglinBrute extends AbstractPiglin { + + @Override + public Brain getBrain() { +- return super.getBrain(); ++ return (Brain) super.getBrain(); // Gale - dev import deobfuscation fixes + } + + @Override diff --git a/patches/server/0010-Remove-vanilla-profiler.patch b/patches/server/0010-Remove-vanilla-profiler.patch new file mode 100644 index 0000000..d11f596 --- /dev/null +++ b/patches/server/0010-Remove-vanilla-profiler.patch @@ -0,0 +1,1810 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Thu, 22 Dec 2022 22:32:18 +0100 +Subject: [PATCH] Remove vanilla profiler + +License: MIT (https://opensource.org/licenses/MIT) +Gale - https://galemc.org + +This patch is based on the following patch: +"Remove Mojang Profiler" +By: BillyGalbreath +As part of: Purpur (https://github.com/PurpurMC/Purpur) +Licensed under: MIT (https://opensource.org/licenses/MIT) + +* Purpur copyright * + +MIT License + +Copyright (c) 2019-2022 PurpurMC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java +index 330f6c79417378da855326b4da665f9d240e748d..6f7b5884a82cd3a3483fbbd478c0e92987f0d833 100644 +--- a/src/main/java/net/minecraft/commands/Commands.java ++++ b/src/main/java/net/minecraft/commands/Commands.java +@@ -144,7 +144,6 @@ public class Commands { + CloneCommands.register(this.dispatcher, commandRegistryAccess); + DataCommands.register(this.dispatcher); + DataPackCommand.register(this.dispatcher); +- DebugCommand.register(this.dispatcher); + DefaultGameModeCommands.register(this.dispatcher); + DifficultyCommand.register(this.dispatcher); + EffectCommands.register(this.dispatcher, commandRegistryAccess); +@@ -300,13 +299,9 @@ public class Commands { + public int performCommand(ParseResults parseresults, String s, String label) { // CraftBukkit + CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource(); + +- commandlistenerwrapper.getServer().getProfiler().push(() -> { +- return "/" + s; +- }); +- + byte b0; + +- try { ++ { // Gale - Purpur - remove vanilla profiler + byte b1; + + try { +@@ -364,8 +359,6 @@ public class Commands { + + b0 = 0; + } +- } finally { +- commandlistenerwrapper.getServer().getProfiler().pop(); + } + + return b0; +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 3898e8a92edca52bc7d4e9ac061e24baceaec608..56387ce4bfdfbfd25fe1349298499653b0dda1dc 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -213,14 +213,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList(); +- private MetricsRecorder metricsRecorder; +- private ProfilerFiller profiler; +- private Consumer onMetricsRecordingStopped; +- private Consumer onMetricsRecordingFinished; +- private boolean willStartRecordingMetrics; +- @Nullable +- private MinecraftServer.TimeProfiler debugCommandProfiler; +- private boolean debugCommandProfilerDelayStart; + private ServerConnectionListener connection; + public final ChunkProgressListenerFactory progressListenerFactory; + private final ServerStatus status; +@@ -331,13 +323,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { +- this.stopRecordingMetrics(); +- }; +- this.onMetricsRecordingFinished = (path) -> { +- }; + this.status = new ServerStatus(); + this.random = RandomSource.create(); + this.port = -1; +@@ -936,9 +921,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; + try { + this.isSaving = true; +@@ -1441,7 +1411,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper + net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper + +- this.profiler.push(() -> { +- return worldserver + " " + worldserver.dimension().location(); +- }); + /* Drop global time updates + if (this.tickCount % 20 == 0) { + this.profiler.push("timeSync"); +@@ -1532,8 +1494,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { +- this.executeBlocking(() -> { +- this.saveDebugReport(path.resolve("server")); +- }); +- this.onMetricsRecordingFinished.accept(path); +- }); +- this.willStartRecordingMetrics = false; +- } +- +- this.profiler = SingleTickProfiler.decorateFiller(this.metricsRecorder.getProfiler(), SingleTickProfiler.createTickProfiler("Server")); +- this.metricsRecorder.startTick(); +- this.profiler.startTick(); +- } +- +- private void endMetricsRecordingTick() { +- this.profiler.endTick(); +- this.metricsRecorder.endTick(); +- } +- +- public boolean isRecordingMetrics() { +- return this.metricsRecorder.isRecording(); +- } +- +- public void startRecordingMetrics(Consumer resultConsumer, Consumer dumpConsumer) { +- this.onMetricsRecordingStopped = (methodprofilerresults) -> { +- this.stopRecordingMetrics(); +- resultConsumer.accept(methodprofilerresults); +- }; +- this.onMetricsRecordingFinished = dumpConsumer; +- this.willStartRecordingMetrics = true; +- } +- +- public void stopRecordingMetrics() { +- this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; +- } +- +- public void finishRecordingMetrics() { +- this.metricsRecorder.end(); +- } +- +- public void cancelRecordingMetrics() { +- this.metricsRecorder.cancel(); +- this.profiler = this.metricsRecorder.getProfiler(); +- } +- + public Path getWorldPath(LevelResource worldSavePath) { + return this.storageSource.getLevelPath(worldSavePath); + } +@@ -2573,25 +2474,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getTimes(String parentPath) { +- return Collections.emptyList(); +- } +- +- @Override +- public boolean saveResults(Path path) { +- return false; +- } +- +- @Override +- public long getStartTimeNano() { +- return TimeProfiler.this.startNanos; +- } +- +- @Override +- public int getStartTimeTicks() { +- return TimeProfiler.this.startTick; +- } +- +- @Override +- public long getEndTimeNano() { +- return endTime; +- } +- +- @Override +- public int getEndTimeTicks() { +- return endTick; +- } +- +- @Override +- public String getProfilerResults() { +- return ""; +- } +- }; +- } +- } +- + public static record ServerResourcePackInfo(String url, String hash, boolean isRequired, @Nullable Component prompt) { + + } +diff --git a/src/main/java/net/minecraft/server/ReloadableServerResources.java b/src/main/java/net/minecraft/server/ReloadableServerResources.java +index a9adb3ae346e9bb2ca335a6688163eb5d7a27e6d..cae1797677a9373321f5011e87bc5d04bb2bcf0a 100644 +--- a/src/main/java/net/minecraft/server/ReloadableServerResources.java ++++ b/src/main/java/net/minecraft/server/ReloadableServerResources.java +@@ -81,7 +81,7 @@ public class ReloadableServerResources { + + public static CompletableFuture loadResources(ResourceManager manager, RegistryAccess.Frozen dynamicRegistryManager, FeatureFlagSet enabledFeatures, Commands.CommandSelection environment, int functionPermissionLevel, Executor prepareExecutor, Executor applyExecutor) { + ReloadableServerResources reloadableServerResources = new ReloadableServerResources(dynamicRegistryManager, enabledFeatures, environment, functionPermissionLevel); +- return SimpleReloadInstance.create(manager, reloadableServerResources.listeners(), prepareExecutor, applyExecutor, DATA_RELOAD_INITIAL_TASK, LOGGER.isDebugEnabled()).done().whenComplete((void_, throwable) -> { ++ return SimpleReloadInstance.create(manager, reloadableServerResources.listeners(), prepareExecutor, applyExecutor, DATA_RELOAD_INITIAL_TASK, false).done().whenComplete((void_, throwable) -> { // Gale - Purpur - remove vanilla profiler + reloadableServerResources.commandBuildContext.missingTagAccessPolicy(CommandBuildContext.MissingTagAccessPolicy.FAIL); + }).thenApply((void_) -> { + return reloadableServerResources; +diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java +index 6483a1d461904a0584b6808b2f86ac7329bba963..a4e5fdd5c4667c51ecfea0e4d3139594fc366061 100644 +--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java ++++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java +@@ -57,10 +57,7 @@ public class ServerFunctionManager { + } + + private void executeTagFunctions(Collection functions, ResourceLocation label) { +- ProfilerFiller gameprofilerfiller = this.server.getProfiler(); +- + Objects.requireNonNull(label); +- gameprofilerfiller.push(label::toString); + Iterator iterator = functions.iterator(); + + while (iterator.hasNext()) { +@@ -68,8 +65,6 @@ public class ServerFunctionManager { + + this.execute(customfunction, this.getGameLoopSender()); + } +- +- this.server.getProfiler().pop(); + } + + public int execute(CommandFunction function, CommandSourceStack source) { +@@ -175,12 +170,10 @@ public class ServerFunctionManager { + return j; + } + +- try { ++ { // Gale - Purpur - remove vanilla profiler + ServerFunctionManager.QueuedCommand customfunctiondata_b = (ServerFunctionManager.QueuedCommand) this.commandQueue.removeFirst(); +- ProfilerFiller gameprofilerfiller = ServerFunctionManager.this.server.getProfiler(); + + Objects.requireNonNull(customfunctiondata_b); +- gameprofilerfiller.push(customfunctiondata_b::toString); + this.depth = customfunctiondata_b.depth; + customfunctiondata_b.execute(ServerFunctionManager.this, this.commandQueue, i, this.tracer); + if (!this.nestedCalls.isEmpty()) { +@@ -191,8 +184,6 @@ public class ServerFunctionManager { + list.forEach(deque::addFirst); + this.nestedCalls.clear(); + } +- } finally { +- ServerFunctionManager.this.server.getProfiler().pop(); + } + + ++j; +diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java +index 2212f9f48636357265d8e44aba415ea4f09f1fe7..d1e8123a114ea45846234535155df6cd039ba305 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +@@ -73,7 +73,6 @@ import net.minecraft.server.level.progress.ChunkProgressListener; + import net.minecraft.server.network.ServerPlayerConnection; + import net.minecraft.util.CsvOutput; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.thread.BlockableEventLoop; + import net.minecraft.util.thread.ProcessorHandle; + import net.minecraft.util.thread.ProcessorMailbox; +@@ -618,20 +617,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + } + + protected void tick(BooleanSupplier shouldKeepTicking) { +- ProfilerFiller gameprofilerfiller = this.level.getProfiler(); +- + try (Timing ignored = this.level.timings.poiUnload.startTiming()) { // Paper +- gameprofilerfiller.push("poi"); + this.poiManager.tick(shouldKeepTicking); + } // Paper +- gameprofilerfiller.popPush("chunk_unload"); + if (!this.level.noSave()) { + try (Timing ignored = this.level.timings.chunkUnload.startTiming()) { // Paper + this.processUnloads(shouldKeepTicking); + } // Paper + } +- +- gameprofilerfiller.pop(); + } + + public boolean hasWork() { +diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +index ca84eddbdb1e198b899750e5f6b3eafd25ce970f..d95c3b14c06421c03c99f84efb3a5319200f8a57 100644 +--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java ++++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +@@ -24,7 +24,6 @@ import net.minecraft.core.SectionPos; + import net.minecraft.network.protocol.Packet; + import net.minecraft.server.level.progress.ChunkProgressListener; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.thread.BlockableEventLoop; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.ai.village.poi.PoiManager; +@@ -428,16 +427,12 @@ public class ServerChunkCache extends ChunkSource { + return ifLoaded; + } + // Paper end +- ProfilerFiller gameprofilerfiller = this.level.getProfiler(); +- +- gameprofilerfiller.incrementCounter("getChunk"); + long k = ChunkPos.asLong(x, z); + + ChunkAccess ichunkaccess; + + // Paper - rewrite chunk system - there are no correct callbacks to remove items from cache in the new chunk system + +- gameprofilerfiller.incrementCounter("getChunkCacheMiss"); + CompletableFuture> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create, true); // Paper + ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor; + +@@ -625,24 +620,19 @@ public class ServerChunkCache extends ChunkSource { + // CraftBukkit start - modelled on below + public void purgeUnload() { + if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system +- this.level.getProfiler().push("purge"); + this.distanceManager.purgeStaleTickets(); + this.runDistanceManagerUpdates(); +- this.level.getProfiler().popPush("unload"); + this.chunkMap.tick(() -> true); +- this.level.getProfiler().pop(); + this.clearCache(); + } + // CraftBukkit end + + @Override + public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { +- this.level.getProfiler().push("purge"); + this.level.timings.doChunkMap.startTiming(); // Spigot + this.distanceManager.purgeStaleTickets(); + this.runDistanceManagerUpdates(); + this.level.timings.doChunkMap.stopTiming(); // Spigot +- this.level.getProfiler().popPush("chunks"); + if (tickChunks) { + this.level.timings.chunks.startTiming(); // Paper - timings + this.chunkMap.playerChunkManager.tick(); // Paper - this is mostly is to account for view distance changes +@@ -651,10 +641,8 @@ public class ServerChunkCache extends ChunkSource { + } + + this.level.timings.doChunkUnload.startTiming(); // Spigot +- this.level.getProfiler().popPush("unload"); + this.chunkMap.tick(shouldKeepTicking); + this.level.timings.doChunkUnload.stopTiming(); // Spigot +- this.level.getProfiler().pop(); + this.clearCache(); + } + +@@ -700,13 +688,10 @@ public class ServerChunkCache extends ChunkSource { + } + // Paper end - optimize isOutisdeRange + LevelData worlddata = this.level.getLevelData(); +- ProfilerFiller gameprofilerfiller = this.level.getProfiler(); + +- gameprofilerfiller.push("pollingChunks"); + int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); + boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit + +- gameprofilerfiller.push("naturalSpawnCount"); + this.level.timings.countNaturalMobs.startTiming(); // Paper - timings + int l = this.distanceManager.getNaturalSpawnChunkCount(); + // Paper start - per player mob spawning +@@ -724,13 +709,11 @@ public class ServerChunkCache extends ChunkSource { + this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings + + this.lastSpawnState = spawnercreature_d; +- gameprofilerfiller.popPush("filteringLoadedChunks"); + // Paper - moved down + this.level.timings.chunkTicks.startTiming(); // Paper + + // Paper - moved down + +- gameprofilerfiller.popPush("spawnAndTick"); + boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit + + // Paper - only shuffle if per-player mob spawning is disabled +@@ -781,15 +764,12 @@ public class ServerChunkCache extends ChunkSource { + } + // Paper end - optimise chunk tick iteration + this.level.timings.chunkTicks.stopTiming(); // Paper +- gameprofilerfiller.popPush("customSpawners"); + if (flag2) { + try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings + this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); + } // Paper - timings + } +- gameprofilerfiller.pop(); + // Paper start - use set of chunks requiring updates, rather than iterating every single one loaded +- gameprofilerfiller.popPush("broadcast"); + this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing + if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) { + ReferenceOpenHashSet copy = this.chunkMap.needsChangeBroadcasting.clone(); +@@ -803,7 +783,6 @@ public class ServerChunkCache extends ChunkSource { + } + } + this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing +- gameprofilerfiller.pop(); + // Paper end - use set of chunks requiring updates, rather than iterating every single one loaded + // Paper start - controlled flush for entity tracker packets + List disabledFlushes = new java.util.ArrayList<>(this.level.players.size()); +@@ -994,7 +973,6 @@ public class ServerChunkCache extends ChunkSource { + + @Override + protected void doRunTask(Runnable task) { +- ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); + super.doRunTask(task); + } + +diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java +index e9c7e0f0c411f4a810c9ab3b846c74353a6ef815..c44d75ccda1edc7d2d04c42fb1af141cd22b2354 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -76,7 +76,6 @@ import net.minecraft.util.CsvOutput; + import net.minecraft.util.Mth; + import net.minecraft.util.ProgressListener; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; +@@ -527,15 +526,17 @@ public class ServerLevel extends Level implements WorldGenLevel { + public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { + // Holder holder = worlddimension.type(); // CraftBukkit - decompile error + // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error +- super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration ++ super(iworlddataserver, resourcekey, worlddimension.type(), false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration// Gale - Purpur - remove vanilla profiler + this.pvpMode = minecraftserver.isPvpAllowed(); + this.convertable = convertable_conversionsession; + this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); + // CraftBukkit end + this.players = Lists.newArrayList(); + this.entityTickList = new EntityTickList(); +- this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier()); +- this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier()); ++ // Gale start - Purpur - remove vanilla profiler ++ this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded); ++ this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded); ++ // Gale end - Purpur - remove vanilla profiler + this.navigatingMobs = new ObjectOpenHashSet(); + this.blockEvents = new ObjectLinkedOpenHashSet(); + this.blockEventsToReschedule = new ArrayList(64); +@@ -633,12 +634,8 @@ public class ServerLevel extends Level implements WorldGenLevel { + } + } + // Paper end - optimise checkDespawn +- ProfilerFiller gameprofilerfiller = this.getProfiler(); +- + this.handlingTick = true; +- gameprofilerfiller.push("world border"); + this.getWorldBorder().tick(); +- gameprofilerfiller.popPush("weather"); + this.advanceWeatherCycle(); + int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); + long j; +@@ -665,32 +662,24 @@ public class ServerLevel extends Level implements WorldGenLevel { + + this.updateSkyBrightness(); + this.tickTime(); +- gameprofilerfiller.popPush("tickPending"); + timings.scheduledBlocks.startTiming(); // Paper + if (!this.isDebug()) { + j = this.getGameTime(); +- gameprofilerfiller.push("blockTicks"); + this.blockTicks.tick(j, 65536, this::tickBlock); +- gameprofilerfiller.popPush("fluidTicks"); + this.fluidTicks.tick(j, 65536, this::tickFluid); +- gameprofilerfiller.pop(); + } + timings.scheduledBlocks.stopTiming(); // Paper + +- gameprofilerfiller.popPush("raid"); + this.timings.raids.startTiming(); // Paper - timings + this.raids.tick(); + this.timings.raids.stopTiming(); // Paper - timings +- gameprofilerfiller.popPush("chunkSource"); + this.timings.chunkProviderTick.startTiming(); // Paper - timings + this.getChunkSource().tick(shouldKeepTicking, true); + this.timings.chunkProviderTick.stopTiming(); // Paper - timings +- gameprofilerfiller.popPush("blockEvents"); + timings.doSounds.startTiming(); // Spigot + this.runBlockEvents(); + timings.doSounds.stopTiming(); // Spigot + this.handlingTick = false; +- gameprofilerfiller.pop(); + boolean flag = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players + + if (flag) { +@@ -698,12 +687,9 @@ public class ServerLevel extends Level implements WorldGenLevel { + } + + if (flag || this.emptyTime++ < 300) { +- gameprofilerfiller.push("entities"); + timings.tickEntities.startTiming(); // Spigot + if (this.dragonFight != null) { +- gameprofilerfiller.push("dragonFight"); + this.dragonFight.tick(); +- gameprofilerfiller.pop(); + } + + org.spigotmc.ActivationRange.activateEntities(this); // Spigot +@@ -713,9 +699,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed + entity.discard(); + } else { +- gameprofilerfiller.push("checkDespawn"); + entity.checkDespawn(); +- gameprofilerfiller.pop(); + if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - now always true if in the ticking list + Entity entity1 = entity.getVehicle(); + +@@ -727,22 +711,17 @@ public class ServerLevel extends Level implements WorldGenLevel { + entity.stopRiding(); + } + +- gameprofilerfiller.push("tick"); + this.guardEntityTick(this::tickNonPassenger, entity); +- gameprofilerfiller.pop(); + } + } + } + }); + timings.entityTick.stopTiming(); // Spigot + timings.tickEntities.stopTiming(); // Spigot +- gameprofilerfiller.pop(); + this.tickBlockEntities(); + } + +- gameprofilerfiller.push("entityManagement"); + //this.entityManager.tick(); // Paper - rewrite chunk system +- gameprofilerfiller.pop(); + } + + @Override +@@ -801,9 +780,6 @@ public class ServerLevel extends Level implements WorldGenLevel { + boolean flag = this.isRaining(); + int j = chunkcoordintpair.getMinBlockX(); + int k = chunkcoordintpair.getMinBlockZ(); +- ProfilerFiller gameprofilerfiller = this.getProfiler(); +- +- gameprofilerfiller.push("thunder"); + final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change + + if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder +@@ -833,7 +809,6 @@ public class ServerLevel extends Level implements WorldGenLevel { + } + } + +- gameprofilerfiller.popPush("iceandsnow"); + int l; + + if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow +@@ -885,7 +860,6 @@ public class ServerLevel extends Level implements WorldGenLevel { + } + + // Paper start - optimise random block ticking +- gameprofilerfiller.popPush("randomTick"); + timings.chunkTicksBlocks.startTiming(); // Paper + if (randomTickSpeed > 0) { + LevelChunkSection[] sections = chunk.getSections(); +@@ -921,7 +895,6 @@ public class ServerLevel extends Level implements WorldGenLevel { + } + // Paper end - optimise random block ticking + timings.chunkTicksBlocks.stopTiming(); // Paper +- gameprofilerfiller.pop(); + } + + public Optional findLightningRod(BlockPos pos) { +@@ -1199,19 +1172,13 @@ public class ServerLevel extends Level implements WorldGenLevel { + try { + // Paper end - timings + entity.setOldPosAndRot(); +- ProfilerFiller gameprofilerfiller = this.getProfiler(); + + ++entity.tickCount; +- this.getProfiler().push(() -> { +- return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); +- }); +- gameprofilerfiller.incrementCounter("tickNonPassenger"); + if (isActive) { // Paper - EAR 2 + TimingHistory.activatedEntityTicks++; + entity.tick(); + entity.postTick(); // CraftBukkit + } else { entity.inactiveTick(); } // Paper - EAR 2 +- this.getProfiler().pop(); + } finally { timer.stopTiming(); } // Paper - timings + Iterator iterator = entity.getPassengers().iterator(); + +@@ -1240,12 +1207,6 @@ public class ServerLevel extends Level implements WorldGenLevel { + // Paper end + passenger.setOldPosAndRot(); + ++passenger.tickCount; +- ProfilerFiller gameprofilerfiller = this.getProfiler(); +- +- gameprofilerfiller.push(() -> { +- return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString(); +- }); +- gameprofilerfiller.incrementCounter("tickPassenger"); + // Paper start - EAR 2 + if (isActive) { + passenger.rideTick(); +@@ -1257,7 +1218,6 @@ public class ServerLevel extends Level implements WorldGenLevel { + vehicle.positionRider(passenger); + } + // Paper end - EAR 2 +- gameprofilerfiller.pop(); + Iterator iterator = passenger.getPassengers().iterator(); + + while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index c0b0a7fdb75266a7064d54bda6441953184ecc64..4b9be8345946fab0d5f2a206bf916b19d78765b5 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -1151,7 +1151,6 @@ public class ServerPlayer extends Player { + PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver); + + if (shapedetectorshape != null) { +- worldserver1.getProfiler().push("moving"); + worldserver = shapedetectorshape.world; // CraftBukkit + if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event + if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit +@@ -1174,8 +1173,6 @@ public class ServerPlayer extends Player { + worldserver = ((CraftWorld) exit.getWorld()).getHandle(); + // CraftBukkit end + +- worldserver1.getProfiler().pop(); +- worldserver1.getProfiler().push("placing"); + if (true) { // CraftBukkit + this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds + +@@ -1193,7 +1190,6 @@ public class ServerPlayer extends Player { + this.connection.teleport(exit); // CraftBukkit - use internal teleport without event + this.connection.resetPosition(); + worldserver.addDuringPortalTeleport(this); +- worldserver1.getProfiler().pop(); + this.triggerDimensionChangeTriggers(worldserver1); + this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); + playerlist.sendLevelInfo(this, worldserver); +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 0c2255b6e2fb7752f85b0f83d4f84732758bd14d..757146c2b20d731577983375d34afaa80df639d8 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -394,7 +394,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + this.aboveGroundVehicleTickCount = 0; + }} // Paper - end if (valid) + +- this.server.getProfiler().push("keepAlive"); + // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings + // This should effectively place the keepalive handling back to "as it was" before 1.12.2 + long currentTime = Util.getMillis(); +@@ -415,7 +414,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } + // Paper end + +- this.server.getProfiler().pop(); + // CraftBukkit start + for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; + if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable +diff --git a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java +index 828196decc89e7e03f88c4a3208ee1ab2bb69242..ff1ac081ba9de69bd684a26a6455ac2b6cd2cae9 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java ++++ b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java +@@ -5,7 +5,13 @@ import java.util.concurrent.Executor; + import net.minecraft.util.profiling.ProfilerFiller; + + public interface PreparableReloadListener { +- CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor); ++ // Gale start - Purpur - remove vanilla profiler ++ default CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) { ++ return this.reload(synchronizer, manager, prepareExecutor, applyExecutor); ++ } ++ ++ CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor); ++ // Gale end - Purpur - remove vanilla profiler + + default String getName() { + return this.getClass().getSimpleName(); +diff --git a/src/main/java/net/minecraft/server/packs/resources/ReloadableResourceManager.java b/src/main/java/net/minecraft/server/packs/resources/ReloadableResourceManager.java +index c83c6fe5f7e2dc00a36cdd76c23317f232a2336b..47091691ca667e8ee58fa96ee9a2a827bcee5ce3 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/ReloadableResourceManager.java ++++ b/src/main/java/net/minecraft/server/packs/resources/ReloadableResourceManager.java +@@ -43,7 +43,7 @@ public class ReloadableResourceManager implements ResourceManager, AutoCloseable + })); + this.resources.close(); + this.resources = new MultiPackResourceManager(this.type, packs); +- return SimpleReloadInstance.create(this.resources, this.listeners, prepareExecutor, applyExecutor, initialStage, LOGGER.isDebugEnabled()); ++ return SimpleReloadInstance.create(this.resources, this.listeners, prepareExecutor, applyExecutor, initialStage, false); // Gale - Purpur - remove vanilla profiler + } + + @Override +diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +index 9ddbfcf80d9a381dace78a62880f85a4d767e0eb..46695c08d4c84a5df964dbe0706ff0f8ba124364 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java ++++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +@@ -7,13 +7,9 @@ import net.minecraft.util.profiling.ProfilerFiller; + + public interface ResourceManagerReloadListener extends PreparableReloadListener { + @Override +- default CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) { ++ default CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor) { // Gale - Purpur - remove vanilla profiler + return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> { +- applyProfiler.startTick(); +- applyProfiler.push("listener"); + this.onResourceManagerReload(manager); +- applyProfiler.pop(); +- applyProfiler.endTick(); + }, applyExecutor); + } + +diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..47e75ec4a01f8a456ec6ebc13031c1f0c5537d6a 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java ++++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +@@ -2,15 +2,17 @@ package net.minecraft.server.packs.resources; + + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; ++ ++import net.minecraft.util.profiling.InactiveProfiler; + import net.minecraft.util.profiling.ProfilerFiller; + + public abstract class SimplePreparableReloadListener implements PreparableReloadListener { + @Override +- public final CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) { ++ public final CompletableFuture reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor) { // Gale - Purpur - remove vanilla profiler + return CompletableFuture.supplyAsync(() -> { +- return this.prepare(manager, prepareProfiler); ++ return this.prepare(manager, InactiveProfiler.INSTANCE); // Gale - Purpur - remove vanilla profiler + }, prepareExecutor).thenCompose(synchronizer::wait).thenAcceptAsync((prepared) -> { +- this.apply(prepared, manager, applyProfiler); ++ this.apply(prepared, manager, InactiveProfiler.INSTANCE); // Gale - Purpur - remove vanilla profiler + }, applyExecutor); + } + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 7f94da8059147760cbdc2476d0e8beda4a105f40..756e952a808ab5185f1feef16a121ed677242e37 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -787,7 +787,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + // CraftBukkit end + + public void baseTick() { +- this.level.getProfiler().push("entityBaseTick"); + if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Update last hurt when ticking + this.feetBlockState = null; + if (this.isPassenger() && this.getVehicle().isRemoved()) { +@@ -848,7 +847,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + + this.firstTick = false; +- this.level.getProfiler().pop(); + } + + public void setSharedFlagOnFire(boolean onFire) { +@@ -1022,7 +1020,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + } + +- this.level.getProfiler().push("move"); + if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) { + movement = movement.multiply(this.stuckSpeedMultiplier); + this.stuckSpeedMultiplier = Vec3.ZERO; +@@ -1031,7 +1028,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + // Paper start - ignore movement changes while inactive. + if (isTemporarilyActive && !(this instanceof ItemEntity || this instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) && movement == getDeltaMovement() && movementType == MoverType.SELF) { + setDeltaMovement(Vec3.ZERO); +- this.level.getProfiler().pop(); + return; + } + // Paper end +@@ -1052,8 +1048,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z); + } + +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("rest"); + boolean flag = !Mth.equal(movement.x, vec3d1.x); + boolean flag1 = !Mth.equal(movement.z, vec3d1.z); + +@@ -1071,9 +1065,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + BlockState iblockdata = this.level.getBlockState(blockposition); + + this.checkFallDamage(vec3d1.y, this.onGround, iblockdata, blockposition); +- if (this.isRemoved()) { +- this.level.getProfiler().pop(); +- } else { ++ if (!this.isRemoved()) { // Gale - Purpur - remove vanilla profiler + if (this.horizontalCollision) { + Vec3 vec3d2 = this.getDeltaMovement(); + +@@ -1212,8 +1204,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + if (this.isOnFire() && (this.isInPowderSnow || this.isInWaterRainOrBubble())) { + this.setRemainingFireTicks(-this.getFireImmuneTicks()); + } +- +- this.level.getProfiler().pop(); + } + } + // Paper start - detailed watchdog information +@@ -2884,7 +2874,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey); + + if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit +- this.level.getProfiler().push("portal"); + this.portalTime = i; + // Paper start + io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER); +@@ -2902,7 +2891,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + } // Paper + // CraftBukkit end +- this.level.getProfiler().pop(); + } + + this.isInsidePortal = false; +@@ -3367,14 +3355,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + // Paper end + if (this.level instanceof ServerLevel && !this.isRemoved()) { +- this.level.getProfiler().push("changeDimension"); + // CraftBukkit start + // this.decouple(); + if (worldserver == null) { + return null; + } + // CraftBukkit end +- this.level.getProfiler().push("reposition"); + PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit + + if (shapedetectorshape == null) { +@@ -3408,7 +3394,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + this.unRide(); + // CraftBukkit end + +- this.level.getProfiler().popPush("reloading"); + // Paper start - Change lead drop timing to prevent dupe + if (this instanceof Mob) { + ((Mob) this).dropLeash(true, true); // Paper drop lead +@@ -3431,10 +3416,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + + this.removeAfterChangingDimensions(); +- this.level.getProfiler().pop(); + ((ServerLevel) this.level).resetEmptyTime(); + worldserver.resetEmptyTime(); +- this.level.getProfiler().pop(); + return entity; + } + } else { +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index 9e075de3542bda8ae086c9ca68bcd00b16d565d0..90d45d9c7dca9ff4acde6fc8539dcaf8eb59fe11 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -393,7 +393,6 @@ public abstract class LivingEntity extends Entity { + } + + super.baseTick(); +- this.level.getProfiler().push("livingEntityBaseTick"); + if (this.fireImmune() || this.level.isClientSide) { + this.clearFire(); + } +@@ -495,7 +494,6 @@ public abstract class LivingEntity extends Entity { + this.yHeadRotO = this.yHeadRot; + this.yRotO = this.getYRot(); + this.xRotO = this.getXRot(); +- this.level.getProfiler().pop(); + } + + public boolean canSpawnSoulSpeedParticle() { +@@ -3040,10 +3038,7 @@ public abstract class LivingEntity extends Entity { + } + + this.run += (f3 - this.run) * 0.3F; +- this.level.getProfiler().push("headTurn"); + f2 = this.tickHeadTurn(f1, f2); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("rangeChecks"); + + // Paper start - stop large pitch and yaw changes from crashing the server + this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; +@@ -3055,7 +3050,6 @@ public abstract class LivingEntity extends Entity { + this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; + // Paper end + +- this.level.getProfiler().pop(); + this.animStep += f2; + if (this.isFallFlying()) { + ++this.fallFlyTicks; +@@ -3352,19 +3346,14 @@ public abstract class LivingEntity extends Entity { + } + + this.setDeltaMovement(d4, d5, d6); +- this.level.getProfiler().push("ai"); + if (this.isImmobile()) { + this.jumping = false; + this.xxa = 0.0F; + this.zza = 0.0F; + } else if (this.isEffectiveAi()) { +- this.level.getProfiler().push("newAi"); + this.serverAiStep(); +- this.level.getProfiler().pop(); + } + +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("jump"); + if (this.jumping && this.isAffectedByFluids()) { + double d7; + +@@ -3391,8 +3380,6 @@ public abstract class LivingEntity extends Entity { + this.noJumpDelay = 0; + } + +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("travel"); + this.xxa *= 0.98F; + this.zza *= 0.98F; + this.updateFallFlying(); +@@ -3401,8 +3388,6 @@ public abstract class LivingEntity extends Entity { + // SpigotTimings.timerEntityAIMove.startTiming(); // Spigot // Paper + this.travel(new Vec3((double) this.xxa, (double) this.yya, (double) this.zza)); + // SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot // Paper +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("freezing"); + boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); + int i; + +@@ -3422,15 +3407,12 @@ public abstract class LivingEntity extends Entity { + this.hurt(DamageSource.FREEZE, (float) i); + } + +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("push"); + if (this.autoSpinAttackTicks > 0) { + --this.autoSpinAttackTicks; + this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); + } + + this.pushEntities(); +- this.level.getProfiler().pop(); + // Paper start + if (((ServerLevel) this.level).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) { + if (this.xo != getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { +diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java +index 49b983064ea810382b6112f5dc7f93ba4e5710bd..c61b13268166f1f9f4a6f39391c3458410e62edc 100644 +--- a/src/main/java/net/minecraft/world/entity/Mob.java ++++ b/src/main/java/net/minecraft/world/entity/Mob.java +@@ -144,8 +144,10 @@ public abstract class Mob extends LivingEntity { + this.pathfindingMalus = Maps.newEnumMap(BlockPathTypes.class); + this.restrictCenter = BlockPos.ZERO; + this.restrictRadius = -1.0F; +- this.goalSelector = new GoalSelector(world.getProfilerSupplier()); +- this.targetSelector = new GoalSelector(world.getProfilerSupplier()); ++ // Gale start - Purpur - remove vanilla profiler ++ this.goalSelector = new GoalSelector(); ++ this.targetSelector = new GoalSelector(); ++ // Gale end - Purpur - remove vanilla profiler + this.lookControl = new LookControl(this); + this.moveControl = new MoveControl(this); + this.jumpControl = new JumpControl(this); +@@ -327,13 +329,10 @@ public abstract class Mob extends LivingEntity { + @Override + public void baseTick() { + super.baseTick(); +- this.level.getProfiler().push("mobBaseTick"); + if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) { + this.resetAmbientSoundTime(); + this.playAmbientSound(); + } +- +- this.level.getProfiler().pop(); + } + + @Override +@@ -638,7 +637,6 @@ public abstract class Mob extends LivingEntity { + @Override + public void aiStep() { + super.aiStep(); +- this.level.getProfiler().push("looting"); + if (!this.level.isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { + Vec3i baseblockposition = this.getPickupReach(); + List list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ())); +@@ -657,8 +655,6 @@ public abstract class Mob extends LivingEntity { + } + } + } +- +- this.level.getProfiler().pop(); + } + + protected Vec3i getPickupReach() { +@@ -871,42 +867,22 @@ public abstract class Mob extends LivingEntity { + return; + } + // Paper end +- this.level.getProfiler().push("sensing"); + this.sensing.tick(); +- this.level.getProfiler().pop(); + int i = this.level.getServer().getTickCount() + this.getId(); + + if (i % 2 != 0 && this.tickCount > 1) { +- this.level.getProfiler().push("targetSelector"); + this.targetSelector.tickRunningGoals(false); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("goalSelector"); + this.goalSelector.tickRunningGoals(false); +- this.level.getProfiler().pop(); + } else { +- this.level.getProfiler().push("targetSelector"); + this.targetSelector.tick(); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("goalSelector"); + this.goalSelector.tick(); +- this.level.getProfiler().pop(); + } + +- this.level.getProfiler().push("navigation"); + this.navigation.tick(); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("mob tick"); + this.customServerAiStep(); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("controls"); +- this.level.getProfiler().push("move"); + this.moveControl.tick(); +- this.level.getProfiler().popPush("look"); + this.lookControl.tick(); +- this.level.getProfiler().popPush("jump"); + this.jumpControl.tick(); +- this.level.getProfiler().pop(); +- this.level.getProfiler().pop(); + this.sendDebugPackets(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +index b738ee2d3801fadfd09313f05ae24593e56b0ec6..ce2804271bb67803c60c9121aec6c8dc0e99a1d9 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +@@ -11,7 +11,6 @@ import java.util.Set; + import java.util.function.Predicate; + import java.util.function.Supplier; + import java.util.stream.Stream; +-import net.minecraft.util.profiling.ProfilerFiller; + import org.slf4j.Logger; + + public class GoalSelector { +@@ -29,7 +28,6 @@ public class GoalSelector { + }; + private final Map lockedFlags = new EnumMap<>(Goal.Flag.class); + private final Set availableGoals = Sets.newLinkedHashSet(); +- private final Supplier profiler; + private final EnumSet disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be. + private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector + private int tickCount; +@@ -37,9 +35,7 @@ public class GoalSelector { + private int curRate; + private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector + +- public GoalSelector(Supplier profiler) { +- this.profiler = profiler; +- } ++ public GoalSelector() {} // Gale - Purpur - remove vanilla profiler + + public void addGoal(int priority, Goal goal) { + this.availableGoals.add(new WrappedGoal(priority, goal)); +@@ -102,9 +98,6 @@ public class GoalSelector { + } + + public void tick() { +- ProfilerFiller profilerFiller = this.profiler.get(); +- profilerFiller.push("goalCleanup"); +- + for(WrappedGoal wrappedGoal : this.availableGoals) { + if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { + wrappedGoal.stop(); +@@ -120,9 +113,6 @@ public class GoalSelector { + } + } + +- profilerFiller.pop(); +- profilerFiller.push("goalUpdate"); +- + for(WrappedGoal wrappedGoal2 : this.availableGoals) { + // Paper start + if (!wrappedGoal2.isRunning() && !goalContainsAnyFlags(wrappedGoal2, this.goalTypes) && goalCanBeReplacedForAllFlags(wrappedGoal2, this.lockedFlags) && wrappedGoal2.canUse()) { +@@ -141,21 +131,15 @@ public class GoalSelector { + } + } + +- profilerFiller.pop(); + this.tickRunningGoals(true); + } + + public void tickRunningGoals(boolean tickAll) { +- ProfilerFiller profilerFiller = this.profiler.get(); +- profilerFiller.push("goalTick"); +- + for(WrappedGoal wrappedGoal : this.availableGoals) { + if (wrappedGoal.isRunning() && (tickAll || wrappedGoal.requiresUpdateEveryTick())) { + wrappedGoal.tick(); + } + } +- +- profilerFiller.pop(); + } + + public Set getAvailableGoals() { +diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +index 97257b450e848f53fdb9b5b7affa57b03ea5f459..dcdd0125c6a520ae8f7fa7be5b7c7d43a51aa473 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java ++++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +@@ -171,12 +171,10 @@ public abstract class PathNavigation { + } + } + // Paper end +- this.level.getProfiler().push("pathfind"); + BlockPos blockPos = useHeadPos ? this.mob.blockPosition().above() : this.mob.blockPosition(); + int i = (int)(followRange + (float)range); + PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i)); + Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier); +- this.level.getProfiler().pop(); + if (path != null && path.getTarget() != null) { + this.targetPos = path.getTarget(); + this.reachRange = distance; +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java +index 288c6627906d07c0d223eacd84ae4eb31a349998..ed440b9a84ac0e4619c075491515fa072d6aebec 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java +@@ -26,9 +26,7 @@ public class Sensing { + } else if (this.unseen.contains(i)) { + return false; + } else { +- this.mob.level.getProfiler().push("hasLineOfSight"); + boolean bl = this.mob.hasLineOfSight(entity); +- this.mob.level.getProfiler().pop(); + if (bl) { + this.seen.add(i); + } else { +diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +index c0084b1f146a4697194c421519537e612ff737c0..fb20ba0a8a89d486476e8eac47f642209b4906a4 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java ++++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +@@ -230,12 +230,8 @@ public class Allay extends PathfinderMob implements InventoryCarrier { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("allayBrain"); + this.getBrain().tick((ServerLevel) this.level, this); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("allayActivityUpdate"); + AllayAi.updateActivity(this); +- this.level.getProfiler().pop(); + super.customServerAiStep(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +index 0d7f951e3837de7553d93f3d4525276048feb405..ebae68d28e9c97dcdf9630db124ff1a96adcd566 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java ++++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +@@ -287,12 +287,8 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); + +diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +index d9104d996c854cce1ff167706c93747cd69c3969..156323ebdb823d59bc8c23b675fb59da2133d21f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java ++++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +@@ -146,13 +146,9 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("camelBrain"); + Brain brain = (Brain) this.getBrain(); // Paper - decompile fix + brain.tick((ServerLevel)this.level, this); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("camelActivityUpdate"); + CamelAi.updateActivity(this); +- this.level.getProfiler().pop(); + super.customServerAiStep(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +index f2e84e832ad95df26fe3b9ba439ce38fc59b3585..831bd88383e48f704d6cb4f8f5137114705dbcc7 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java ++++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +@@ -179,12 +179,8 @@ public class Frog extends Animal implements VariantHolder { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("frogBrain"); + this.getBrain().tick((ServerLevel)this.level, this); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("frogActivityUpdate"); + FrogAi.updateActivity(this); +- this.level.getProfiler().pop(); + super.customServerAiStep(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +index e8574bd4b412c1db82aaec9dced47b63de9dbf28..dd6edc8d69903b79356d3603d5c48e7d862d4256 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java ++++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +@@ -78,12 +78,8 @@ public class Tadpole extends AbstractFish { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("tadpoleBrain"); + this.getBrain().tick((ServerLevel) this.level, this); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("tadpoleActivityUpdate"); + TadpoleAi.updateActivity(this); +- this.level.getProfiler().pop(); + super.customServerAiStep(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +index e9f7c08ae3ea9c578971b1ede88788572c20e277..c42e9924b417ef0b2a0f6a325357d59cb3628edf 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +@@ -190,12 +190,8 @@ public class Goat extends Animal { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("goatBrain"); + this.getBrain().tick((ServerLevel) this.level, this); +- this.level.getProfiler().pop(); +- this.level.getProfiler().push("goatActivityUpdate"); + GoatAi.updateActivity(this); +- this.level.getProfiler().pop(); + super.customServerAiStep(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +index 51ad507a3b625201ecca50bd92f8f089f3b4d60a..818d1f09b63ad0df9e3fae059a05801571a5606d 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +@@ -198,9 +198,7 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("zoglinBrain"); + this.getBrain().tick((ServerLevel)this.level, this); +- this.level.getProfiler().pop(); + this.updateActivity(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +index 45741410a13cffe3419e34b5607b048bbcf1c3ff..ca749e552ecc995e8a9d5168c1959b95c6e9cb97 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +@@ -128,9 +128,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("hoglinBrain"); + this.getBrain().tick((ServerLevel)this.level, this); +- this.level.getProfiler().pop(); + HoglinAi.updateActivity(this); + if (this.isConverting()) { + ++this.timeInOverworld; +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +index afa7ecfa8453da510ec5ccecb1ceeb1d9893d259..a2246ab400545284cb65c292012eaf8bb3376ad7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +@@ -310,9 +310,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("piglinBrain"); + this.getBrain().tick((ServerLevel) this.level, this); +- this.level.getProfiler().pop(); + PiglinAi.updateActivity(this); + super.customServerAiStep(); + } +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +index e44eec821eaa1cd77569814000d4aa36253fb13d..edee6a47e67a9e02ac269dcc16b1932cedb4d8aa 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +@@ -85,9 +85,7 @@ public class PiglinBrute extends AbstractPiglin { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("piglinBruteBrain"); + this.getBrain().tick((ServerLevel)this.level, this); +- this.level.getProfiler().pop(); + PiglinBruteAi.updateActivity(this); + PiglinBruteAi.maybePlayActivitySound(this); + super.customServerAiStep(); +diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +index 1ae7408048f951cb94d7cfbea60efc5567b1af84..d9799e7010ec879100ccacf2e4a4c160a47777a1 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java ++++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +@@ -274,9 +274,7 @@ public class Warden extends Monster implements VibrationListener.VibrationListen + protected void customServerAiStep() { + ServerLevel worldserver = (ServerLevel) this.level; + +- worldserver.getProfiler().push("wardenBrain"); + this.getBrain().tick(worldserver, this); +- this.level.getProfiler().pop(); + super.customServerAiStep(); + if ((this.tickCount + this.getId()) % 120 == 0) { + Warden.applyDarknessAround(worldserver, this.position(), this, 20); +diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java +index 18eac340386a396c9850f53f30d20a41c1437788..a4029cd16d964cd3a58f9f6e8471fbdf07de578b 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java +@@ -246,9 +246,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler + @Override + protected void customServerAiStep() { mobTick(false); } + protected void mobTick(boolean inactive) { +- this.level.getProfiler().push("villagerBrain"); + if (!inactive) this.getBrain().tick((ServerLevel) this.level, this); // Paper +- this.level.getProfiler().pop(); + if (this.assignProfessionWhenSpawned) { + this.assignProfessionWhenSpawned = false; + } +diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java +index e7ce14ab0732034107e735787354a6fb0ec90f54..a9aa5c23f424513ef121c9875f8b63b360fb9d32 100644 +--- a/src/main/java/net/minecraft/world/level/Explosion.java ++++ b/src/main/java/net/minecraft/world/level/Explosion.java +@@ -362,7 +362,6 @@ public class Explosion { + if (!iblockdata.isAir() && iblockdata.isDestroyable()) { // Paper + BlockPos blockposition1 = blockposition.immutable(); + +- this.level.getProfiler().push("explosion_blocks"); + if (block.dropFromExplosion(this)) { + Level world = this.level; + +@@ -384,7 +383,6 @@ public class Explosion { + + this.level.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 3); + block.wasExploded(this.level, blockposition, this); +- this.level.getProfiler().pop(); + } + } + +diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java +index 6b5740e4e73a753c9516d7cbde575c1826afa22a..d92a2ac99b22ae8617c295b44e6b8cab2a95ae48 100644 +--- a/src/main/java/net/minecraft/world/level/Level.java ++++ b/src/main/java/net/minecraft/world/level/Level.java +@@ -34,7 +34,6 @@ import net.minecraft.sounds.SoundSource; + import net.minecraft.util.AbortableIterationConsumer; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; +@@ -128,7 +127,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + private final ResourceKey dimensionTypeId; + private final Holder dimensionTypeRegistration; + public final WritableLevelData levelData; +- private final Supplier profiler; + public final boolean isClientSide; + private final WorldBorder worldBorder; + private final BiomeManager biomeManager; +@@ -268,7 +266,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + + public abstract ResourceKey getTypeKey(); + +- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration ++ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler + this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot + this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper + this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration +@@ -283,7 +281,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + } + + // CraftBukkit end +- this.profiler = supplier; + this.levelData = worlddatamutable; + this.dimensionTypeRegistration = holder; + this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> { +@@ -560,9 +557,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + BlockState iblockdata2 = this.getBlockState(pos); + + if ((flags & 128) == 0 && iblockdata2 != iblockdata1 && (iblockdata2.getLightBlock(this, pos) != iblockdata1.getLightBlock(this, pos) || iblockdata2.getLightEmission() != iblockdata1.getLightEmission() || iblockdata2.useShapeForLightOcclusion() || iblockdata1.useShapeForLightOcclusion())) { +- this.getProfiler().push("queueCheckLight"); + this.getChunkSource().getLightEngine().checkBlock(pos); +- this.getProfiler().pop(); + } + + /* +@@ -861,9 +856,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + } + + protected void tickBlockEntities() { +- ProfilerFiller gameprofilerfiller = this.getProfiler(); +- +- gameprofilerfiller.push("blockEntities"); + timings.tileEntityPending.startTiming(); // Spigot + this.tickingBlockEntities = true; + if (!this.pendingBlockEntityTickers.isEmpty()) { +@@ -908,7 +900,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + timings.tileEntityTick.stopTiming(); // Spigot + this.tickingBlockEntities = false; + co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper +- gameprofilerfiller.pop(); + spigotConfig.currentPrimedTnt = 0; // Spigot + } + +@@ -1101,7 +1092,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + + @Override + public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { +- this.getProfiler().incrementCounter("getEntities"); + List list = Lists.newArrayList(); + ((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call + return list; +@@ -1120,7 +1110,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + } + + public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { +- this.getProfiler().incrementCounter("getEntities"); + // Paper start - optimise this call + //TODO use limit + if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) { +@@ -1448,14 +1437,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + return false; + } + +- public ProfilerFiller getProfiler() { +- return (ProfilerFiller) this.profiler.get(); +- } +- +- public Supplier getProfilerSupplier() { +- return this.profiler; +- } +- + @Override + public BiomeManager getBiomeManager() { + return this.biomeManager; +diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +index 01b21f520ef1c834b9bafc3de85c1fa4fcf539d6..88ae013bdb94c228860c6e7869608a2777d52f3e 100644 +--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java ++++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +@@ -132,7 +132,6 @@ public final class NaturalSpawner { + } + + public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) { +- world.getProfiler().push("spawner"); + world.timings.mobSpawn.startTiming(); // Spigot + MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES; + int i = aenumcreaturetype.length; +@@ -189,7 +188,6 @@ public final class NaturalSpawner { + } + + world.timings.mobSpawn.stopTiming(); // Spigot +- world.getProfiler().pop(); + } + + // Paper start +diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java +index 0f1025495237aebe30132ace0832aa5718d6f9bb..efe922810507c96183a56a5e81a7b14214d8747b 100644 +--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java ++++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java +@@ -154,8 +154,4 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter { + public int getHeight() { + return this.level.getHeight(); + } +- +- public ProfilerFiller getProfiler() { +- return this.level.getProfiler(); +- } + } +diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +index 28e4b302284f955a73e75d0f4276d55fb51826f5..40e0c951604875ce96b200561cbbf51bab97e188 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +@@ -28,7 +28,6 @@ import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData; + import net.minecraft.server.level.ChunkHolder; + import net.minecraft.server.level.ServerChunkCache; + import net.minecraft.server.level.ServerLevel; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.Level; +@@ -1294,9 +1293,6 @@ public class LevelChunk extends ChunkAccess { + + if (LevelChunk.this.isTicking(blockposition)) { + try { +- ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); +- +- gameprofilerfiller.push(this::getType); + this.blockEntity.tickTimer.startTiming(); // Spigot + BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); + +@@ -1307,8 +1303,6 @@ public class LevelChunk extends ChunkAccess { + this.loggedInvalidBlockState = true; + LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata}); + } +- +- gameprofilerfiller.pop(); + } catch (Throwable throwable) { + if (throwable instanceof ThreadDeath) throw throwable; // Paper + // Paper start - Prevent tile entity and entity crashes +diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +index d23481453717f715124156b5d83f6448f720d049..c4052d1a7c2903564a8a6226c1b019d299c71b2a 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +@@ -12,7 +12,6 @@ import java.util.function.Function; + import java.util.stream.Collectors; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPos; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.profiling.metrics.MetricCategory; + import net.minecraft.world.entity.Mob; + import net.minecraft.world.level.PathNavigationRegion; +@@ -44,7 +43,7 @@ public class PathFinder { + map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos)); + } + // Paper end +- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier); ++ Path path = this.findPath(node, map, followRange, distance, rangeMultiplier); // Gale - Purpur - remove vanilla profiler + this.nodeEvaluator.done(); + return path; + } +@@ -52,9 +51,7 @@ public class PathFinder { + + @Nullable + // Paper start - optimize collection +- private Path findPath(ProfilerFiller profiler, Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { +- profiler.push("find_path"); +- profiler.markForCharting(MetricCategory.PATH_FINDING); ++ private Path findPath(Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { // Gale - Purpur - remove vanilla profiler + // Set set = positions.keySet(); + startNode.g = 0.0F; + startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection +diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java +index 7f1ac2cb29eb84833c0895442d611dfa0504527e..5447a3a4f0e4ca05377ba4f91811fd85b4f06f16 100644 +--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java ++++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java +@@ -23,7 +23,6 @@ import net.minecraft.Util; + import net.minecraft.core.BlockPos; + import net.minecraft.core.SectionPos; + import net.minecraft.core.Vec3i; +-import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.levelgen.structure.BoundingBox; + +@@ -32,7 +31,6 @@ public class LevelTicks implements LevelTickAccess { + return ScheduledTick.INTRA_TICK_DRAIN_ORDER.compare(a.peek(), b.peek()); + }; + private final LongPredicate tickCheck; +- private final Supplier profiler; + private final Long2ObjectMap> allContainers = new Long2ObjectOpenHashMap<>(); + private final Long2LongMap nextTickForContainer = Util.make(new Long2LongOpenHashMap(), (map) -> { + map.defaultReturnValue(Long.MAX_VALUE); +@@ -48,9 +46,8 @@ public class LevelTicks implements LevelTickAccess { + + }; + +- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier profilerGetter) { ++ public LevelTicks(LongPredicate tickingFutureReadyPredicate) { // Gale - Purpur - remove vanilla profiler + this.tickCheck = tickingFutureReadyPredicate; +- this.profiler = profilerGetter; + } + + public void addContainer(ChunkPos pos, LevelChunkTicks scheduler) { +@@ -86,20 +83,13 @@ public class LevelTicks implements LevelTickAccess { + } + + public void tick(long time, int maxTicks, BiConsumer ticker) { +- ProfilerFiller profilerFiller = this.profiler.get(); +- profilerFiller.push("collect"); +- this.collectTicks(time, maxTicks, profilerFiller); +- profilerFiller.popPush("run"); +- profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); ++ this.collectTicks(time, maxTicks); // Gale - Purpur - remove vanilla profiler + this.runCollectedTicks(ticker); +- profilerFiller.popPush("cleanup"); + this.cleanupAfterTick(); +- profilerFiller.pop(); + } + +- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) { ++ private void collectTicks(long time, int maxTicks) { // Gale - Purpur - remove vanilla profiler + this.sortContainersToTick(time); +- profiler.incrementCounter("containersToTick", this.containersToTick.size()); + this.drainContainers(time, maxTicks); + this.rescheduleLeftoverContainers(); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +index 3cb4860fea30bfaf2147b4f29a34336b6e417d6c..970496eca63f8e6020722aa4ed6813b63161da37 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +@@ -40,8 +40,10 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { + if (this.getRabbitType() == Type.THE_KILLER_BUNNY) { + // Reset goals and target finders. + Level world = ((CraftWorld) this.getWorld()).getHandle(); +- entity.goalSelector = new GoalSelector(world.getProfilerSupplier()); +- entity.targetSelector = new GoalSelector(world.getProfilerSupplier()); ++ // Gale start - Purpur - remove vanilla profiler ++ entity.goalSelector = new GoalSelector(); ++ entity.targetSelector = new GoalSelector(); ++ // Gale end - Purpur - remove vanilla profiler + entity.registerGoals(); + entity.initializePathFinderGoals(); + } diff --git a/patches/server/0010-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0011-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch similarity index 96% rename from patches/server/0010-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch rename to patches/server/0011-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch index 0ff5349..ae1c4dc 100644 --- a/patches/server/0010-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch +++ b/patches/server/0011-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch @@ -40,10 +40,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9e075de3542bda8ae086c9ca68bcd00b16d565d0..a635319daf8b9a7de45c080ce71c24a90530c45b 100644 +index 90d45d9c7dca9ff4acde6fc8539dcaf8eb59fe11..dc4bbb66a4077350657ef0034960a646ba03082b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3647,7 +3647,7 @@ public abstract class LivingEntity extends Entity { +@@ -3629,7 +3629,7 @@ public abstract class LivingEntity extends Entity { Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists @@ -74,10 +74,10 @@ index d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463..c970be55461f3063ec22ec0490781b97 default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) { // Paper start - Prevent raytrace from loading chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 6b5740e4e73a753c9516d7cbde575c1826afa22a..dde088d4ad90a63adc480492be42bc2dfc0f0cf7 100644 +index d92a2ac99b22ae8617c295b44e6b8cab2a95ae48..924e507a67e87c56346e7ae0ba6ef3fd8f72f853 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -406,6 +406,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -403,6 +403,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } diff --git a/patches/server/0011-Simpler-ShapelessRecipe-comparison-for-vanilla.patch b/patches/server/0012-Simpler-ShapelessRecipe-comparison-for-vanilla.patch similarity index 100% rename from patches/server/0011-Simpler-ShapelessRecipe-comparison-for-vanilla.patch rename to patches/server/0012-Simpler-ShapelessRecipe-comparison-for-vanilla.patch diff --git a/patches/server/0012-Reduce-projectile-chunk-loading.patch b/patches/server/0013-Reduce-projectile-chunk-loading.patch similarity index 100% rename from patches/server/0012-Reduce-projectile-chunk-loading.patch rename to patches/server/0013-Reduce-projectile-chunk-loading.patch diff --git a/patches/server/0013-Reduce-spooky-season-checks.patch b/patches/server/0014-Reduce-spooky-season-checks.patch similarity index 100% rename from patches/server/0013-Reduce-spooky-season-checks.patch rename to patches/server/0014-Reduce-spooky-season-checks.patch diff --git a/patches/server/0014-Move-random-tick-random.patch b/patches/server/0015-Move-random-tick-random.patch similarity index 88% rename from patches/server/0014-Move-random-tick-random.patch rename to patches/server/0015-Move-random-tick-random.patch index a055dff..f3d291b 100644 --- a/patches/server/0014-Move-random-tick-random.patch +++ b/patches/server/0015-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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e9c7e0f0c411f4a810c9ab3b846c74353a6ef815..2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2 100644 +index c44d75ccda1edc7d2d04c42fb1af141cd22b2354..a44374f7ec27bdb12ab69d516fb847d223fc60ee 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -793,7 +793,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -772,7 +772,6 @@ public class ServerLevel extends Level implements WorldGenLevel { } // Paper start - optimise random block ticking private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos(); @@ -31,10 +31,10 @@ index e9c7e0f0c411f4a810c9ab3b846c74353a6ef815..2f57e7c3cfbba9c6ee832dec01ef7079 public void tickChunk(LevelChunk chunk, int randomTickSpeed) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index dde088d4ad90a63adc480492be42bc2dfc0f0cf7..89f0914a2cc4e06363a0fb63774efc484ebcdab0 100644 +index 924e507a67e87c56346e7ae0ba6ef3fd8f72f853..860d398c2228b14000dcf8bf2460e7c2eaa56739 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -179,6 +179,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -177,6 +177,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here diff --git a/patches/server/0015-Optimize-random-calls-in-chunk-ticking.patch b/patches/server/0016-Optimize-random-calls-in-chunk-ticking.patch similarity index 88% rename from patches/server/0015-Optimize-random-calls-in-chunk-ticking.patch rename to patches/server/0016-Optimize-random-calls-in-chunk-ticking.patch index e569f20..6267670 100644 --- a/patches/server/0015-Optimize-random-calls-in-chunk-ticking.patch +++ b/patches/server/0016-Optimize-random-calls-in-chunk-ticking.patch @@ -52,22 +52,22 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index ca84eddbdb1e198b899750e5f6b3eafd25ce970f..5b8260b6a309bd1aba2286e8c1f8cfc44326adbd 100644 +index d95c3b14c06421c03c99f84efb3a5319200f8a57..8ed18a158a13dceca7cd342125c09e52ac0d013c 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -703,6 +703,7 @@ public class ServerChunkCache extends ChunkSource { - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); +@@ -689,6 +689,7 @@ public class ServerChunkCache extends ChunkSource { + // Paper end - optimize isOutisdeRange + LevelData worlddata = this.level.getLevelData(); - gameprofilerfiller.push("pollingChunks"); + this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c38bc280a0 100644 +index a44374f7ec27bdb12ab69d516fb847d223fc60ee..b589aeb3af47437a657bda806c99ef3fa95f22f8 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -795,6 +795,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -774,6 +774,8 @@ public class ServerLevel extends Level implements WorldGenLevel { private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos(); // Paper end @@ -76,8 +76,8 @@ index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c3 public void tickChunk(LevelChunk chunk, int randomTickSpeed) { ChunkPos chunkcoordintpair = chunk.getPos(); boolean flag = this.isRaining(); -@@ -805,7 +807,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - gameprofilerfiller.push("thunder"); +@@ -781,7 +783,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + int k = chunkcoordintpair.getMinBlockZ(); final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change - if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder @@ -85,8 +85,8 @@ index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c3 blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper if (this.isRainingAt(blockposition)) { DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); -@@ -835,7 +837,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - gameprofilerfiller.popPush("iceandsnow"); +@@ -810,7 +812,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + int l; - if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow @@ -95,10 +95,10 @@ index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c3 this.getRandomBlockPosition(j, 0, k, 15, blockposition); int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 28e4b302284f955a73e75d0f4276d55fb51826f5..9279e4fe06178528c2df539ca2dbf9e830ac787c 100644 +index 40e0c951604875ce96b200561cbbf51bab97e188..bca581f2a192015f5461e5bf776234687e5ae9fc 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -88,6 +88,18 @@ public class LevelChunk extends ChunkAccess { +@@ -87,6 +87,18 @@ public class LevelChunk extends ChunkAccess { private final LevelChunkTicks blockTicks; private final LevelChunkTicks fluidTicks; @@ -117,7 +117,7 @@ index 28e4b302284f955a73e75d0f4276d55fb51826f5..9279e4fe06178528c2df539ca2dbf9e8 public LevelChunk(Level world, ChunkPos pos) { this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null); } -@@ -118,6 +130,7 @@ public class LevelChunk extends ChunkAccess { +@@ -117,6 +129,7 @@ public class LevelChunk extends ChunkAccess { this.fluidTicks = fluidTickScheduler; // CraftBukkit start this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this); diff --git a/patches/server/0016-Reduce-enderman-teleport-chunk-lookups.patch b/patches/server/0017-Reduce-enderman-teleport-chunk-lookups.patch similarity index 100% rename from patches/server/0016-Reduce-enderman-teleport-chunk-lookups.patch rename to patches/server/0017-Reduce-enderman-teleport-chunk-lookups.patch diff --git a/patches/server/0017-Reduce-acquire-POI-for-stuck-entities.patch b/patches/server/0018-Reduce-acquire-POI-for-stuck-entities.patch similarity index 100% rename from patches/server/0017-Reduce-acquire-POI-for-stuck-entities.patch rename to patches/server/0018-Reduce-acquire-POI-for-stuck-entities.patch diff --git a/patches/server/0018-Remove-iterators-from-Inventory-contains.patch b/patches/server/0019-Remove-iterators-from-Inventory-contains.patch similarity index 96% rename from patches/server/0018-Remove-iterators-from-Inventory-contains.patch rename to patches/server/0019-Remove-iterators-from-Inventory-contains.patch index 99b6d30..0e5983b 100644 --- a/patches/server/0018-Remove-iterators-from-Inventory-contains.patch +++ b/patches/server/0019-Remove-iterators-from-Inventory-contains.patch @@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index a1a625a8dacf4d2bbf75ddd90dce1b1be663c919..1147eab33e1570f53ecc8e59218e96598535f501 100644 +index 5bc033bf59d49eda1f8f2574165bbcbeab7faa0f..b59185cff16528b2e5a0c52807db9f21e2a68dda 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java @@ -681,6 +681,8 @@ public class Inventory implements Container, Nameable { diff --git a/patches/server/0019-Check-targeting-range-before-getting-visibility.patch b/patches/server/0020-Check-targeting-range-before-getting-visibility.patch similarity index 100% rename from patches/server/0019-Check-targeting-range-before-getting-visibility.patch rename to patches/server/0020-Check-targeting-range-before-getting-visibility.patch diff --git a/patches/server/0020-Print-stack-trace-for-plugins-not-shutting-down-task.patch b/patches/server/0021-Print-stack-trace-for-plugins-not-shutting-down-task.patch similarity index 100% rename from patches/server/0020-Print-stack-trace-for-plugins-not-shutting-down-task.patch rename to patches/server/0021-Print-stack-trace-for-plugins-not-shutting-down-task.patch diff --git a/patches/server/0021-Improve-fluid-direction-caching.patch b/patches/server/0022-Improve-fluid-direction-caching.patch similarity index 99% rename from patches/server/0021-Improve-fluid-direction-caching.patch rename to patches/server/0022-Improve-fluid-direction-caching.patch index 3683164..171c97f 100644 --- a/patches/server/0021-Improve-fluid-direction-caching.patch +++ b/patches/server/0022-Improve-fluid-direction-caching.patch @@ -186,7 +186,7 @@ index 0000000000000000000000000000000000000000..bf6a36c933b686f0e34591dff3d43b37 + } +} diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -index ff40fe323964f173561a6838fb443e79abf9df38..91ba64113f8fba4e0ada8b10d379243ae8c03327 100644 +index 0ffc131baf5c0edc4f2ca0f466fcdb20be4a47b8..eafd6fa6c5eec1e3c164cbdc235be2681b7df04a 100644 --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java @@ -43,6 +43,8 @@ public abstract class FlowingFluid extends Fluid { diff --git a/patches/server/0022-Cache-on-climbable-check.patch b/patches/server/0023-Cache-on-climbable-check.patch similarity index 94% rename from patches/server/0022-Cache-on-climbable-check.patch rename to patches/server/0023-Cache-on-climbable-check.patch index 42db21b..3cae7e5 100644 --- a/patches/server/0022-Cache-on-climbable-check.patch +++ b/patches/server/0023-Cache-on-climbable-check.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/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a635319daf8b9a7de45c080ce71c24a90530c45b..1ef947f46f63589ce0e11c8db357cb817eecbbd2 100644 +index dc4bbb66a4077350657ef0034960a646ba03082b..1ca43696e693c49279a2dd5f5bba557e0a2704fb 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1934,6 +1934,20 @@ public abstract class LivingEntity extends Entity { +@@ -1932,6 +1932,20 @@ public abstract class LivingEntity extends Entity { return this.lastClimbablePos; } diff --git a/patches/server/0023-Config-to-disable-vanilla-profiler.patch b/patches/server/0023-Config-to-disable-vanilla-profiler.patch deleted file mode 100644 index 744bebb..0000000 --- a/patches/server/0023-Config-to-disable-vanilla-profiler.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martijn Muijsers -Date: Wed, 23 Nov 2022 21:45:42 +0100 -Subject: [PATCH] Config to disable vanilla profiler - -License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) -Gale - https://galemc.org - -This patch is based on the following patch: -"Config to disable method profiler" -By: Paul Sauve -As part of: Airplane (https://github.com/TECHNOVE/Airplane) -Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) - -* Airplane copyright * - -Airplane -Copyright (C) 2020 Technove LLC - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3898e8a92edca52bc7d4e9ac061e24baceaec608..4e2cb2923d1d2a337ffda5b1990d5c9caf47b779 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -160,6 +160,7 @@ import net.minecraft.world.phys.Vec2; - import net.minecraft.world.phys.Vec3; - import org.apache.commons.lang3.Validate; - import org.galemc.gale.configuration.GaleConfigurations; -+import org.galemc.gale.configuration.GaleGlobalConfiguration; - import org.slf4j.Logger; - - // CraftBukkit start -@@ -2243,6 +2244,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 3adad35d0e63091a53e639c7027ec784d18bc4e7..0ba38fddff7b3751d652d1148f993453164e2034 100644 +index 860d398c2228b14000dcf8bf2460e7c2eaa56739..70a4cabf3cc5a1d2fb4db462374f8d3aaf17487e 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -271,6 +271,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -268,6 +268,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); @@ -47,10 +47,10 @@ index 3adad35d0e63091a53e639c7027ec784d18bc4e7..0ba38fddff7b3751d652d1148f993453 + @Override public final int getHeight() { return this.height; } + // Gale end - Airplane - inline level height + - protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration + protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper -@@ -294,6 +303,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -290,6 +299,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); final DimensionType dimensionmanager = (DimensionType) holder.value(); diff --git a/patches/server/0031-Use-ThreadUnsafeRandom-for-mob-spawning.patch b/patches/server/0031-Use-ThreadUnsafeRandom-for-mob-spawning.patch index 89b7de5..90a7c96 100644 --- a/patches/server/0031-Use-ThreadUnsafeRandom-for-mob-spawning.patch +++ b/patches/server/0031-Use-ThreadUnsafeRandom-for-mob-spawning.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/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 01b21f520ef1c834b9bafc3de85c1fa4fcf539d6..6c5ff935adb434a67a8425f3b8b7335fbad92a43 100644 +index 88ae013bdb94c228860c6e7869608a2777d52f3e..969933ff94a1ae5a36d0550cd10d9e9803813136 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -417,13 +417,14 @@ public final class NaturalSpawner { +@@ -415,13 +415,14 @@ public final class NaturalSpawner { } } diff --git a/patches/server/0032-Remove-streams-and-iterators-from-range-check.patch b/patches/server/0032-Remove-streams-and-iterators-from-range-check.patch index 29d23dd..b8ff818 100644 --- a/patches/server/0032-Remove-streams-and-iterators-from-range-check.patch +++ b/patches/server/0032-Remove-streams-and-iterators-from-range-check.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/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 2212f9f48636357265d8e44aba415ea4f09f1fe7..eea6753afdd7e9d52746d0decb5cde63044012b5 100644 +index d1e8123a114ea45846234535155df6cd039ba305..41140fbf32fc4db1b2460e453420e538290f4f99 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1624,8 +1624,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1617,8 +1617,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance); } @@ -65,7 +65,7 @@ index 2212f9f48636357265d8e44aba415ea4f09f1fe7..eea6753afdd7e9d52746d0decb5cde63 Iterator iterator = this.entity.getIndirectPassengers().iterator(); while (iterator.hasNext()) { -@@ -1637,6 +1659,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1630,6 +1652,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider i = j; } } diff --git a/patches/server/0037-Remove-lambda-from-ticking-guard.patch b/patches/server/0037-Remove-lambda-from-ticking-guard.patch index 617af8a..6b3e53b 100644 --- a/patches/server/0037-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0037-Remove-lambda-from-ticking-guard.patch @@ -31,13 +31,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index aeaa5c08e8694b353b33f95e2973e6c38bc280a0..8924630ca5049f14e5e69323a2d4f7218e06a2aa 100644 +index b589aeb3af47437a657bda806c99ef3fa95f22f8..5f3e3383f20b850720835fab948bb610978e4fe9 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -728,7 +728,20 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -711,7 +711,20 @@ public class ServerLevel extends Level implements WorldGenLevel { + entity.stopRiding(); } - gameprofilerfiller.push("tick"); - this.guardEntityTick(this::tickNonPassenger, entity); + // Gale start - Airplane - remove lambda from ticking guard - copied from guardEntityTick + try { @@ -53,14 +53,14 @@ index aeaa5c08e8694b353b33f95e2973e6c38bc280a0..8924630ca5049f14e5e69323a2d4f721 + // Paper end + } + // Gale end - Airplane - remove lambda from ticking guard - copied from guardEntityTick - gameprofilerfiller.pop(); } } + } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0ba38fddff7b3751d652d1148f993453164e2034..14c2e816e6bc5801846c296318afe223abf95c5d 100644 +index 70a4cabf3cc5a1d2fb4db462374f8d3aaf17487e..95d8883fabc6a7ea6f9e6dfcff9e2f2fce917dfe 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1020,13 +1020,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1010,13 +1010,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { tickConsumer.accept(entity); MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick diff --git a/patches/server/0038-Reduce-entity-fluid-lookups-if-no-fluids.patch b/patches/server/0038-Reduce-entity-fluid-lookups-if-no-fluids.patch index 6c9b503..9f96112 100644 --- a/patches/server/0038-Reduce-entity-fluid-lookups-if-no-fluids.patch +++ b/patches/server/0038-Reduce-entity-fluid-lookups-if-no-fluids.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/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd8906680cd7bb5 100644 +index a8d10092a990aa63c71846425aed261ecb845514..910724dce6b96a0359808f2311dbd1e9ccee47ea 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4099,16 +4099,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4082,16 +4082,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean updateFluidHeightAndDoFluidPushing(TagKey tag, double speed) { @@ -60,7 +60,7 @@ index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd89066 double d1 = 0.0D; boolean flag = this.isPushedByFluid(); boolean flag1 = false; -@@ -4116,14 +4118,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4099,14 +4101,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { int k1 = 0; BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); @@ -128,7 +128,7 @@ index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd89066 if (d2 >= axisalignedbb.minY) { flag1 = true; -@@ -4145,9 +4194,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4128,9 +4177,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // CraftBukkit end } } diff --git a/patches/server/0039-SIMD-support.patch b/patches/server/0039-SIMD-support.patch index ab20632..2e8adfe 100644 --- a/patches/server/0039-SIMD-support.patch +++ b/patches/server/0039-SIMD-support.patch @@ -13,7 +13,7 @@ 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/build.gradle.kts b/build.gradle.kts -index 977edc4adb5414e83d289cca295baa6bfbadaa52..a63dce4a46a9df755a6dce8c959f3a0f1e151f67 100644 +index ebe3f85542004002713dd327e8a423f2570695ed..f3287cea49ee7352a1065dc65927ab9922d0a9c4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,6 +62,7 @@ tasks.withType { @@ -68,12 +68,12 @@ index 9c3ccbbd657d1605b8fabb6e01c11ff31f39a17e..1d1db89362b78ac34d46cdd71b9ab274 this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setMotd(dedicatedserverproperties.motd); diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 5bf0c4d9cf136cd19d87ee04a834413240eec339..a1d5197a5e7a00fad1025741ef8adcea45d42533 100644 +index af4883f8939d017866a9b057491a8400b11fe009..9bdbd921acdbfdc8da49ce113d009b58749c1d5d 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -43,6 +43,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -41,6 +41,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart { - public boolean disableVanillaProfiler = true; // Gale - Airplane - config to disable vanilla profiler + } + // Gale start - Pufferfish - SIMD support + public Simd simd; diff --git a/patches/server/0041-Reduce-in-wall-checks.patch b/patches/server/0041-Reduce-in-wall-checks.patch index 56b5c2d..17a03f7 100644 --- a/patches/server/0041-Reduce-in-wall-checks.patch +++ b/patches/server/0041-Reduce-in-wall-checks.patch @@ -28,10 +28,10 @@ but is so much cheaper than the suffocation check that it's worth keeping it. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1ef947f46f63589ce0e11c8db357cb817eecbbd2..b109c55a31a9e5a0813e360d8a3c1b13d1bfd416 100644 +index 1ca43696e693c49279a2dd5f5bba557e0a2704fb..197c99b23584ef1aed1be821d9673bacabb561e5 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -402,7 +402,10 @@ public abstract class LivingEntity extends Entity { +@@ -401,7 +401,10 @@ public abstract class LivingEntity extends Entity { boolean flag = this instanceof net.minecraft.world.entity.player.Player; if (!this.level.isClientSide) { @@ -43,7 +43,7 @@ index 1ef947f46f63589ce0e11c8db357cb817eecbbd2..b109c55a31a9e5a0813e360d8a3c1b13 this.hurt(DamageSource.IN_WALL, 1.0F); } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) { double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone(); -@@ -1327,6 +1330,15 @@ public abstract class LivingEntity extends Entity { +@@ -1325,6 +1328,15 @@ public abstract class LivingEntity extends Entity { return this.getHealth() <= 0.0F; } diff --git a/patches/server/0045-Do-not-process-chat-commands-before-player-has-joine.patch b/patches/server/0045-Do-not-process-chat-commands-before-player-has-joine.patch index 0f9b3ca..e79ce87 100644 --- a/patches/server/0045-Do-not-process-chat-commands-before-player-has-joine.patch +++ b/patches/server/0045-Do-not-process-chat-commands-before-player-has-joine.patch @@ -13,10 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0c2255b6e2fb7752f85b0f83d4f84732758bd14d..4f828048114172c399c6ce7bfa4bead007473269 100644 +index 757146c2b20d731577983375d34afaa80df639d8..ba408197c1d949800726bd08563c25033d84072b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2330,6 +2330,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2328,6 +2328,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); return Optional.empty(); diff --git a/patches/server/0046-Do-not-log-invalid-statistics.patch b/patches/server/0046-Do-not-log-invalid-statistics.patch index e230b3a..0c7f5c1 100644 --- a/patches/server/0046-Do-not-log-invalid-statistics.patch +++ b/patches/server/0046-Do-not-log-invalid-statistics.patch @@ -44,10 +44,10 @@ index 72946e324c575ef39f3939225b96b68f724da460..75e2a7d19a7056b73c1524902e44cca0 } } diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index a1d5197a5e7a00fad1025741ef8adcea45d42533..c67adaa664bfe2b371f14efa83ea200b0e1006f0 100644 +index 9bdbd921acdbfdc8da49ce113d009b58749c1d5d..d407916de006a68318de63b81773e0dfe0d9c119 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -53,4 +53,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -51,4 +51,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { } diff --git a/patches/server/0047-Do-not-log-empty-message-warnings.patch b/patches/server/0047-Do-not-log-empty-message-warnings.patch index 55cc50f..72cc615 100644 --- a/patches/server/0047-Do-not-log-empty-message-warnings.patch +++ b/patches/server/0047-Do-not-log-empty-message-warnings.patch @@ -7,7 +7,7 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a51896aec 100644 +index ba408197c1d949800726bd08563c25033d84072b..d98928904f74a86c72dbfc402723d50fb1b62f28 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -182,6 +182,8 @@ import net.minecraft.world.phys.Vec3; @@ -19,7 +19,7 @@ index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a import org.slf4j.Logger; // CraftBukkit start -@@ -2538,7 +2540,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2536,7 +2538,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // CraftBukkit start String s = message.signedContent(); if (s.isEmpty()) { @@ -29,10 +29,10 @@ index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a final String conversationInput = s; this.server.processQueue.add(new Runnable() { diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index c67adaa664bfe2b371f14efa83ea200b0e1006f0..f292156b411b4c0f5db8fa15c92df395acb6e901 100644 +index d407916de006a68318de63b81773e0dfe0d9c119..77a7a73c36ab84f5e889651795f9dd500096ca95 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -58,6 +58,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -56,6 +56,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics diff --git a/patches/server/0048-Do-not-log-ignored-advancements.patch b/patches/server/0048-Do-not-log-ignored-advancements.patch index ab2b394..e0bccb0 100644 --- a/patches/server/0048-Do-not-log-ignored-advancements.patch +++ b/patches/server/0048-Do-not-log-ignored-advancements.patch @@ -58,10 +58,10 @@ index a0c19503aabab5378d672a30163d35a5ba05b6c1..5ba0a756d45350dcda3caa5518c9a47a // CraftBukkit end } else { diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index f292156b411b4c0f5db8fa15c92df395acb6e901..ae00ec83b9ba545f56d606a5c9802aab97fdefcb 100644 +index 77a7a73c36ab84f5e889651795f9dd500096ca95..a639a7a199adc4c7f15b6d678ca04c63ecd602cc 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -57,6 +57,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -55,6 +55,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public class LogToConsole extends ConfigurationPart { public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics diff --git a/patches/server/0049-Do-not-log-setBlock-in-far-chunks.patch b/patches/server/0049-Do-not-log-setBlock-in-far-chunks.patch index f1d25bf..f52ccb3 100644 --- a/patches/server/0049-Do-not-log-setBlock-in-far-chunks.patch +++ b/patches/server/0049-Do-not-log-setBlock-in-far-chunks.patch @@ -57,10 +57,10 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..d2bbbb0e73dafd2294838137bfbd16ac Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); hasSetFarWarned = true; diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index ae00ec83b9ba545f56d606a5c9802aab97fdefcb..242f39617ec5f146766c460ab65f4716f2847354 100644 +index a639a7a199adc4c7f15b6d678ca04c63ecd602cc..c91ab97a879c74e2d3c1972c76a6dc42e1448113 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -56,6 +56,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements diff --git a/patches/server/0050-Do-not-log-unrecognized-recipes.patch b/patches/server/0050-Do-not-log-unrecognized-recipes.patch index dfc4f18..a8dd7fb 100644 --- a/patches/server/0050-Do-not-log-unrecognized-recipes.patch +++ b/patches/server/0050-Do-not-log-unrecognized-recipes.patch @@ -58,10 +58,10 @@ index d13ed3069e944d138442ea440ac3eaf8d44c18d3..c89b8e5ea10a465160504f7364db4741 handler.accept((Recipe) optional.get()); } diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 242f39617ec5f146766c460ab65f4716f2847354..ce5274e4093962a839f05063ffb7e2ab6244343b 100644 +index c91ab97a879c74e2d3c1972c76a6dc42e1448113..efb7e3198ab4f327ec6816af143350460f8bd900 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -59,6 +59,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -57,6 +57,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks diff --git a/patches/server/0051-Do-not-log-legacy-Material-initialization.patch b/patches/server/0051-Do-not-log-legacy-Material-initialization.patch index 84be0d1..56e2aa9 100644 --- a/patches/server/0051-Do-not-log-legacy-Material-initialization.patch +++ b/patches/server/0051-Do-not-log-legacy-Material-initialization.patch @@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java -index b2a15c986c7500a0ce227a54cb61ec3f5378f6f3..3ea9b877a563d2b7894cf59799d654ebaa1f9819 100644 +index 6a083e269b828ef53f943cae56b029f2e0021ef1..8244810e9ac8aed6248cca71af3be31292cd99aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java @@ -31,6 +31,7 @@ import org.bukkit.Material; @@ -58,10 +58,10 @@ index b2a15c986c7500a0ce227a54cb61ec3f5378f6f3..3ea9b877a563d2b7894cf59799d654eb new Exception().printStackTrace(); } diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index ce5274e4093962a839f05063ffb7e2ab6244343b..0f276a6a3521e97afbb20ea5421a16180f626d45 100644 +index efb7e3198ab4f327ec6816af143350460f8bd900..933c81e539e2da1901c9b7abf4f0c616d62f4cd6 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -60,6 +60,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes diff --git a/patches/server/0052-Do-not-log-expired-message-warnings.patch b/patches/server/0052-Do-not-log-expired-message-warnings.patch index 80f5eb8..9bc5e05 100644 --- a/patches/server/0052-Do-not-log-expired-message-warnings.patch +++ b/patches/server/0052-Do-not-log-expired-message-warnings.patch @@ -28,10 +28,10 @@ index c0a80824a0307ea673805015119cc834b268f0dc..d7c6e90ccf3a8ce58e5533c5158ce626 return playerChatMessage; diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 0f276a6a3521e97afbb20ea5421a16180f626d45..6c6f9fabb208baf5419c5dd6290b83a7d983c6d7 100644 +index 933c81e539e2da1901c9b7abf4f0c616d62f4cd6..6547faacb4fcd7457a7cf22d894cf18a8d38e329 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -65,6 +65,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -63,6 +63,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public Chat chat; public class Chat extends ConfigurationPart { public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings diff --git a/patches/server/0053-Do-not-log-Not-Secure-marker.patch b/patches/server/0053-Do-not-log-Not-Secure-marker.patch index e23adc7..9be4515 100644 --- a/patches/server/0053-Do-not-log-Not-Secure-marker.patch +++ b/patches/server/0053-Do-not-log-Not-Secure-marker.patch @@ -49,10 +49,10 @@ index b348d33726b2b14ea2d12ce3430df2c0b94295f4..fe7037310e1a2b5fc2956b565982847e boolean flag1 = false; diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 6c6f9fabb208baf5419c5dd6290b83a7d983c6d7..ce8c7032dff4e119d018d42fa579f9231cf41961 100644 +index 6547faacb4fcd7457a7cf22d894cf18a8d38e329..dbe60db4367270eb8041d39922b6b4eab6b709f7 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -66,6 +66,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -64,6 +64,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public class Chat extends ConfigurationPart { public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings public boolean expiredMessageWarning = false; // Gale - do not log expired message warnings diff --git a/patches/server/0056-Softly-log-invalid-pool-element-errors.patch b/patches/server/0056-Softly-log-invalid-pool-element-errors.patch index 096fec6..8265dbd 100644 --- a/patches/server/0056-Softly-log-invalid-pool-element-errors.patch +++ b/patches/server/0056-Softly-log-invalid-pool-element-errors.patch @@ -39,7 +39,7 @@ index d2b4654a9095a678bbc9e004af969cf54da0fcab..d797bac97ec1adec7a25a26c8e052e70 }); this.rotation = Rotation.valueOf(nbt.getString("rotation")); diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index ce8c7032dff4e119d018d42fa579f9231cf41961..24ed4fb7ddacba24873755edfa88912ffdf81cc8 100644 +index dbe60db4367270eb8041d39922b6b4eab6b709f7..9881f69ff25f1eda31ee1f4667c4fa9a8f1d4c23 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java @@ -4,8 +4,12 @@ package org.galemc.gale.configuration; @@ -55,7 +55,7 @@ index ce8c7032dff4e119d018d42fa579f9231cf41961..24ed4fb7ddacba24873755edfa88912f @SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"}) public class GaleGlobalConfiguration extends ConfigurationPart { static final int CURRENT_VERSION = 1; -@@ -54,7 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -52,7 +56,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { } public LogToConsole logToConsole; @@ -64,7 +64,7 @@ index ce8c7032dff4e119d018d42fa579f9231cf41961..24ed4fb7ddacba24873755edfa88912f public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements -@@ -69,6 +73,21 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -67,6 +71,21 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean notSecureMarker = true; // Gale - do not log Not Secure marker } diff --git a/patches/server/0057-Fix-legacy-colors-in-console.patch b/patches/server/0057-Fix-legacy-colors-in-console.patch index b0ca843..df36fa5 100644 --- a/patches/server/0057-Fix-legacy-colors-in-console.patch +++ b/patches/server/0057-Fix-legacy-colors-in-console.patch @@ -131,10 +131,10 @@ index b9922b07cb105618390187d98acdf89e728e1f5a..a66d202749f243f6752df5027cb7c82f + } diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 24ed4fb7ddacba24873755edfa88912ffdf81cc8..0965f43068d12a85090906568e2c1b731730f015 100644 +index 9881f69ff25f1eda31ee1f4667c4fa9a8f1d4c23..ef0a77ed85bf35f5d388cf28ac5d84e553ad1144 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -60,6 +60,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public LogToConsole logToConsole; public class LogToConsole extends ConfigurationPart.Post { // Gale - EMC - softly log invalid pool element errors diff --git a/patches/server/0067-Reduce-array-allocations.patch b/patches/server/0067-Reduce-array-allocations.patch index 38818f3..91b5cc3 100644 --- a/patches/server/0067-Reduce-array-allocations.patch +++ b/patches/server/0067-Reduce-array-allocations.patch @@ -409,7 +409,7 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..0c4c62674b4c7e8e3921c7eb3ef72675 OptionSpec optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]); OptionSpec optionspec12 = optionparser.accepts("serverId").withRequiredArg(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4e2cb2923d1d2a337ffda5b1990d5c9caf47b779..1307801779caa69bdf967134ecbfcb42764243ac 100644 +index 56387ce4bfdfbfd25fe1349298499653b0dda1dc..81bb87b729f20be8ca4e5be0c2f5b1b6c1ce4422 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -49,6 +49,8 @@ import java.util.stream.Collectors; @@ -421,7 +421,7 @@ index 4e2cb2923d1d2a337ffda5b1990d5c9caf47b779..1307801779caa69bdf967134ecbfcb42 import net.minecraft.CrashReport; import net.minecraft.ReportedException; import net.minecraft.SharedConstants; -@@ -1357,8 +1359,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getCurrentlyTickingEntities() { Entity ticking = currentlyTickingEntity.get(); @@ -479,7 +479,7 @@ index 8924630ca5049f14e5e69323a2d4f7218e06a2aa..a980908087b47869cd9326dbc6297456 return ret; } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c4597ad67 100644 +index d98928904f74a86c72dbfc402723d50fb1b62f28..51a336fa29e92669ce48b7724de0134480ac6adb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -28,6 +28,8 @@ import java.util.function.UnaryOperator; @@ -516,7 +516,7 @@ index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractAtEntityEvent; -@@ -405,7 +403,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -404,7 +402,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (this.keepAlivePending) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info @@ -525,7 +525,7 @@ index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c } } else { if (elapsedTime >= 15000L) { // 15 seconds -@@ -870,13 +868,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -868,13 +866,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async // CraftBukkit start if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable @@ -541,7 +541,7 @@ index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c return; } // Paper end -@@ -3257,7 +3255,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3255,7 +3253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -697,10 +697,10 @@ index 97ff19efa0b3943ccb7a6e02cba6ed2fea61adac..b2ae2bd8bd4ff3cb6457e8c08172e348 private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) { this.type = type; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index b109c55a31a9e5a0813e360d8a3c1b13d1bfd416..46ad26f8f6680446718bb13158eca3f712f1986e 100644 +index 197c99b23584ef1aed1be821d9673bacabb561e5..6ad1e6c4a20bec34b56276736ee616b5dcff0354 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3109,7 +3109,7 @@ public abstract class LivingEntity extends Entity { +@@ -3103,7 +3103,7 @@ public abstract class LivingEntity extends Entity { @Nullable private Map collectEquipmentChanges() { Map map = null; @@ -710,10 +710,10 @@ index b109c55a31a9e5a0813e360d8a3c1b13d1bfd416..46ad26f8f6680446718bb13158eca3f7 for (int j = 0; j < i; ++j) { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e8a11bb34 100644 +index c61b13268166f1f9f4a6f39391c3458410e62edc..2e98c0ad3776ec4bf71e686e856a8c445ee95b9b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1039,7 +1039,7 @@ public abstract class Mob extends LivingEntity { +@@ -1015,7 +1015,7 @@ public abstract class Mob extends LivingEntity { @Override protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) { super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops); @@ -722,7 +722,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e int j = aenumitemslot.length; for (int k = 0; k < j; ++k) { -@@ -1101,7 +1101,7 @@ public abstract class Mob extends LivingEntity { +@@ -1077,7 +1077,7 @@ public abstract class Mob extends LivingEntity { } boolean flag = true; @@ -731,7 +731,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e int j = aenumitemslot.length; for (int k = 0; k < j; ++k) { -@@ -1188,7 +1188,7 @@ public abstract class Mob extends LivingEntity { +@@ -1164,7 +1164,7 @@ public abstract class Mob extends LivingEntity { float f = localDifficulty.getSpecialMultiplier(); this.enchantSpawnedWeapon(random, f); @@ -740,7 +740,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e int i = aenumitemslot.length; for (int j = 0; j < i; ++j) { -@@ -1405,7 +1405,7 @@ public abstract class Mob extends LivingEntity { +@@ -1381,7 +1381,7 @@ public abstract class Mob extends LivingEntity { t0.setInvulnerable(this.isInvulnerable()); if (flag) { t0.setCanPickUpLoot(this.canPickUpLoot()); @@ -815,7 +815,7 @@ index 2bfbdaeb2b0d99dfd956cd5936403fe8b0eeae64..84f1c4c3ded4f201899f3c74e639349b public Enchantments() {} diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 14c2e816e6bc5801846c296318afe223abf95c5d..6fb3e25c7972c681284dd611eedb214c9335697e 100644 +index 95d8883fabc6a7ea6f9e6dfcff9e2f2fce917dfe..0ab14271e6efebe49ed9fec904e47566691b9f40 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -12,6 +12,8 @@ import java.util.function.Consumer; @@ -827,7 +827,7 @@ index 14c2e816e6bc5801846c296318afe223abf95c5d..6fb3e25c7972c681284dd611eedb214c import net.minecraft.CrashReport; import net.minecraft.CrashReportCategory; import net.minecraft.core.BlockPos; -@@ -1593,7 +1595,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1568,7 +1570,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) { io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ); if (slices == null) { diff --git a/patches/server/0068-Optimize-sun-burn-tick.patch b/patches/server/0068-Optimize-sun-burn-tick.patch index 97f7f28..e7e420d 100644 --- a/patches/server/0068-Optimize-sun-burn-tick.patch +++ b/patches/server/0068-Optimize-sun-burn-tick.patch @@ -13,7 +13,7 @@ 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/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491fe9ceeec3 100644 +index 4b64c6009d93b034b16b67d743050d2a634db6ff..660e8d27bb8733f01d7e60b841877ee14579ede4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -290,7 +290,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -25,7 +25,7 @@ index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491f public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public private ChunkPos chunkPosition; private Vec3 deltaMovement; -@@ -1876,9 +1876,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1866,9 +1866,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { /** @deprecated */ @Deprecated public float getLightLevelDependentMagicValue() { @@ -45,10 +45,10 @@ index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491f this.absMoveTo(x, y, z); this.setYRot(yaw % 360.0F); diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index aa58adbd6dde51e6902ca9af1ae1a63e8a11bb34..e601b50935fc7212050e01fd31235149a33daf3b 100644 +index 2e98c0ad3776ec4bf71e686e856a8c445ee95b9b..27fc50571305132c86497fcb1d5b1bb514610a4e 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1667,13 +1667,29 @@ public abstract class Mob extends LivingEntity { +@@ -1643,13 +1643,29 @@ public abstract class Mob extends LivingEntity { } diff --git a/patches/server/0070-Replace-AI-goal-set-with-optimized-collection.patch b/patches/server/0070-Replace-AI-goal-set-with-optimized-collection.patch index 68d7e32..97689cf 100644 --- a/patches/server/0070-Replace-AI-goal-set-with-optimized-collection.patch +++ b/patches/server/0070-Replace-AI-goal-set-with-optimized-collection.patch @@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java -index b738ee2d3801fadfd09313f05ae24593e56b0ec6..b4bbd34d983e559dc2716520561cac61108c6d5c 100644 +index ce2804271bb67803c60c9121aec6c8dc0e99a1d9..86fc528551c2c90c78783d4d46a4a2c52e4efe41 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java @@ -11,6 +11,8 @@ import java.util.Set; @@ -22,15 +22,15 @@ index b738ee2d3801fadfd09313f05ae24593e56b0ec6..b4bbd34d983e559dc2716520561cac61 import java.util.stream.Stream; + +import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; - import net.minecraft.util.profiling.ProfilerFiller; import org.slf4j.Logger; -@@ -28,7 +30,7 @@ public class GoalSelector { + public class GoalSelector { +@@ -27,7 +29,7 @@ public class GoalSelector { } }; private final Map lockedFlags = new EnumMap<>(Goal.Flag.class); - private final Set availableGoals = Sets.newLinkedHashSet(); + private final Set availableGoals = new ObjectLinkedOpenHashSet<>(); // Gale - Lithium - replace AI goal set with optimized collection - private final Supplier profiler; private final EnumSet disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be. private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector + private int tickCount; diff --git a/patches/server/0080-Check-frozen-ticks-before-landing-block.patch b/patches/server/0080-Check-frozen-ticks-before-landing-block.patch index 21e11eb..6ec76ba 100644 --- a/patches/server/0080-Check-frozen-ticks-before-landing-block.patch +++ b/patches/server/0080-Check-frozen-ticks-before-landing-block.patch @@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 46ad26f8f6680446718bb13158eca3f712f1986e..f2814df6d715910a3c8101a0af5f3190355bcc52 100644 +index 6ad1e6c4a20bec34b56276736ee616b5dcff0354..75ae119719cf566f66371606e70f19b6b36dc7cb 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -574,11 +574,10 @@ public abstract class LivingEntity extends Entity { +@@ -572,11 +572,10 @@ public abstract class LivingEntity extends Entity { } protected void tryAddFrost() { @@ -29,7 +29,7 @@ index 46ad26f8f6680446718bb13158eca3f712f1986e..f2814df6d715910a3c8101a0af5f3190 if (attributemodifiable == null) { return; -@@ -588,7 +587,6 @@ public abstract class LivingEntity extends Entity { +@@ -586,7 +585,6 @@ public abstract class LivingEntity extends Entity { attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); } diff --git a/patches/server/0087-Skip-entity-move-if-movement-is-zero.patch b/patches/server/0087-Skip-entity-move-if-movement-is-zero.patch index 6970e92..0d310b5 100644 --- a/patches/server/0087-Skip-entity-move-if-movement-is-zero.patch +++ b/patches/server/0087-Skip-entity-move-if-movement-is-zero.patch @@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2c439b793 100644 +index 660e8d27bb8733f01d7e60b841877ee14579ede4..7841fd24b2f4e4310a6d34660e7c7cd265af835e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -24,7 +24,7 @@ index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2 public boolean onGround; public boolean horizontalCollision; public boolean verticalCollision; -@@ -1023,6 +1024,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1021,6 +1022,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // Paper end - detailed watchdog information public void move(MoverType movementType, Vec3 movement) { @@ -36,7 +36,7 @@ index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2 // Paper start - detailed watchdog information io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); synchronized (this.posLock) { -@@ -3798,6 +3804,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3781,6 +3787,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public final void setBoundingBox(AABB boundingBox) { diff --git a/patches/server/0089-Use-linked-map-for-entity-trackers.patch b/patches/server/0089-Use-linked-map-for-entity-trackers.patch index a9c78bc..f5dffa1 100644 --- a/patches/server/0089-Use-linked-map-for-entity-trackers.patch +++ b/patches/server/0089-Use-linked-map-for-entity-trackers.patch @@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index eea6753afdd7e9d52746d0decb5cde63044012b5..20e4178b1ce6fc25d2fb25d0c02a06e33ac03d19 100644 +index 41140fbf32fc4db1b2460e453420e538290f4f99..baa6aaa495c2a9d4d2f6a62527881b9442fcaeea 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either; @@ -24,7 +24,7 @@ index eea6753afdd7e9d52746d0decb5cde63044012b5..20e4178b1ce6fc25d2fb25d0c02a06e3 import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.longs.Long2ByteMap; -@@ -295,7 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -294,7 +295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper - rewrite chunk system this.tickingGenerated = new AtomicInteger(); this.playerMap = new PlayerMap(); diff --git a/patches/server/0091-Ignore-durability-change-equipment-updates.patch b/patches/server/0091-Ignore-durability-change-equipment-updates.patch index cfa4d13..08e98ac 100644 --- a/patches/server/0091-Ignore-durability-change-equipment-updates.patch +++ b/patches/server/0091-Ignore-durability-change-equipment-updates.patch @@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f2814df6d715910a3c8101a0af5f3190355bcc52..91e5707efe39180811fbe78c7569baa5264dba2c 100644 +index 75ae119719cf566f66371606e70f19b6b36dc7cb..88bfda2090a1f8c9368f5d6f98374d045c045150 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3154,7 +3154,7 @@ public abstract class LivingEntity extends Entity { +@@ -3148,7 +3148,7 @@ public abstract class LivingEntity extends Entity { } public boolean equipmentHasChanged(ItemStack stack, ItemStack stack2) { diff --git a/patches/server/0092-Hide-flames-on-entities-with-fire-resistance.patch b/patches/server/0092-Hide-flames-on-entities-with-fire-resistance.patch index 9d87715..f71177a 100644 --- a/patches/server/0092-Hide-flames-on-entities-with-fire-resistance.patch +++ b/patches/server/0092-Hide-flames-on-entities-with-fire-resistance.patch @@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d6526c075bc82ae2d79e3e786bc469966f4cf92d..552198bd1a08d0967dba90104777105fafc67e35 100644 +index 7841fd24b2f4e4310a6d34660e7c7cd265af835e..a5e2b9862358362f0c67683b0266ab846cab1fcf 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -869,7 +869,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -868,7 +868,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.checkOutOfWorld(); if (!this.level.isClientSide) { diff --git a/patches/server/0097-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/patches/server/0097-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch index 52d26e4..faa9980 100644 --- a/patches/server/0097-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch +++ b/patches/server/0097-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/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 330f6c79417378da855326b4da665f9d240e748d..b111f4c0972f01832f9c03bf85a1989f1e782558 100644 +index 6f7b5884a82cd3a3483fbbd478c0e92987f0d833..c7083450b3466d80611b5efdac78b31ac2e70cf5 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -425,6 +425,7 @@ public class Commands { +@@ -418,6 +418,7 @@ public class Commands { private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) { // Paper end - Async command map building new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper @@ -48,7 +48,7 @@ index 330f6c79417378da855326b4da665f9d240e748d..b111f4c0972f01832f9c03bf85a1989f PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); event.getPlayer().getServer().getPluginManager().callEvent(event); -@@ -435,6 +436,7 @@ public class Commands { +@@ -428,6 +429,7 @@ public class Commands { } } // CraftBukkit end diff --git a/patches/server/0098-Send-multiple-keep-alive-packets.patch b/patches/server/0098-Send-multiple-keep-alive-packets.patch index 953f37f..c08c571 100644 --- a/patches/server/0098-Send-multiple-keep-alive-packets.patch +++ b/patches/server/0098-Send-multiple-keep-alive-packets.patch @@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7efc419ebc 100644 +index 51a336fa29e92669ce48b7724de0134480ac6adb..f0648c94029796653c8c8a5bdd191cf99de7b58a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader; @@ -69,7 +69,7 @@ index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7e private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper private String clientBrandName = null; // Paper - Brand name -@@ -400,6 +406,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -399,6 +405,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic long currentTime = Util.getMillis(); long elapsedTime = currentTime - this.keepAliveTime; @@ -91,7 +91,7 @@ index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7e if (this.keepAlivePending) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info -@@ -3459,6 +3480,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3457,6 +3478,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleKeepAlive(ServerboundKeepAlivePacket packet) { @@ -109,10 +109,10 @@ index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7e if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) { int i = (int) (Util.getMillis() - this.keepAliveTime); diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 0965f43068d12a85090906568e2c1b731730f015..024cf924592999726458976b4d73df4b71843a2e 100644 +index ef0a77ed85bf35f5d388cf28ac5d84e553ad1144..cf56844eb2292ff6add463689ee10b873d2ca664 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -@@ -91,4 +91,16 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -89,4 +89,16 @@ public class GaleGlobalConfiguration extends ConfigurationPart { } diff --git a/patches/server/0101-5-second-TPS-average.patch b/patches/server/0101-5-second-TPS-average.patch index 10f8e90..6f02aba 100644 --- a/patches/server/0101-5-second-TPS-average.patch +++ b/patches/server/0101-5-second-TPS-average.patch @@ -59,10 +59,10 @@ index fa56cd09102a89692b42f1d14257990508c5c720..fac07dda413002c12276131efbe4ee38 setListData(vector); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1307801779caa69bdf967134ecbfcb42764243ac..481522ecd677c12e09121aa1eb54531e6d1fda3d 100644 +index 81bb87b729f20be8ca4e5be0c2f5b1b6c1ce4422..1d45eefe9c791b742946cb162b0a7358226c2ea5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1053,6 +1053,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { @@ -19,7 +19,7 @@ index 609d57dd7373531d35295152e543261e3b0fbe09..d3210128894a8e70919972e60c62bf34 private static MinecraftServer SERVER; // Paper public static final Logger LOGGER = LogUtils.getLogger(); public static final String VANILLA_BRAND = "vanilla"; -@@ -326,7 +328,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop registries; private Map, ServerLevel> levels; @@ -554,7 +553,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c private PlayerList playerList; private volatile boolean running; private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart -@@ -264,10 +282,115 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -683,7 +682,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -312,9 +435,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -349,7 +475,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop holdergetter = this.registries.compositeAccess().registryOrThrow(Registries.BLOCK).asLookup().filterFeatures(this.worldData.enabledFeatures()); this.structureTemplateManager = new StructureTemplateManager(worldstem.resourceManager(), convertable_conversionsession, datafixer, holdergetter); @@ -731,7 +729,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c this.executor = Util.backgroundExecutor(); } // CraftBukkit start -@@ -615,7 +744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop optional = Optional.of(this.getFile("server-icon.png")).filter(File::isFile); -@@ -1408,14 +1537,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { this.lastServerStatus = i; -@@ -1451,7 +1585,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0) { this.playerList.saveAll(playerSaveInterval); } @@ -1079,7 +1073,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c if (level.paperConfig().chunks.autoSaveInterval.value() > 0) { level.saveIncrementally(fullSave); } -@@ -1464,7 +1598,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper -@@ -1618,7 +1750,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels); newLevels.put(level.dimension(), level); this.levels = Collections.unmodifiableMap(newLevels); @@ -1145,7 +1139,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c } public void removeLevel(ServerLevel level) { -@@ -1647,6 +1791,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels); newLevels.remove(level.dimension()); this.levels = Collections.unmodifiableMap(newLevels); @@ -1160,7 +1154,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c } // CraftBukkit end -@@ -1654,8 +1806,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop players; public final ServerChunkCache chunkSource; @@ -1380,7 +1374,7 @@ index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee48150 private final MinecraftServer server; public final PrimaryLevelData serverLevelData; // CraftBukkit - type final EntityTickList entityTickList; -@@ -2590,7 +2598,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2550,7 +2558,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot start if ( entity instanceof Player ) { @@ -1390,7 +1384,7 @@ index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee48150 for (Object o : worldData.cache.values() ) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba563ce55c8 100644 +index f0648c94029796653c8c8a5bdd191cf99de7b58a..a4731aba0022f4b2a38a41bfe41a21a86389d6fe 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -186,6 +186,8 @@ import net.minecraft.world.phys.shapes.Shapes; @@ -1402,7 +1396,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 import org.slf4j.Logger; // CraftBukkit start -@@ -550,7 +552,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -548,7 +550,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic Objects.requireNonNull(this.connection); // CraftBukkit - Don't wait @@ -1411,7 +1405,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 } private CompletableFuture filterTextPacket(T text, BiFunction> filterer) { -@@ -881,21 +883,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -879,21 +881,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // Paper start @@ -1436,7 +1430,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 return; } // Paper end -@@ -920,7 +921,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -918,7 +919,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (!event.isHandled()) { if (!event.isCancelled()) { @@ -1445,7 +1439,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { -@@ -931,7 +932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -929,7 +930,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); // Paper end - Brigadier API }); @@ -1454,7 +1448,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 } } else if (!completions.isEmpty()) { final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(command, stringreader.getTotalLength()); -@@ -1240,7 +1241,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1238,7 +1239,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); @@ -1463,7 +1457,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 return; } byteTotal += byteLength; -@@ -1263,14 +1264,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1261,14 +1262,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -1480,7 +1474,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -2074,10 +2075,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2072,10 +2073,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (this.player.isSpectator()) { @@ -1492,7 +1486,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 Entity entity = packet.getEntity(worldserver); if (entity != null) { -@@ -2226,9 +2224,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2224,9 +2222,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // CraftBukkit end if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { @@ -1504,7 +1498,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 } else { Optional optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); -@@ -2262,9 +2260,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2260,9 +2258,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { @@ -1516,7 +1510,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 } else { Optional optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages()); -@@ -2344,9 +2342,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2342,9 +2340,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper @@ -1529,7 +1523,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5 return Optional.empty(); } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); -@@ -3276,7 +3274,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3274,7 +3272,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -1864,7 +1858,7 @@ index 69acbab61a79c24312359a63086f9353d740113f..49ace73d901b6f55545bb21a93d026a0 } } catch (Exception ex) { diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java -index 6f6b96fe499f1b1888a141b60bd3773ba45e75f6..5bf0246e5b2991db5c590701d562ff973ecb788a 100644 +index 30416b4622214ebc71956541af76ed1567e36f73..751ddcdc3898dccf5c94ba4044b8398a8f23613e 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java @@ -2,11 +2,14 @@ @@ -1882,7 +1876,7 @@ index 6f6b96fe499f1b1888a141b60bd3773ba45e75f6..5bf0246e5b2991db5c590701d562ff97 import java.util.Locale; import java.util.function.Consumer; -@@ -74,6 +77,223 @@ public class GaleGlobalConfiguration extends ConfigurationPart { +@@ -72,6 +75,223 @@ public class GaleGlobalConfiguration extends ConfigurationPart { } // Gale end - Pufferfish - SIMD support @@ -2134,10 +2128,10 @@ index 0000000000000000000000000000000000000000..e73bf57a9777488dc00efe671cee955e +} diff --git a/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java b/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java new file mode 100644 -index 0000000000000000000000000000000000000000..cf7254e2610cd0c04e7ea236a949160cfeeed6a8 +index 0000000000000000000000000000000000000000..f249ef5a23e85770db224ed0b6f27598e78c5746 --- /dev/null +++ b/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java -@@ -0,0 +1,191 @@ +@@ -0,0 +1,188 @@ +// Gale - base thread pools + +package org.galemc.gale.executor; @@ -2218,9 +2212,6 @@ index 0000000000000000000000000000000000000000..cf7254e2610cd0c04e7ea236a949160c + @Override + public void tell(@NotNull Runnable message) { + ScheduledServerThreadTaskQueues.add(() -> { -+ if (Thread.currentThread() != WatchdogThread.instance) { -+ MinecraftServer.SERVER.getProfiler().incrementCounter("runTask"); -+ } + //noinspection NonAtomicOperationOnVolatileField + ++reentrantCount; + try {