From f6287a86c2fd513c4205837a98a955a8e6beb885 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Fri, 13 Dec 2024 06:46:14 -0500 Subject: [PATCH] Step 2, put Dreeam into ice cream --- ...et-Fixes-Use-optimized-RecipeManager.patch | 2 + patches/server/0014-Remove-Timings.patch | 75 + ...ies.patch => 0015-Bump-Dependencies.patch} | 42 +- patches/server/0015-Remove-Timings.patch | 1888 ----------------- ... 0016-Remove-vanilla-username-check.patch} | 4 +- ...ck-for-Broken-BungeeCord-Configurat.patch} | 0 ...emove-UseItemOnPacket-Too-Far-Check.patch} | 4 +- ...patch => 0019-KeYi-Player-Skull-API.patch} | 4 +- ...le-arrow-despawn-counter-by-default.patch} | 6 +- ...n-for-spigot-item-merging-mechanism.patch} | 4 +- ...pet-Fixes-Optimized-getBiome-method.patch} | 2 +- ...on-optimized-PoweredRailBlock-logic.patch} | 2 +- ...karin-Save-Json-list-asynchronously.patch} | 0 ...atch => 0025-Slice-Smooth-Teleports.patch} | 16 +- ...chment-Make-FixLight-use-action-bar.patch} | 0 15 files changed, 116 insertions(+), 1933 deletions(-) rename patches/{ => removed}/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch (98%) create mode 100644 patches/server/0014-Remove-Timings.patch rename patches/server/{0016-Bump-Dependencies.patch => 0015-Bump-Dependencies.patch} (77%) delete mode 100644 patches/server/0015-Remove-Timings.patch rename patches/server/{0017-Remove-vanilla-username-check.patch => 0016-Remove-vanilla-username-check.patch} (95%) rename patches/server/{0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch => 0017-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch} (100%) rename patches/server/{0019-Remove-UseItemOnPacket-Too-Far-Check.patch => 0018-Remove-UseItemOnPacket-Too-Far-Check.patch} (95%) rename patches/server/{0020-KeYi-Player-Skull-API.patch => 0019-KeYi-Player-Skull-API.patch} (92%) rename patches/server/{0021-KeYi-Disable-arrow-despawn-counter-by-default.patch => 0020-KeYi-Disable-arrow-despawn-counter-by-default.patch} (81%) rename patches/server/{0022-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch => 0021-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch} (93%) rename patches/server/{0023-Carpet-Fixes-Optimized-getBiome-method.patch => 0022-Carpet-Fixes-Optimized-getBiome-method.patch} (98%) rename patches/server/{0025-Rail-Optimization-optimized-PoweredRailBlock-logic.patch => 0023-Rail-Optimization-optimized-PoweredRailBlock-logic.patch} (99%) rename patches/server/{0026-Akarin-Save-Json-list-asynchronously.patch => 0024-Akarin-Save-Json-list-asynchronously.patch} (100%) rename patches/server/{0027-Slice-Smooth-Teleports.patch => 0025-Slice-Smooth-Teleports.patch} (88%) rename patches/server/{0028-Parchment-Make-FixLight-use-action-bar.patch => 0026-Parchment-Make-FixLight-use-action-bar.patch} (100%) diff --git a/patches/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch b/patches/removed/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch similarity index 98% rename from patches/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch rename to patches/removed/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch index 420d00f5f..fbc259c77 100644 --- a/patches/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch +++ b/patches/removed/server/0024-Carpet-Fixes-Use-optimized-RecipeManager.patch @@ -3,6 +3,8 @@ From: nostalgic853 Date: Tue, 25 Oct 2022 00:57:45 +0800 Subject: [PATCH] Carpet-Fixes: Use optimized RecipeManager +Removed since Leaf / MC 1.21.3 + This patch is based on the following mixin: "carpetfixes/mixins/optimizations/RecipeManager_fasterMixin.java" By: fxmorin <28154542+fxmorin@users.noreply.github.com> diff --git a/patches/server/0014-Remove-Timings.patch b/patches/server/0014-Remove-Timings.patch new file mode 100644 index 000000000..4f09a40cf --- /dev/null +++ b/patches/server/0014-Remove-Timings.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> +Date: Sat, 23 Sep 2023 03:12:14 -0400 +Subject: [PATCH] Remove Timings + +Completely remove the Timings, since it wastes too much performance. Use Spark instead. + +diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java +index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..a1c9726d25479b5326fe2fa2b0f5a98d6b2da4c5 100644 +--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java ++++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java +@@ -1,6 +1,5 @@ + package io.papermc.paper.plugin.manager; + +-import co.aikar.timings.TimedEventExecutor; + import com.destroystokyo.paper.event.server.ServerExceptionEvent; + import com.destroystokyo.paper.exception.ServerEventException; + import com.google.common.collect.Sets; +@@ -95,7 +94,6 @@ class PaperEventManager { + throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); + } + +- executor = new TimedEventExecutor(executor, plugin, null, event); + this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); + } + +@@ -182,7 +180,7 @@ class PaperEventManager { + } + } + +- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); ++ EventExecutor executor = EventExecutor.create(method, eventClass); + eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); + } + return ret; +diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java +index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..f06076864582ed153c6154fd7f3e9101bf21c4ac 100644 +--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java ++++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java +@@ -232,7 +232,7 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext + + @Override + public boolean useTimings() { +- return co.aikar.timings.Timings.isTimingsEnabled(); ++ return false; // Leaf - Remove Timings + } + + @Override +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index a7a8273a21434fc04b01d06708b65e80487a95d3..2550e0e4e40eccb6e01cd0b8287358c105abaebf 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -3,7 +3,6 @@ package net.minecraft.server; + import com.google.common.base.Preconditions; + import com.google.common.base.Splitter; + import com.google.common.collect.ImmutableList; +-import co.aikar.timings.Timings; + import com.destroystokyo.paper.event.server.PaperServerListPingEvent; + import com.google.common.base.Stopwatch; + import com.google.common.collect.Lists; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index ef8041877456316fc32a382e28ee81161d962353..b4986e322cb05ad6f98bbf5eee2b571c67e4d9d3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -1047,10 +1047,8 @@ public final class CraftServer implements Server { + commands.performCommand(results, commandLine, commandLine, true); + } catch (CommandException ex) { + this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper +- //target.timings.stopTiming(); // Spigot // Paper + throw ex; + } catch (Throwable ex) { +- //target.timings.stopTiming(); // Spigot // Paper + String msg = "Unhandled exception executing '" + commandLine + "' in " + target; + this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper + throw new CommandException(msg, ex); diff --git a/patches/server/0016-Bump-Dependencies.patch b/patches/server/0015-Bump-Dependencies.patch similarity index 77% rename from patches/server/0016-Bump-Dependencies.patch rename to patches/server/0015-Bump-Dependencies.patch index 3501459d0..c525eb464 100644 --- a/patches/server/0016-Bump-Dependencies.patch +++ b/patches/server/0015-Bump-Dependencies.patch @@ -6,19 +6,10 @@ Subject: [PATCH] Bump Dependencies TODO - Dreeam: Bump & test dependencies, impl new features? diff --git a/build.gradle.kts b/build.gradle.kts -index d1bcbd39120480b2e1e402040d20b8567019a4b0..47ade0d7de17d2ad306b1f872d9399edcc295cf2 100644 +index 3b0cd45cb07d9563c84901729f1f7edc498653bd..c35ffb8565218d9368cc583ae96ea86424184eed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -22,7 +22,7 @@ dependencies { - // Leaf end - Leaf Config - - // Paper start -- implementation("org.jline:jline-terminal-jansi:3.21.0") -+ implementation("org.jline:jline-terminal-jansi:3.27.1") // Leaf - Bump Dependencies - implementation("net.minecrell:terminalconsoleappender:1.3.0") - implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file - /* -@@ -31,28 +31,32 @@ dependencies { +@@ -44,28 +44,32 @@ dependencies { all its classes to check if they are plugins. Scanning takes about 1-2 seconds so adding this speeds up the server start. */ @@ -38,12 +29,11 @@ index d1bcbd39120480b2e1e402040d20b8567019a4b0..47ade0d7de17d2ad306b1f872d9399ed implementation("org.ow2.asm:asm-commons:9.7.1") implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") -- runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") -- runtimeOnly("com.mysql:mysql-connector-j:8.4.0") -- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper +- runtimeOnly("org.xerial:sqlite-jdbc:3.46.1.3") + runtimeOnly("org.xerial:sqlite-jdbc:3.47.1.0") // Leaf - Bump Dependencies -+ runtimeOnly("com.mysql:mysql-connector-j:9.1.0") // Leaf - Bump Dependencies -+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper // Leaf - Bump Dependencies // Dreeam TODO - Waiting Log4j 3.x to support disruptor 4.0.0 + runtimeOnly("com.mysql:mysql-connector-j:9.1.0") +- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper ++ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper // Dreeam TODO - Waiting Log4j 3.x to support disruptor 4.0.0 // Paper start - Use Velocity cipher - implementation("com.velocitypowered:velocity-native:3.3.0-SNAPSHOT") { + implementation("com.velocitypowered:velocity-native:3.4.0-SNAPSHOT") { // Leaf - Bump Dependencies @@ -62,7 +52,7 @@ index d1bcbd39120480b2e1e402040d20b8567019a4b0..47ade0d7de17d2ad306b1f872d9399ed // Purpur start implementation("org.mozilla:rhino-runtime:1.7.15") -@@ -60,13 +64,13 @@ dependencies { +@@ -73,14 +77,16 @@ dependencies { implementation("dev.omega24:upnp4j:1.0") // Purpur end @@ -71,18 +61,22 @@ index d1bcbd39120480b2e1e402040d20b8567019a4b0..47ade0d7de17d2ad306b1f872d9399ed - testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0") - testImplementation("org.hamcrest:hamcrest:2.2") - testImplementation("org.mockito:mockito-core:5.14.1") -+ testImplementation("io.github.classgraph:classgraph:4.8.179") // Paper - mob goal test // Leaf - Bump Dependencies -+ testImplementation("org.junit.jupiter:junit-jupiter:5.11.3") // Leaf - Bump Dependencies -+ testImplementation("org.junit.platform:junit-platform-suite-engine:1.11.3") // Leaf - Bump Dependencies +- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions ++ // Leaf start - Bump Dependencies ++ testImplementation("io.github.classgraph:classgraph:4.8.179") // Paper - mob goal test ++ testImplementation("org.junit.jupiter:junit-jupiter:5.11.3") ++ testImplementation("org.junit.platform:junit-platform-suite-engine:1.11.3") + testImplementation("org.hamcrest:hamcrest:3.0") -+ testImplementation("org.mockito:mockito-core:5.14.2") // Leaf - Bump Dependencies ++ testImplementation("org.mockito:mockito-core:5.14.2") ++ mockitoAgent("org.mockito:mockito-core:5.14.2") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions testImplementation("org.ow2.asm:asm-tree:9.7.1") - testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest -+ testImplementation("org.junit-pioneer:junit-pioneer:2.3.0") // Paper - CartesianTest // Leaf - Bump Dependencies ++ testImplementation("org.junit-pioneer:junit-pioneer:2.3.0") // Paper - CartesianTest ++ // Leaf end - Bump Dependencies implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins // Paper start - Remap reflection -@@ -79,6 +83,8 @@ dependencies { +@@ -93,6 +99,8 @@ dependencies { implementation("me.lucko:spark-api:0.1-20240720.200737-2") implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT") // Paper end - spark @@ -91,7 +85,7 @@ index d1bcbd39120480b2e1e402040d20b8567019a4b0..47ade0d7de17d2ad306b1f872d9399ed } paperweight { -@@ -276,3 +282,8 @@ sourceSets { +@@ -295,3 +303,8 @@ sourceSets { } } // Gale end - package license into jar diff --git a/patches/server/0015-Remove-Timings.patch b/patches/server/0015-Remove-Timings.patch deleted file mode 100644 index 2b69010da..000000000 --- a/patches/server/0015-Remove-Timings.patch +++ /dev/null @@ -1,1888 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> -Date: Sat, 23 Sep 2023 03:12:14 -0400 -Subject: [PATCH] Remove Timings - -Completely remove the Timings, since it wastes too much performance. Use Spark instead. - -diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -deleted file mode 100644 -index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..0000000000000000000000000000000000000000 ---- a/src/main/java/co/aikar/timings/MinecraftTimings.java -+++ /dev/null -@@ -1,178 +0,0 @@ --package co.aikar.timings; -- --import com.google.common.collect.MapMaker; --import io.papermc.paper.configuration.GlobalConfiguration; --import net.minecraft.commands.functions.CommandFunction; --import net.minecraft.network.protocol.Packet; --import net.minecraft.world.level.block.Block; --import net.minecraft.world.level.block.entity.BlockEntity; --import org.bukkit.plugin.Plugin; --import org.bukkit.scheduler.BukkitTask; -- --import org.bukkit.craftbukkit.scheduler.CraftTask; -- --import java.util.Map; -- --// TODO: Re-implement missing timers --@Deprecated(forRemoval = true) --public final class MinecraftTimings { -- -- public static final Timing serverOversleep = Timings.ofSafe("Server Oversleep"); -- public static final Timing playerListTimer = Timings.ofSafe("Player List"); -- public static final Timing commandFunctionsTimer = Timings.ofSafe("Command Functions"); -- public static final Timing connectionTimer = Timings.ofSafe("Connection Handler"); -- public static final Timing tickablesTimer = Timings.ofSafe("Tickables"); -- public static final Timing minecraftSchedulerTimer = Timings.ofSafe("Minecraft Scheduler"); -- public static final Timing bukkitSchedulerTimer = Timings.ofSafe("Bukkit Scheduler"); -- public static final Timing bukkitSchedulerPendingTimer = Timings.ofSafe("Bukkit Scheduler - Pending"); -- public static final Timing bukkitSchedulerFinishTimer = Timings.ofSafe("Bukkit Scheduler - Finishing"); -- public static final Timing chunkIOTickTimer = Timings.ofSafe("ChunkIOTick"); -- public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update"); -- public static final Timing serverCommandTimer = Timings.ofSafe("Server Command"); -- public static final Timing savePlayers = Timings.ofSafe("Save Players"); -- -- public static final Timing tickEntityTimer = Timings.ofSafe("## tickEntity"); -- public static final Timing tickTileEntityTimer = Timings.ofSafe("## tickTileEntity"); -- public static final Timing packetProcessTimer = Timings.ofSafe("## Packet Processing"); -- public static final Timing scheduledBlocksTimer = Timings.ofSafe("## Scheduled Blocks"); -- public static final Timing structureGenerationTimer = Timings.ofSafe("Structure Generation"); -- -- public static final Timing processQueueTimer = Timings.ofSafe("processQueue"); -- public static final Timing processTasksTimer = Timings.ofSafe("processTasks"); -- -- public static final Timing playerCommandTimer = Timings.ofSafe("playerCommand"); -- -- public static final Timing entityActivationCheckTimer = Timings.ofSafe("entityActivationCheck"); -- -- public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update"); -- public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); -- public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search -- -- private static final Map, String> taskNameCache = new MapMaker().weakKeys().makeMap(); -- -- private MinecraftTimings() {} -- -- public static Timing getInternalTaskName(String taskName) { -- return Timings.ofSafe(taskName); -- } -- -- /** -- * Gets a timer associated with a plugins tasks. -- * @param bukkitTask -- * @param period -- * @return -- */ -- public static Timing getPluginTaskTimings(BukkitTask bukkitTask, long period) { -- if (!bukkitTask.isSync()) { -- return NullTimingHandler.NULL; -- } -- Plugin plugin; -- -- CraftTask craftTask = (CraftTask) bukkitTask; -- -- final Class taskClass = craftTask.getTaskClass(); -- if (bukkitTask.getOwner() != null) { -- plugin = bukkitTask.getOwner(); -- } else { -- plugin = TimingsManager.getPluginByClassloader(taskClass); -- } -- -- final String taskname = taskNameCache.computeIfAbsent(taskClass, clazz -> { -- try { -- String clsName = !clazz.isMemberClass() -- ? clazz.getName() -- : clazz.getCanonicalName(); -- if (clsName != null && clsName.contains("$Lambda$")) { -- clsName = clsName.replaceAll("(Lambda\\$.*?)/.*", "$1"); -- } -- return clsName != null ? clsName : "UnknownTask"; -- } catch (Throwable ex) { -- new Exception("Error occurred detecting class name", ex).printStackTrace(); -- return "MangledClassFile"; -- } -- }); -- -- StringBuilder name = new StringBuilder(64); -- name.append("Task: ").append(taskname); -- if (period > 0) { -- name.append(" (interval:").append(period).append(")"); -- } else { -- name.append(" (Single)"); -- } -- -- if (plugin == null) { -- return Timings.ofSafe(null, name.toString()); -- } -- -- return Timings.ofSafe(plugin, name.toString()); -- } -- -- /** -- * Get a named timer for the specified entity type to track type specific timings. -- * @param entityType -- * @return -- */ -- public static Timing getEntityTimings(String entityType, String type) { -- return Timings.ofSafe("Minecraft", "## tickEntity - " + entityType + " - " + type, tickEntityTimer); -- } -- -- public static Timing getBehaviorTimings(String type) { -- return Timings.ofSafe("## Behavior - " + type); -- } -- -- public static Timing getSensorTimings(String type, int rate) { -- return Timings.ofSafe("## Sensor - " + type + " (Default rate: " + rate + ")"); -- } -- -- /** -- * Get a named timer for the specified tile entity type to track type specific timings. -- * @param entity -- * @return -- */ -- public static Timing getTileEntityTimings(BlockEntity entity) { -- String entityType = entity.getClass().getName(); -- return Timings.ofSafe("Minecraft", "## tickTileEntity - " + entityType, tickTileEntityTimer); -- } -- public static Timing getCancelTasksTimer() { -- return Timings.ofSafe("Cancel Tasks"); -- } -- public static Timing getCancelTasksTimer(Plugin plugin) { -- return Timings.ofSafe(plugin, "Cancel Tasks"); -- } -- -- public static void stopServer() { -- TimingsManager.stopServer(); -- } -- -- public static Timing getBlockTiming(Block block) { -- return Timings.ofSafe("## Scheduled Block: " + block.toString(), scheduledBlocksTimer); -- } --/* -- public static Timing getStructureTiming(StructureGenerator structureGenerator) { -- return Timings.ofSafe("Structure Generator - " + structureGenerator.getName(), structureGenerationTimer); -- }*/ -- -- public static Timing getPacketTiming(Packet packet) { -- return Timings.ofSafe("## Packet - " + packet.getClass().getName(), packetProcessTimer); -- } -- -- public static Timing getCommandFunctionTiming(CommandFunction function) { -- return Timings.ofSafe("Command Function - " + function.id()); -- } -- -- public static void processConfig(GlobalConfiguration.Timings config) { -- TimingsManager.url = config.url; -- if (!TimingsManager.url.endsWith("/")) { -- TimingsManager.url += "/"; -- } -- TimingsManager.privacy = config.serverNamePrivacy; -- if (!config.hiddenConfigEntries.contains("proxies.velocity.secret")) { -- config.hiddenConfigEntries.add("proxies.velocity.secret"); -- } -- TimingsManager.hiddenConfigs.addAll(config.hiddenConfigEntries); -- co.aikar.timings.Timings.setVerboseTimingsEnabled(config.verbose); -- co.aikar.timings.Timings.setTimingsEnabled(config.enabled); -- co.aikar.timings.Timings.setHistoryInterval(config.historyInterval * 20); -- co.aikar.timings.Timings.setHistoryLength(config.historyLength * 20); -- } --} -diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -deleted file mode 100644 -index 29796a404e210f7864f4b33b3367e02531bca2a0..0000000000000000000000000000000000000000 ---- a/src/main/java/co/aikar/timings/TimingsExport.java -+++ /dev/null -@@ -1,391 +0,0 @@ --/* -- * This file is licensed under the MIT License (MIT). -- * -- * Copyright (c) 2014 Daniel Ennis -- * -- * 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. -- */ --package co.aikar.timings; -- --import com.google.common.collect.Sets; --import io.papermc.paper.adventure.PaperAdventure; --import net.kyori.adventure.text.event.ClickEvent; --import net.kyori.adventure.text.format.NamedTextColor; --import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; --import net.minecraft.server.MinecraftServer; --import org.apache.commons.lang.StringUtils; --import org.bukkit.Bukkit; --import org.bukkit.Material; --import org.bukkit.configuration.ConfigurationSection; --import org.bukkit.configuration.MemorySection; --import org.bukkit.entity.EntityType; --import org.json.simple.JSONObject; --import org.json.simple.JSONValue; --import oshi.SystemInfo; --import oshi.hardware.HardwareAbstractionLayer; -- --import java.io.ByteArrayOutputStream; --import java.io.IOException; --import java.io.InputStream; --import java.io.OutputStream; --import java.lang.management.ManagementFactory; --import java.lang.management.OperatingSystemMXBean; --import java.lang.management.RuntimeMXBean; --import java.net.HttpURLConnection; --import java.net.InetAddress; --import java.net.URL; --import java.util.List; --import java.util.Map; --import java.util.Set; --import java.util.logging.Level; --import java.util.zip.GZIPOutputStream; -- --import static co.aikar.timings.TimingsManager.HISTORY; --import static co.aikar.util.JSONUtil.appendObjectData; --import static co.aikar.util.JSONUtil.createObject; --import static co.aikar.util.JSONUtil.pair; --import static co.aikar.util.JSONUtil.toArray; --import static co.aikar.util.JSONUtil.toArrayMapper; --import static co.aikar.util.JSONUtil.toObjectMapper; --import static net.kyori.adventure.text.Component.text; -- --@SuppressWarnings({"rawtypes", "SuppressionAnnotation"}) --@Deprecated(forRemoval = true) --public class TimingsExport extends Thread { -- -- private final TimingsReportListener listeners; -- private final Map out; -- private final TimingHistory[] history; -- private static long lastReport = 0; -- -- private TimingsExport(TimingsReportListener listeners, Map out, TimingHistory[] history) { -- super("Timings paste thread"); -- this.listeners = listeners; -- this.out = out; -- this.history = history; -- } -- -- /** -- * Checks if any pending reports are being requested, and builds one if needed. -- */ -- public static void reportTimings() { -- if (Timings.requestingReport.isEmpty()) { -- return; -- } -- TimingsReportListener listeners = new TimingsReportListener(Timings.requestingReport); -- listeners.addConsoleIfNeeded(); -- -- Timings.requestingReport.clear(); -- long now = System.currentTimeMillis(); -- final long lastReportDiff = now - lastReport; -- if (lastReportDiff < 60000) { -- listeners.sendMessage(text("Please wait at least 1 minute in between Timings reports. (" + (int)((60000 - lastReportDiff) / 1000) + " seconds)", NamedTextColor.RED)); -- listeners.done(); -- return; -- } -- final long lastStartDiff = now - TimingsManager.timingStart; -- if (lastStartDiff < 180000) { -- listeners.sendMessage(text("Please wait at least 3 minutes before generating a Timings report. Unlike Timings v1, v2 benefits from longer timings and is not as useful with short timings. (" + (int)((180000 - lastStartDiff) / 1000) + " seconds)", NamedTextColor.RED)); -- listeners.done(); -- return; -- } -- listeners.sendMessage(text("Preparing Timings Report...", NamedTextColor.GREEN)); -- lastReport = now; -- Map parent = createObject( -- // Get some basic system details about the server -- pair("version", Bukkit.getVersion()), -- pair("maxplayers", Bukkit.getMaxPlayers()), -- pair("start", TimingsManager.timingStart / 1000), -- pair("end", System.currentTimeMillis() / 1000), -- pair("online-mode", Bukkit.getServer().getOnlineMode()), -- pair("sampletime", (System.currentTimeMillis() - TimingsManager.timingStart) / 1000), -- pair("datapacks", toArrayMapper(MinecraftServer.getServer().getPackRepository().getSelectedPacks(), pack -> { -- return PlainTextComponentSerializer.plainText().serialize(PaperAdventure.asAdventure(pack.getChatLink(true))); -- })) -- ); -- if (!TimingsManager.privacy) { -- appendObjectData(parent, -- pair("server", Bukkit.getUnsafe().getTimingsServerName()), -- pair("motd", Bukkit.getServer().getMotd()), -- pair("icon", Bukkit.getServer().getServerIcon().getData()) -- ); -- } -- -- final Runtime runtime = Runtime.getRuntime(); -- RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); -- -- OperatingSystemMXBean osInfo = ManagementFactory.getOperatingSystemMXBean(); -- -- HardwareAbstractionLayer hardwareInfo = new SystemInfo().getHardware(); -- -- parent.put("system", createObject( -- pair("timingcost", getCost()), -- pair("loadavg", osInfo.getSystemLoadAverage()), -- pair("name", System.getProperty("os.name")), -- pair("version", System.getProperty("os.version")), -- pair("jvmversion", System.getProperty("java.version")), -- pair("jvmvendor", System.getProperty("java.vendor")), -- pair("jvmvendorversion", System.getProperty("java.vendor.version")), -- pair("arch", System.getProperty("os.arch")), -- pair("maxmem", runtime.maxMemory()), -- pair("memory", createObject( -- pair("heap", ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().toString()), -- pair("nonheap", ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().toString()), -- pair("finalizing", ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount()) -- )), -- pair("cpu", runtime.availableProcessors()), -- pair("cpuname", hardwareInfo.getProcessor().getProcessorIdentifier().getName().trim()), -- pair("runtime", runtimeBean.getUptime()), -- pair("flags", StringUtils.join(runtimeBean.getInputArguments(), " ")), -- pair("gc", toObjectMapper(ManagementFactory.getGarbageCollectorMXBeans(), input -> pair(input.getName(), toArray(input.getCollectionCount(), input.getCollectionTime())))) -- ) -- ); -- -- parent.put("worlds", toObjectMapper(MinecraftServer.getServer().getAllLevels(), world -> { -- if (world.getWorld().getName().equals("worldeditregentempworld")) return null; -- return pair(world.getWorld().getName(), createObject( -- pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> { -- return pair(rule, world.getWorld().getGameRuleValue(rule)); -- })), -- pair("ticking-distance", world.getWorld().getSimulationDistance()), -- pair("no-ticking-distance", world.getWorld().getViewDistance()), -- pair("sending-distance", world.getWorld().getSendViewDistance()) -- )); -- })); -- -- Set tileEntityTypeSet = Sets.newHashSet(); -- Set entityTypeSet = Sets.newHashSet(); -- -- int size = HISTORY.size(); -- TimingHistory[] history = new TimingHistory[size + 1]; -- int i = 0; -- for (TimingHistory timingHistory : HISTORY) { -- tileEntityTypeSet.addAll(timingHistory.tileEntityTypeSet); -- entityTypeSet.addAll(timingHistory.entityTypeSet); -- history[i++] = timingHistory; -- } -- -- history[i] = new TimingHistory(); // Current snapshot -- tileEntityTypeSet.addAll(history[i].tileEntityTypeSet); -- entityTypeSet.addAll(history[i].entityTypeSet); -- -- -- Map handlers = createObject(); -- Map groupData; -- synchronized (TimingIdentifier.GROUP_MAP) { -- for (TimingIdentifier.TimingGroup group : TimingIdentifier.GROUP_MAP.values()) { -- synchronized (group.handlers) { -- for (TimingHandler id : group.handlers) { -- -- if (!id.isTimed() && !id.isSpecial()) { -- continue; -- } -- -- String name = id.identifier.name; -- if (name.startsWith("##")) { -- name = name.substring(3); -- } -- handlers.put(id.id, toArray( -- group.id, -- name -- )); -- } -- } -- } -- -- groupData = toObjectMapper( -- TimingIdentifier.GROUP_MAP.values(), group -> pair(group.id, group.name)); -- } -- -- parent.put("idmap", createObject( -- pair("groups", groupData), -- pair("handlers", handlers), -- pair("worlds", toObjectMapper(TimingHistory.worldMap.entrySet(), input -> pair(input.getValue(), input.getKey()))), -- pair("tileentity", -- toObjectMapper(tileEntityTypeSet, input -> pair(input.ordinal(), input.name()))), -- pair("entity", -- toObjectMapper(entityTypeSet, input -> pair(input.ordinal(), input.name()))) -- )); -- -- // Information about loaded plugins -- -- parent.put("plugins", toObjectMapper(Bukkit.getPluginManager().getPlugins(), -- plugin -> pair(plugin.getName(), createObject( -- pair("version", plugin.getDescription().getVersion()), -- pair("description", String.valueOf(plugin.getDescription().getDescription()).trim()), -- pair("website", plugin.getDescription().getWebsite()), -- pair("authors", StringUtils.join(plugin.getDescription().getAuthors(), ", ")) -- )))); -- -- -- -- // Information on the users Config -- -- parent.put("config", createObject( -- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)), -- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)), -- // Gale start - Gale configuration - include in timings -- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), -- pair("gale", mapAsJSON(Bukkit.spigot().getGaleConfig(), null)) -- // Gale end - Gale configuration - include in timings -- )); -- -- new TimingsExport(listeners, parent, history).start(); -- } -- -- static long getCost() { -- // Benchmark the users System.nanotime() for cost basis -- int passes = 100; -- TimingHandler SAMPLER1 = Timings.ofSafe("Timings Sampler 1"); -- TimingHandler SAMPLER2 = Timings.ofSafe("Timings Sampler 2"); -- TimingHandler SAMPLER3 = Timings.ofSafe("Timings Sampler 3"); -- TimingHandler SAMPLER4 = Timings.ofSafe("Timings Sampler 4"); -- TimingHandler SAMPLER5 = Timings.ofSafe("Timings Sampler 5"); -- TimingHandler SAMPLER6 = Timings.ofSafe("Timings Sampler 6"); -- -- long start = System.nanoTime(); -- for (int i = 0; i < passes; i++) { -- SAMPLER1.startTiming(); -- SAMPLER2.startTiming(); -- SAMPLER3.startTiming(); -- SAMPLER3.stopTiming(); -- SAMPLER4.startTiming(); -- SAMPLER5.startTiming(); -- SAMPLER6.startTiming(); -- SAMPLER6.stopTiming(); -- SAMPLER5.stopTiming(); -- SAMPLER4.stopTiming(); -- SAMPLER2.stopTiming(); -- SAMPLER1.stopTiming(); -- } -- long timingsCost = (System.nanoTime() - start) / passes / 6; -- SAMPLER1.reset(true); -- SAMPLER2.reset(true); -- SAMPLER3.reset(true); -- SAMPLER4.reset(true); -- SAMPLER5.reset(true); -- SAMPLER6.reset(true); -- return timingsCost; -- } -- -- public static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) { // Gale - Gale configuration -- -- JSONObject object = new JSONObject(); -- for (String key : config.getKeys(false)) { -- String fullKey = (parentKey != null ? parentKey + "." + key : key); -- if (fullKey.equals("database") || fullKey.equals("settings.bungeecord-addresses") || TimingsManager.hiddenConfigs.contains(fullKey) || key.startsWith("seed-") || key.equals("worldeditregentempworld") || key.equals("feature-seeds")) { -- continue; -- } -- final Object val = config.get(key); -- -- object.put(key, valAsJSON(val, fullKey)); -- } -- return object; -- } -- -- private static Object valAsJSON(Object val, final String parentKey) { -- if (!(val instanceof MemorySection)) { -- if (val instanceof List) { -- Iterable v = (Iterable) val; -- return toArrayMapper(v, input -> valAsJSON(input, parentKey)); -- } else { -- return String.valueOf(val); -- } -- } else { -- return mapAsJSON((ConfigurationSection) val, parentKey); -- } -- } -- -- @Override -- public void run() { -- out.put("data", toArrayMapper(history, TimingHistory::export)); -- -- -- String response = null; -- String timingsURL = null; -- try { -- HttpURLConnection con = (HttpURLConnection) new URL(TimingsManager.url + "post").openConnection(); -- con.setDoOutput(true); -- String hostName = "BrokenHost"; -- try { -- hostName = InetAddress.getLocalHost().getHostName(); -- } catch (Exception ignored) {} -- con.setRequestProperty("User-Agent", "Paper/" + Bukkit.getUnsafe().getTimingsServerName() + "/" + hostName); -- con.setRequestMethod("POST"); -- con.setInstanceFollowRedirects(false); -- -- OutputStream request = new GZIPOutputStream(con.getOutputStream()) {{ -- this.def.setLevel(7); -- }}; -- -- request.write(JSONValue.toJSONString(out).getBytes("UTF-8")); -- request.close(); -- -- response = getResponse(con); -- -- if (con.getResponseCode() != 302) { -- listeners.sendMessage(text( "Upload Error: " + con.getResponseCode() + ": " + con.getResponseMessage(), NamedTextColor.RED)); -- listeners.sendMessage(text("Check your logs for more information", NamedTextColor.RED)); -- if (response != null) { -- Bukkit.getLogger().log(Level.SEVERE, response); -- } -- return; -- } -- -- timingsURL = con.getHeaderField("Location"); -- listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL)))); -- -- if (response != null && !response.isEmpty()) { -- Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response); -- } -- } catch (IOException ex) { -- listeners.sendMessage(text("Error uploading timings, check your logs for more information", NamedTextColor.RED)); -- if (response != null) { -- Bukkit.getLogger().log(Level.SEVERE, response); -- } -- Bukkit.getLogger().log(Level.SEVERE, "Could not paste timings", ex); -- } finally { -- this.listeners.done(timingsURL); -- } -- } -- -- private String getResponse(HttpURLConnection con) throws IOException { -- InputStream is = null; -- try { -- is = con.getInputStream(); -- ByteArrayOutputStream bos = new ByteArrayOutputStream(); -- -- byte[] b = new byte[1024]; -- int bytesRead; -- while ((bytesRead = is.read(b)) != -1) { -- bos.write(b, 0, bytesRead); -- } -- return bos.toString(); -- -- } catch (IOException ex) { -- listeners.sendMessage(text("Error uploading timings, check your logs for more information", NamedTextColor.RED)); -- Bukkit.getLogger().log(Level.WARNING, con.getResponseMessage(), ex); -- return null; -- } finally { -- if (is != null) { -- is.close(); -- } -- } -- } --} -diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -deleted file mode 100644 -index 2f0d9b953802dee821cfde82d22b0567cce8ee91..0000000000000000000000000000000000000000 ---- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java -+++ /dev/null -@@ -1,120 +0,0 @@ --package co.aikar.timings; -- --import net.minecraft.server.level.ServerLevel; --import net.minecraft.world.level.Level; --import net.minecraft.world.level.storage.PrimaryLevelData; -- --/** -- * Set of timers per world, to track world specific timings. -- */ --// TODO: Re-implement missing timers --@Deprecated(forRemoval = true) --public class WorldTimingsHandler { -- public final Timing mobSpawn; -- public final Timing doChunkUnload; -- public final Timing doPortalForcer; -- public final Timing scheduledBlocks; -- public final Timing scheduledBlocksCleanup; -- public final Timing scheduledBlocksTicking; -- public final Timing chunkTicks; -- public final Timing lightChunk; -- public final Timing chunkTicksBlocks; -- public final Timing doVillages; -- public final Timing doChunkMap; -- public final Timing doChunkMapUpdate; -- public final Timing doChunkMapToUpdate; -- public final Timing doChunkMapSortMissing; -- public final Timing doChunkMapSortSendToPlayers; -- public final Timing doChunkMapPlayersNeedingChunks; -- public final Timing doChunkMapPendingSendToPlayers; -- public final Timing doChunkMapUnloadChunks; -- public final Timing doChunkGC; -- public final Timing doSounds; -- public final Timing entityRemoval; -- public final Timing entityTick; -- public final Timing tileEntityTick; -- public final Timing tileEntityPending; -- public final Timing tracker1; -- public final Timing tracker2; -- public final Timing doTick; -- public final Timing tickEntities; -- public final Timing chunks; -- public final Timing newEntities; -- public final Timing raids; -- public final Timing chunkProviderTick; -- public final Timing broadcastChunkUpdates; -- public final Timing countNaturalMobs; -- -- public final Timing chunkLoad; -- public final Timing chunkLoadPopulate; -- public final Timing syncChunkLoad; -- public final Timing chunkLoadLevelTimer; -- public final Timing chunkIO; -- public final Timing chunkPostLoad; -- public final Timing worldSave; -- public final Timing worldSaveChunks; -- public final Timing worldSaveLevel; -- public final Timing chunkSaveData; -- -- -- public final Timing miscMobSpawning; -- -- public WorldTimingsHandler(Level server) { -- String name = ((PrimaryLevelData) server.getLevelData()).getLevelName() + " - "; -- -- mobSpawn = Timings.ofSafe(name + "mobSpawn"); -- doChunkUnload = Timings.ofSafe(name + "doChunkUnload"); -- scheduledBlocks = Timings.ofSafe(name + "Scheduled Blocks"); -- scheduledBlocksCleanup = Timings.ofSafe(name + "Scheduled Blocks - Cleanup"); -- scheduledBlocksTicking = Timings.ofSafe(name + "Scheduled Blocks - Ticking"); -- chunkTicks = Timings.ofSafe(name + "Chunk Ticks"); -- lightChunk = Timings.ofSafe(name + "Light Chunk"); -- chunkTicksBlocks = Timings.ofSafe(name + "Chunk Ticks - Blocks"); -- doVillages = Timings.ofSafe(name + "doVillages"); -- doChunkMap = Timings.ofSafe(name + "doChunkMap"); -- doChunkMapUpdate = Timings.ofSafe(name + "doChunkMap - Update"); -- doChunkMapToUpdate = Timings.ofSafe(name + "doChunkMap - To Update"); -- doChunkMapSortMissing = Timings.ofSafe(name + "doChunkMap - Sort Missing"); -- doChunkMapSortSendToPlayers = Timings.ofSafe(name + "doChunkMap - Sort Send To Players"); -- doChunkMapPlayersNeedingChunks = Timings.ofSafe(name + "doChunkMap - Players Needing Chunks"); -- doChunkMapPendingSendToPlayers = Timings.ofSafe(name + "doChunkMap - Pending Send To Players"); -- doChunkMapUnloadChunks = Timings.ofSafe(name + "doChunkMap - Unload Chunks"); -- doSounds = Timings.ofSafe(name + "doSounds"); -- doChunkGC = Timings.ofSafe(name + "doChunkGC"); -- doPortalForcer = Timings.ofSafe(name + "doPortalForcer"); -- entityTick = Timings.ofSafe(name + "entityTick"); -- entityRemoval = Timings.ofSafe(name + "entityRemoval"); -- tileEntityTick = Timings.ofSafe(name + "tileEntityTick"); -- tileEntityPending = Timings.ofSafe(name + "tileEntityPending"); -- -- chunkLoad = Timings.ofSafe(name + "Chunk Load"); -- chunkLoadPopulate = Timings.ofSafe(name + "Chunk Load - Populate"); -- syncChunkLoad = Timings.ofSafe(name + "Sync Chunk Load"); -- chunkLoadLevelTimer = Timings.ofSafe(name + "Chunk Load - Load Level"); -- chunkIO = Timings.ofSafe(name + "Chunk Load - DiskIO"); -- chunkPostLoad = Timings.ofSafe(name + "Chunk Load - Post Load"); -- worldSave = Timings.ofSafe(name + "World Save"); -- worldSaveLevel = Timings.ofSafe(name + "World Save - Level"); -- worldSaveChunks = Timings.ofSafe(name + "World Save - Chunks"); -- chunkSaveData = Timings.ofSafe(name + "Chunk Save - Data"); -- -- tracker1 = Timings.ofSafe(name + "tracker stage 1"); -- tracker2 = Timings.ofSafe(name + "tracker stage 2"); -- doTick = Timings.ofSafe(name + "doTick"); -- tickEntities = Timings.ofSafe(name + "tickEntities"); -- -- chunks = Timings.ofSafe(name + "Chunks"); -- newEntities = Timings.ofSafe(name + "New entity registration"); -- raids = Timings.ofSafe(name + "Raids"); -- chunkProviderTick = Timings.ofSafe(name + "Chunk provider tick"); -- broadcastChunkUpdates = Timings.ofSafe(name + "Broadcast chunk updates"); -- countNaturalMobs = Timings.ofSafe(name + "Count natural mobs"); -- -- -- miscMobSpawning = Timings.ofSafe(name + "Mob spawning - Misc"); -- } -- -- public static Timing getTickList(ServerLevel worldserver, String timingsType) { -- return Timings.ofSafe(((PrimaryLevelData) worldserver.getLevelData()).getLevelName() + " - Scheduled " + timingsType); -- } --} -diff --git a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java -index 0c3c82b28e581286b798ee58ca4193efc2faff4a..5a2a4f69995f23e799370c05f28f9353aa1a1d39 100644 ---- a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java -+++ b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java -@@ -1,6 +1,5 @@ - package io.papermc.paper.command.brigadier.bukkit; - --import co.aikar.timings.Timing; - import com.mojang.brigadier.arguments.StringArgumentType; - import com.mojang.brigadier.builder.RequiredArgumentBuilder; - import com.mojang.brigadier.context.CommandContext; -@@ -79,17 +78,12 @@ public class BukkitCommandNode extends LiteralCommandNode { - CommandSender sender = context.getSource().getSender(); - - // Plugins do weird things to workaround normal registration -- if (this.command.timings == null) { -- this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command); -- } - - String content = context.getRange().get(context.getInput()); - String[] args = org.apache.commons.lang3.StringUtils.split(content, ' '); // fix adjacent spaces (from console/plugins) causing empty array elements - -- try (Timing ignored = this.command.timings.startTiming()) { - // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) - this.command.execute(sender, this.literal, Arrays.copyOfRange(args, 1, args.length)); -- } - - // return true as command was handled - return 1; -diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index a9dd0e5216e95afd98fd2200d110e2cc0b1b0dca..3d63471c6566d4e69b4e0f2f7c334cf3a33818b9 100644 ---- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -@@ -1,6 +1,5 @@ - package io.papermc.paper.configuration; - --import co.aikar.timings.MinecraftTimings; - import com.mojang.logging.LogUtils; - import io.papermc.paper.configuration.constraint.Constraints; - import io.papermc.paper.configuration.type.number.DoubleOr; -@@ -100,29 +99,6 @@ public class GlobalConfiguration extends ConfigurationPart { - public boolean enableImmediately = false; - } - -- @Deprecated(forRemoval = true) -- public Timings timings; -- -- @Deprecated(forRemoval = true) -- public class Timings extends ConfigurationPart { -- public boolean enabled = false; -- public boolean verbose = true; -- public String url = "https://timings.aikar.co/"; -- public boolean serverNamePrivacy = false; -- public List hiddenConfigEntries = List.of( -- "database", -- "proxies.velocity.secret" -- ); -- public int historyInterval = 300; -- public int historyLength = 3600; -- public String serverName = "Unknown Server"; -- -- @PostProcess -- private void postProcess() { -- MinecraftTimings.processConfig(this); -- } -- } -- - public Proxies proxies; - - public class Proxies extends ConfigurationPart { -diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java -index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..a1c9726d25479b5326fe2fa2b0f5a98d6b2da4c5 100644 ---- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java -+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java -@@ -1,6 +1,5 @@ - package io.papermc.paper.plugin.manager; - --import co.aikar.timings.TimedEventExecutor; - import com.destroystokyo.paper.event.server.ServerExceptionEvent; - import com.destroystokyo.paper.exception.ServerEventException; - import com.google.common.collect.Sets; -@@ -95,7 +94,6 @@ class PaperEventManager { - throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); - } - -- executor = new TimedEventExecutor(executor, plugin, null, event); - this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); - } - -@@ -182,7 +180,7 @@ class PaperEventManager { - } - } - -- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); -+ EventExecutor executor = EventExecutor.create(method, eventClass); - eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); - } - return ret; -diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java -index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..f06076864582ed153c6154fd7f3e9101bf21c4ac 100644 ---- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java -+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java -@@ -232,7 +232,7 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext - - @Override - public boolean useTimings() { -- return co.aikar.timings.Timings.isTimingsEnabled(); -+ return false; // Leaf - Remove Timings - } - - @Override -diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -index e2c24813f59c2fd075c740ac1842a38f20ed8554..1f7f68aad97ee73763c042837f239bdc7167db55 100644 ---- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java -+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -@@ -51,8 +51,7 @@ public class PacketUtils { - try { // Paper - detailed watchdog information - if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players - if (listener.shouldHandleMessage(packet)) { -- co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings -- try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings -+ try { - packet.handle(listener); - } catch (Exception exception) { - if (exception instanceof ReportedException) { -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1999d5d4599436c527ca4e6e531c5fe91edaa0cb..ccd94b0a8822b17bd218aa95e302a28196849027 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -3,7 +3,6 @@ package net.minecraft.server; - import com.google.common.base.Preconditions; - import com.google.common.base.Splitter; - import com.google.common.collect.ImmutableList; --import co.aikar.timings.Timings; - import com.destroystokyo.paper.event.server.PaperServerListPingEvent; - import com.google.common.base.Stopwatch; - import com.google.common.collect.Lists; -@@ -187,8 +186,6 @@ import org.bukkit.craftbukkit.CraftRegistry; - import org.bukkit.event.server.ServerLoadEvent; - // CraftBukkit end - --import co.aikar.timings.MinecraftTimings; // Paper -- - public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer { // Paper - rewrite chunk system - - public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable -@@ -1025,7 +1022,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick -@@ -1608,15 +1603,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - return !this.canOversleep(); - }); -- isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); -+ isOversleep = false; - // Paper end - this.server.spark.tickStart(); // Paper - spark - new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events -@@ -1650,11 +1644,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - entityplayer.connection.suspendFlushing(); - }); -- MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper - this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit -- MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper - // Paper start - Folia scheduler API - ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); - getAllLevels().forEach(level -> { -@@ -1764,20 +1751,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop waitable = new Waitable<>() { -- @Override -- protected String evaluate() { -- return sender.getBuffer(); -- } -- }; -- waitableArray[0] = waitable; -- co.aikar.timings.Timings.generateReport(new co.aikar.timings.TimingsReportListener(sender, waitable)); -- } else { -- // Paper end - ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper); - this.server.dispatchServerCommand(event.getSender(), serverCommand); -- } // Paper - }); - // Paper start - if (waitableArray[0] != null) { -diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index e623490b47842114f0bd1c96d806be43dc0447ca..4d91b50e527320647f6c9aa20fc5da071c3fdee0 100644 ---- a/src/main/java/net/minecraft/server/level/ChunkMap.java -+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1,6 +1,5 @@ - package net.minecraft.server.level; - --import co.aikar.timings.Timing; // Paper - import com.google.common.collect.ImmutableList; - import com.google.common.collect.ImmutableList.Builder; - import com.google.common.collect.Iterables; -@@ -951,7 +950,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - List list = Lists.newArrayList(); - List list1 = this.level.players(); - ObjectIterator objectiterator = this.entityMap.values().iterator(); -- level.timings.tracker1.startTiming(); // Paper - - ChunkMap.TrackedEntity playerchunkmap_entitytracker; - -@@ -976,17 +974,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - playerchunkmap_entitytracker.serverEntity.sendChanges(); - } - } -- level.timings.tracker1.stopTiming(); // Paper - - if (!list.isEmpty()) { - objectiterator = this.entityMap.values().iterator(); - -- level.timings.tracker2.startTiming(); // Paper - while (objectiterator.hasNext()) { - playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next(); - playerchunkmap_entitytracker.updatePlayers(list); - } -- level.timings.tracker2.stopTiming(); // Paper - } - - } -diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index e8a89db44ed4f20516a9716bc3f41658f63a312c..74bf36f75b59b1e21b72afcf653447864d7c3f80 100644 ---- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java -+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -358,9 +358,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - - public void save(boolean flush) { - // Paper - rewrite chunk system -- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings - this.chunkMap.saveAllChunks(flush); -- } // Paper - Timings - } - - @Override -@@ -392,24 +390,18 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - - @Override - public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { -- this.level.timings.doChunkMap.startTiming(); // Spigot - if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot - this.distanceManager.purgeStaleTickets(); - } - - this.runDistanceManagerUpdates(); -- this.level.timings.doChunkMap.stopTiming(); // Spigot - if (tickChunks) { -- this.level.timings.chunks.startTiming(); // Paper - timings - ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system - this.tickChunks(); -- this.level.timings.chunks.stopTiming(); // Paper - timings - this.chunkMap.tick(); - } - -- this.level.timings.doChunkUnload.startTiming(); // Spigot - this.chunkMap.tick(shouldKeepTicking); -- this.level.timings.doChunkUnload.stopTiming(); // Spigot - this.clearCache(); - } - -@@ -440,7 +432,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - // Paper end - chunk tick iteration optimisations - Iterator iterator = null; // Paper - chunk tick iteration optimisations -- if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper - - // Paper - chunk tick iteration optimisations - -@@ -452,7 +443,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - boolean flagAndHasNaturalSpawn = flag && this.anySpawnCategoryIsSpawnedThisTick(); - if (flagAndHasNaturalSpawn) { - // Gale end - MultiPaper - skip unnecessary mob spawning computations -- this.level.timings.countNaturalMobs.startTiming(); // Paper - timings - int k = this.distanceManager.getNaturalSpawnChunkCount(); - // Paper start - Optional per player mob spawns - int naturalSpawnChunkCount = k; -@@ -481,7 +471,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - // Pufferfish end - } - // Paper end - Optional per player mob spawns -- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings - - //this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously - // Gale start - MultiPaper - skip unnecessary mob spawning computations -@@ -525,17 +514,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - } - } -- this.level.timings.chunkTicks.stopTiming(); // Paper - - if (flag) { -- try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings - this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); -- } // Paper - timings - } - } - - // Paper start - chunk tick iteration optimisations -- this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing - { - final it.unimi.dsi.fastutil.objects.ObjectArrayList chunks = (it.unimi.dsi.fastutil.objects.ObjectArrayList)list; - final ServerChunkCache.ChunkAndHolder[] raw = chunks.elements(); -@@ -549,7 +534,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - holder.holder().broadcastChanges(holder.chunk()); - } - } -- this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing - // Paper end - chunk tick iteration optimisations - } - -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d2cbf34389a1b56c442c6ce08f55f1174a9d9f0b..70b247cd559cb9814fbf8e3ab7839a40488dbef1 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1,7 +1,6 @@ - package net.minecraft.server.level; - - import com.google.common.annotations.VisibleForTesting; --import co.aikar.timings.TimingHistory; // Paper - import com.google.common.collect.Lists; - import com.mojang.datafixers.DataFixer; - import com.mojang.datafixers.util.Pair; -@@ -683,27 +682,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - this.tickTime(); - } - -- this.timings.scheduledBlocks.startTiming(); // Paper - if (!this.isDebug() && flag) { - j = this.getGameTime(); - this.blockTicks.tick(j, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks - this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks - } -- this.timings.scheduledBlocks.stopTiming(); // Paper - - if (flag) { -- this.timings.raids.startTiming(); // Paper - timings - this.raids.tick(); -- this.timings.raids.stopTiming(); // Paper - timings - } - -- this.timings.chunkProviderTick.startTiming(); // Paper - timings - this.getChunkSource().tick(shouldKeepTicking, true); -- this.timings.chunkProviderTick.stopTiming(); // Paper - timings - if (flag) { -- this.timings.doSounds.startTiming(); // Spigot - this.runBlockEvents(); -- this.timings.doSounds.stopTiming(); // Spigot - } - - this.handlingTick = false; -@@ -714,13 +705,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - } - - if (flag1 || this.emptyTime++ < 300) { -- this.timings.tickEntities.startTiming(); // Spigot - if (this.dragonFight != null && flag) { - this.dragonFight.tick(); - } - - org.spigotmc.ActivationRange.activateEntities(this); // Spigot -- this.timings.entityTick.startTiming(); // Spigot - this.entityTickList.forEach((entity) -> { - entity.activatedPriorityReset = false; // Pufferfish - DAB - if (!entity.isRemoved()) { -@@ -757,8 +746,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - } - } - }); -- this.timings.entityTick.stopTiming(); // Spigot -- this.timings.tickEntities.stopTiming(); // Spigot - this.tickBlockEntities(); - } - -@@ -942,12 +929,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - } - } // Paper - Option to disable ice and snow - -- timings.chunkTicksBlocks.startTiming(); // Paper - if (randomTickSpeed > 0) { - this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking - } -- -- timings.chunkTicksBlocks.stopTiming(); // Paper - } - - @VisibleForTesting -@@ -1276,31 +1260,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - currentlyTickingEntity.lazySet(entity); - } - // Paper end - log detailed entity tick information -- ++TimingHistory.entityTicks; // Paper - timings - // Spigot start -- co.aikar.timings.Timing timer; // Paper - /*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below - entity.tickCount++; -- timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings - entity.inactiveTick(); -- } finally { timer.stopTiming(); } // Paper - return; - }*/ // Paper - comment out EAR 2 - // Spigot end -- // Paper start- timings - final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); -- timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper -- try { -- // Paper end - timings - entity.setOldPosAndRot(); - - ++entity.tickCount; - if (isActive) { // Paper - EAR 2 -- TimingHistory.activatedEntityTicks++; - entity.tick(); - entity.postTick(); // CraftBukkit - } else { entity.inactiveTick(); } // Paper - EAR 2 -- } finally { timer.stopTiming(); } // Paper - timings - Iterator iterator = entity.getPassengers().iterator(); - - while (iterator.hasNext()) { -@@ -1308,7 +1282,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - - this.tickPassenger(entity, entity1); - } -- // } finally { timer.stopTiming(); } // Paper - timings - move up - // Paper start - log detailed entity tick information - } finally { - if (currentlyTickingEntity.get() == entity) { -@@ -1323,9 +1296,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - if (passenger instanceof Player || this.entityTickList.contains(passenger)) { - // Paper - EAR 2 - final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger); -- co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper -- try { -- // Paper end - passenger.setOldPosAndRot(); - ++passenger.tickCount; - -@@ -1347,8 +1317,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - - this.tickPassenger(passenger, entity2); - } -- -- } finally { timer.stopTiming(); }// Paper - EAR2 timings - } - } else { - passenger.stopRiding(); -@@ -1368,7 +1336,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); - } - -- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) { - if (doFull) { - this.saveLevelData(true); - } -@@ -1385,7 +1352,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); - } - // CraftBukkit end -- } - } - // Paper end - Incremental chunk and player saving - -@@ -1399,7 +1365,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - - if (!savingDisabled) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit -- try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper - if (progressListener != null) { - progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); - } -@@ -1409,10 +1374,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - progressListener.progressStage(Component.translatable("menu.savingChunks")); - } - -- timings.worldSaveChunks.startTiming(); // Paper - if (!close) { chunkproviderserver.save(flush); } // Paper - add close param -- timings.worldSaveChunks.stopTiming(); // Paper -- }// Paper - // Paper - rewrite chunk system - - } -diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index fe8eba4f73a7df86912002c25516806c8cabf114..bf3561764bab8e1b237c2b9760181853f60c8fa7 100644 ---- a/src/main/java/net/minecraft/server/players/PlayerList.java -+++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1,6 +1,5 @@ - package net.minecraft.server.players; - --import co.aikar.timings.MinecraftTimings; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.google.common.collect.Sets; -@@ -1297,7 +1296,6 @@ public abstract class PlayerList { - - public void saveAll(int interval) { - io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main -- MinecraftTimings.savePlayers.startTiming(); // Paper - int numSaved = 0; - long now = MinecraftServer.currentTick; - for (int i = 0; i < this.players.size(); ++i) { -@@ -1308,7 +1306,6 @@ public abstract class PlayerList { - } - // Paper end - Incremental chunk and player saving - } -- MinecraftTimings.savePlayers.stopTiming(); // Paper - return null; }); // Paper - ensure main - } - -diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index d3de0362dd1ef3954d05c4d8fa56a25edfe1bb2b..6ac3dfab99cfb0b51c81cc20e71da1261a8c567c 100644 ---- a/src/main/java/net/minecraft/world/entity/EntityType.java -+++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -356,10 +356,6 @@ public class EntityType implements FeatureElement, EntityTypeT - this(factory, spawnGroup, saveable, summonable, fireImmune, spawnableFarFromPlayer, canSpawnInside, dimensions, spawnBoxScale, maxTrackDistance, trackTickInterval, requiredFeatures, "custom"); - } - public EntityType(EntityType.EntityFactory factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet canSpawnInside, EntityDimensions dimensions, float spawnBoxScale, int maxTrackDistance, int trackTickInterval, FeatureFlagSet requiredFeatures, String id) { -- this.tickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "tick"); -- this.inactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "inactiveTick"); -- this.passengerTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerTick"); -- this.passengerInactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerInactiveTick"); - // Paper end - this.builtInRegistryHolder = BuiltInRegistries.ENTITY_TYPE.createIntrusiveHolder(this); - this.factory = factory; -@@ -729,12 +725,6 @@ public class EntityType implements FeatureElement, EntityTypeT - return this.updateInterval; - } - -- // Paper start - timings -- public final co.aikar.timings.Timing tickTimer; -- public final co.aikar.timings.Timing inactiveTickTimer; -- public final co.aikar.timings.Timing passengerTickTimer; -- public final co.aikar.timings.Timing passengerInactiveTickTimer; -- // Paper end - public boolean trackDeltas() { - return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; - } -diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 64013ae4bdaabf10ac0dbbab8ccfa6430df76b83..1e2e90af2ab65938c6d711a187dd4d65a93b1280 100644 ---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java -+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -157,8 +157,6 @@ import org.bukkit.event.entity.EntityTeleportEvent; - import org.bukkit.event.player.PlayerItemConsumeEvent; - // CraftBukkit end - --import co.aikar.timings.MinecraftTimings; // Paper -- - public abstract class LivingEntity extends Entity implements Attackable { - - private static final Logger LOGGER = LogUtils.getLogger(); -diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java -index 9379dd4056018b52c93ed4888dcdc94579bd9691..c6a7bb3e710b0e3f7e00a11fa5057a24aee8d7a3 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java -+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java -@@ -14,10 +14,9 @@ public abstract class Behavior implements BehaviorContro - private long endTimestamp; - private final int minDuration; - private final int maxDuration; -- // Paper start - configurable behavior tick rate and timings -+ // Paper start - configurable behavior tick rate - private final String configKey; -- private final co.aikar.timings.Timing timing; -- // Paper end - configurable behavior tick rate and timings -+ // Paper end - configurable behavior tick rate - - public Behavior(Map, MemoryStatus> requiredMemoryState) { - this(requiredMemoryState, 60); -@@ -31,15 +30,14 @@ public abstract class Behavior implements BehaviorContro - this.minDuration = minRunTime; - this.maxDuration = maxRunTime; - this.entryCondition = requiredMemoryState; -- // Paper start - configurable behavior tick rate and timings -+ // Paper start - configurable behavior tick rate - String key = io.papermc.paper.util.MappingEnvironment.reobf() ? io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(this.getClass().getName()) : this.getClass().getName(); - int lastSeparator = key.lastIndexOf('.'); - if (lastSeparator != -1) { - key = key.substring(lastSeparator + 1); - } - this.configKey = key.toLowerCase(java.util.Locale.ROOT); -- this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey); -- // Paper end - configurable behavior tick rate and timings -+ // Paper end - configurable behavior tick rate - } - - @Override -@@ -49,19 +47,17 @@ public abstract class Behavior implements BehaviorContro - - @Override - public final boolean tryStart(ServerLevel world, E entity, long time) { -- // Paper start - configurable behavior tick rate and timings -+ // Paper start - configurable behavior tick rate - int tickRate = java.util.Objects.requireNonNullElse(world.paperConfig().tickRates.behavior.get(entity.getType(), this.configKey), -1); - if (tickRate > -1 && time < this.endTimestamp + tickRate) { - return false; - } -- // Paper end - configurable behavior tick rate and timings -+ // Paper end - configurable behavior tick rate - if (this.hasRequiredMemories(entity) && this.checkExtraStartConditions(world, entity)) { - this.status = Behavior.Status.RUNNING; - int i = this.minDuration + world.getRandom().nextInt(this.maxDuration + 1 - this.minDuration); - this.endTimestamp = time + (long)i; -- this.timing.startTiming(); // Paper - behavior timings - this.start(world, entity, time); -- this.timing.stopTiming(); // Paper - behavior timings - return true; - } else { - return false; -@@ -73,13 +69,11 @@ public abstract class Behavior implements BehaviorContro - - @Override - public final void tickOrStop(ServerLevel world, E entity, long time) { -- this.timing.startTiming(); // Paper - behavior timings - if (!this.timedOut(time) && this.canStillUse(world, entity, time)) { - this.tick(world, entity, time); - } else { - this.doStop(world, entity, time); - } -- this.timing.stopTiming(); // Paper - behavior timings - } - - protected void tick(ServerLevel world, E entity, long time) { -diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -index 85b4b24361e785acf75571ff98f924c00ae80748..ac67dd7a30616fe70f73426e332972b7b942e91e 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -@@ -26,20 +26,18 @@ public abstract class Sensor { - .ignoreInvisibilityTesting(); - private final int scanRate; - private long timeToTick; -- // Paper start - configurable sensor tick rate and timings -+ // Paper start - configurable sensor tick rate - private final String configKey; -- private final co.aikar.timings.Timing timing; - // Paper end - - public Sensor(int senseInterval) { -- // Paper start - configurable sensor tick rate and timings -+ // Paper start - configurable sensor tick rate - String key = io.papermc.paper.util.MappingEnvironment.reobf() ? io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(this.getClass().getName()) : this.getClass().getName(); - int lastSeparator = key.lastIndexOf('.'); - if (lastSeparator != -1) { - key = key.substring(lastSeparator + 1); - } - this.configKey = key.toLowerCase(java.util.Locale.ROOT); -- this.timing = co.aikar.timings.MinecraftTimings.getSensorTimings(configKey, senseInterval); - // Paper end - this.scanRate = senseInterval; - this.timeToTick = (long)RANDOM.nextInt(senseInterval); -@@ -51,12 +49,10 @@ public abstract class Sensor { - - public final void tick(ServerLevel world, E entity) { - if (--this.timeToTick <= 0L) { -- // Paper start - configurable sensor tick rate and timings -+ // Paper start - configurable sensor tick rate - this.timeToTick = java.util.Objects.requireNonNullElse(world.paperConfig().tickRates.sensor.get(entity.getType(), this.configKey), this.scanRate); -- this.timing.startTiming(); - // Paper end - this.doTick(world, entity); -- this.timing.stopTiming(); // Paper - sensor timings - } - } - -diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index bb4b64b709e09b2b38cbbe4104622cb267fbb1a6..ad056c22eec4fae4f9d4a4b0ec901729f47b4774 100644 ---- a/src/main/java/net/minecraft/world/level/Level.java -+++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -179,7 +179,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - - public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray - public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur -- public final co.aikar.timings.WorldTimingsHandler timings; // Paper - public static BlockPos lastPhysicsProblem; // Spigot - private org.spigotmc.TickLimiter entityLimiter; - private org.spigotmc.TickLimiter tileLimiter; -@@ -827,7 +826,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} - }); - // CraftBukkit end -- this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings - this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); - this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system -@@ -1430,15 +1428,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - } - - protected void tickBlockEntities() { -- this.timings.tileEntityPending.startTiming(); // Spigot - this.tickingBlockEntities = true; - if (!this.pendingBlockEntityTickers.isEmpty()) { - this.blockEntityTickers.addAll(this.pendingBlockEntityTickers); - this.pendingBlockEntityTickers.clear(); - } -- this.timings.tileEntityPending.stopTiming(); // Spigot - -- this.timings.tileEntityTick.startTiming(); // Spigot - // Spigot start - // Iterator iterator = this.blockEntityTickers.iterator(); - boolean flag = this.tickRateManager().runsNormally(); -@@ -1469,9 +1464,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - } - this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 - -- this.timings.tileEntityTick.stopTiming(); // Spigot - this.tickingBlockEntities = false; -- co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper - this.spigotConfig.currentPrimedTnt = 0; // Spigot - } - -diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 7dd99267ad2071b7537c46de3d1dc234384f593a..88d68784dd1dcf9e67fd596cab4e83ebeada8e45 100644 ---- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java -+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -127,7 +127,6 @@ public final class NaturalSpawner { - } - - public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) { -- world.timings.mobSpawn.startTiming(); // Spigot - MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES; - int i = aenumcreaturetype.length; - -@@ -178,8 +177,6 @@ public final class NaturalSpawner { - // Paper end - Optional per player mob spawns - } - } -- -- world.timings.mobSpawn.stopTiming(); // Spigot - } - - // Paper start - Add mobcaps commands -diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 34d96e8bfebdee3bcc61071c6ec22b53baecec3f..4eab34f932ae564aa038cecf4426b9f74a513ee7 100644 ---- a/src/main/java/net/minecraft/world/level/block/Block.java -+++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -106,13 +106,6 @@ public class Block extends BlockBehaviour implements ItemLike { - this != Blocks.STRUCTURE_BLOCK && - this != Blocks.JIGSAW; - } -- public co.aikar.timings.Timing timing; -- public co.aikar.timings.Timing getTiming() { -- if (timing == null) { -- timing = co.aikar.timings.MinecraftTimings.getBlockTiming(this); -- } -- return timing; -- } - // Paper end - @Nullable - private String descriptionId; -diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index a7b6c20afd9ec3fe61d2bdf42f96398c8d6751cc..73c9f91457683e8e6bd8293b4393ccbd984eddb7 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -33,14 +33,9 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; - import org.bukkit.inventory.InventoryHolder; - // CraftBukkit end - --import org.spigotmc.CustomTimingsHandler; // Spigot --import co.aikar.timings.MinecraftTimings; // Paper --import co.aikar.timings.Timing; // Paper -- - public abstract class BlockEntity { - static boolean ignoreTileUpdates; // Paper - Perf: Optimize Hoppers - -- public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper - // CraftBukkit start - data containers - private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); - public CraftPersistentDataContainer persistentDataContainer; -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 4aa33233060b2b2bd809d92d35bd0933cb015d41..5ad94cabbab741d69363d40df359075da7165c97 100644 ---- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -674,7 +674,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system - - if (this.needsDecoration) { -- try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper - this.needsDecoration = false; - java.util.Random random = new java.util.Random(); - random.setSeed(this.level.getSeed()); -@@ -694,7 +693,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - } - } - server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); -- } // Paper - } - } - } -@@ -1031,7 +1029,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - - if (LevelChunk.this.isTicking(blockposition)) { - try { -- this.blockEntity.tickTimer.startTiming(); // Spigot - BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); - - if (this.blockEntity.getType().isValid(iblockdata)) { -@@ -1054,14 +1051,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent - LevelChunk.this.removeBlockEntity(this.getPos()); - // Paper end - Prevent block entity and entity crashes -- // Spigot start -- } finally { -- this.blockEntity.tickTimer.stopTiming(); -- // Spigot end - } - } - } -- - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8049d77b8a01b4384016c3d22db9af95eaa5c2e8..8365daf4b9da71b68493a309f11b94de1e8d56cf 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -475,7 +475,6 @@ public final class CraftServer implements Server { - this.saveCommandsConfig(); - this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); - this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -- //this.pluginManager.useTimings(this.configuration.getBoolean("settings.plugin-profiling")); // Paper - we already moved this - this.overrideSpawnLimits(); - console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); - this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); -@@ -1033,10 +1032,8 @@ public final class CraftServer implements Server { - commands.performCommand(results, commandLine, commandLine, true); - } catch (CommandException ex) { - this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper -- //target.timings.stopTiming(); // Spigot // Paper - throw ex; - } catch (Throwable ex) { -- //target.timings.stopTiming(); // Spigot // Paper - String msg = "Unhandled exception executing '" + commandLine + "' in " + target; - this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper - throw new CommandException(msg, ex); -diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index fba0558f46516f65c678635359f305f865336d3a..e1ff5511d4694c13249443da0f127456d53e5543 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -@@ -1,6 +1,5 @@ - package org.bukkit.craftbukkit.scheduler; - --import co.aikar.timings.MinecraftTimings; // Paper - import com.google.common.base.Preconditions; - import com.google.common.util.concurrent.ThreadFactoryBuilder; - import java.util.ArrayList; -@@ -297,7 +296,7 @@ public class CraftScheduler implements BukkitScheduler { - } - return false; - } -- }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}; // Paper -+ }); - this.handle(task, 0L); - for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) { - if (taskPending == task) { -@@ -337,7 +336,7 @@ public class CraftScheduler implements BukkitScheduler { - } - } - } -- }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer(plugin);}}; // Paper -+ }); - this.handle(task, 0L); - for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) { - if (taskPending == task) { -@@ -504,10 +503,8 @@ public class CraftScheduler implements BukkitScheduler { - this.runners.remove(task.getTaskId()); - } - } -- MinecraftTimings.bukkitSchedulerFinishTimer.startTiming(); // Paper - this.pending.addAll(temp); - temp.clear(); -- MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper - //this.debugHead = this.debugHead.getNextHead(currentTick); // Paper - } - -@@ -550,7 +547,6 @@ public class CraftScheduler implements BukkitScheduler { - } - - void parsePending() { // Paper -- if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTiming(); // Paper - CraftTask head = this.head; - CraftTask task = head.getNext(); - CraftTask lastTask = head; -@@ -569,7 +565,6 @@ public class CraftScheduler implements BukkitScheduler { - task.setNext(null); - } - this.head = lastTask; -- if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.stopTiming(); // Paper - } - - private boolean isReady(final int currentTick) { -diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -index ba369f3dcfdf498e971dc4405d39657a9b6e97cc..bb6b5c0f331096fe2d1d08b2b8268662fd675e07 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -@@ -2,15 +2,10 @@ package org.bukkit.craftbukkit.scheduler; - - import java.util.function.Consumer; - --import co.aikar.timings.NullTimingHandler; - import org.bukkit.Bukkit; - import org.bukkit.plugin.Plugin; - import org.bukkit.scheduler.BukkitTask; - --import org.spigotmc.CustomTimingsHandler; // Spigot --import co.aikar.timings.MinecraftTimings; // Paper --import co.aikar.timings.Timing; // Paper -- - public class CraftTask implements BukkitTask, Runnable { // Spigot - - private volatile CraftTask next = null; -@@ -31,7 +26,6 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot - private long nextRun; - public final Runnable rTask; // Paper - public final Consumer cTask; // Paper -- public Timing timings; // Paper - private final Plugin plugin; - private final int id; - private final long createdAt = System.nanoTime(); -@@ -61,7 +55,6 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot - } - this.id = id; - this.period = period; -- timings = task != null ? MinecraftTimings.getPluginTaskTimings(this, period) : NullTimingHandler.NULL; // Paper - } - - @Override -@@ -81,13 +74,11 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot - - @Override - public void run() { -- try (Timing ignored = timings.startTiming()) { // Paper - if (this.rTask != null) { - this.rTask.run(); - } else { - this.cTask.accept(this); - } -- } // Paper - } - - long getCreatedAt() { -diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..e9798517b9211c50a20ea5c69603aab35f614f02 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -@@ -115,16 +115,9 @@ public final class CraftScoreboardManager implements ScoreboardManager { - public void forAllObjectives(ObjectiveCriteria criteria, ScoreHolder holder, Consumer consumer) { - // Paper start - add timings for scoreboard search - // plugins leaking scoreboards will make this very expensive, let server owners debug it easily -- co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync(); -- try { -- // Paper end - add timings for scoreboard search - for (CraftScoreboard scoreboard : this.scoreboards) { - Scoreboard board = scoreboard.board; - board.forAllObjectives(criteria, holder, (score) -> consumer.accept(score)); - } -- } finally { // Paper start - add timings for scoreboard search -- co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync(); -- } -- // Paper end - add timings for scoreboard search - } - } -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index ebf68793373b128e63960e1c60a22d71a46a6b4e..7d53a86c5aa5a1eeeb26dbc56e5f104729806d20 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -201,9 +201,7 @@ public final class CraftMagicNumbers implements UnsafeValues { - // ======================================================================== - // Paper start - @Override -- public void reportTimings() { -- co.aikar.timings.TimingsExport.reportTimings(); -- } -+ public void reportTimings() {} // Leaf - Remove Timings - // Paper end - - public static byte toLegacyData(BlockState data) { -@@ -484,7 +482,7 @@ public final class CraftMagicNumbers implements UnsafeValues { - // Paper start - @Override - public String getTimingsServerName() { -- return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName; -+ return org.dreeam.leaf.config.modules.misc.ServerBrand.serverModName; // Leaf - Remove Timings - } - - @Override -diff --git a/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java b/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java -deleted file mode 100644 -index 579c2e69d8f6ce8398eb1297d1d1ead98c9068a5..0000000000000000000000000000000000000000 ---- a/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java -+++ /dev/null -@@ -1,19 +0,0 @@ --// Gale - Gale configuration -- --package org.galemc.gale.configuration.timingsexport; -- --import co.aikar.timings.TimingsExport; --import org.bukkit.Bukkit; --import org.jetbrains.annotations.NotNull; --import org.json.simple.JSONObject; -- --public final class GaleConfigurationTimingsExport { -- -- private GaleConfigurationTimingsExport() {} -- -- public static @NotNull JSONObject get() { -- var json = TimingsExport.mapAsJSON(Bukkit.spigot().getGaleConfig(), null); -- return json; -- } -- --} -diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 22e937218864fed922192c1499e26ed3d3323320..c4ff4748472c79b3bb9458e24d1c63a72ce4c070 100644 ---- a/src/main/java/org/spigotmc/ActivationRange.java -+++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -34,7 +34,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity; - import net.minecraft.world.entity.projectile.ThrowableProjectile; - import net.minecraft.world.entity.projectile.ThrownTrident; - import net.minecraft.world.entity.raid.Raider; --import co.aikar.timings.MinecraftTimings; - import net.minecraft.world.entity.schedule.Activity; - import net.minecraft.world.level.Level; - import net.minecraft.world.phys.AABB; -@@ -179,7 +178,6 @@ public class ActivationRange - */ - public static void activateEntities(Level world) - { -- MinecraftTimings.entityActivationCheckTimer.startTiming(); - final int miscActivationRange = world.spigotConfig.miscActivationRange; - final int raiderActivationRange = world.spigotConfig.raiderActivationRange; - final int animalActivationRange = world.spigotConfig.animalActivationRange; -@@ -257,7 +255,6 @@ public class ActivationRange - } - // Paper end - } -- MinecraftTimings.entityActivationCheckTimer.stopTiming(); - } - - /** diff --git a/patches/server/0017-Remove-vanilla-username-check.patch b/patches/server/0016-Remove-vanilla-username-check.patch similarity index 95% rename from patches/server/0017-Remove-vanilla-username-check.patch rename to patches/server/0016-Remove-vanilla-username-check.patch index 6b0be141a..2b4f53d04 100644 --- a/patches/server/0017-Remove-vanilla-username-check.patch +++ b/patches/server/0016-Remove-vanilla-username-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove vanilla username check diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 5e64def50ba96778cbfaaf1dde0bd8193e9b6bfe..885c6b8c82d46f8e21eb648441dba10c3f3a99f6 100644 +index d5acf191e3f34c84b3711c0ba77e7cb001aee507..0afd30a9a4eb7de7e58e1b91342cca51c771f300 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -186,7 +186,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -32,7 +32,7 @@ index 34b4166adfae8ff7d1eb73d56a72931b005330a7..18ecb876bb65d2cf5d8fc999a22712f5 } else { final AtomicReference atomicreference = new AtomicReference(); diff --git a/src/main/java/net/minecraft/util/StringUtil.java b/src/main/java/net/minecraft/util/StringUtil.java -index 20211f40aeeade9217ece087688974bdf55afc56..90d710bad35dbe92d140755c13f4557a4958b0a7 100644 +index c89fc375aff548a2b03eaf4da3b6a075012df012..68e621ef12d9da67f04086d42360cb08b169aba4 100644 --- a/src/main/java/net/minecraft/util/StringUtil.java +++ b/src/main/java/net/minecraft/util/StringUtil.java @@ -64,6 +64,13 @@ public class StringUtil { diff --git a/patches/server/0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch b/patches/server/0017-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch similarity index 100% rename from patches/server/0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch rename to patches/server/0017-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch diff --git a/patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch b/patches/server/0018-Remove-UseItemOnPacket-Too-Far-Check.patch similarity index 95% rename from patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch rename to patches/server/0018-Remove-UseItemOnPacket-Too-Far-Check.patch index 8705b3842..d8ec96341 100644 --- a/patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch +++ b/patches/server/0018-Remove-UseItemOnPacket-Too-Far-Check.patch @@ -7,10 +7,10 @@ This Check is added in 1.17.x -> 1.18.x that updated by Mojang. By removing this check, it gives ability for hackers to use some modules of hack clients. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index adf4732e57927810d34bf37fb3e9d2dc7b7977d5..def145674389e1e942a69ae4bdf11b5a0ea2155f 100644 +index 7434eac75587ed82e60a25145f42ec3e949da672..8018b41a8e36a8b27de369f00e250c7dd9340907 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2013,7 +2013,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2027,7 +2027,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition)); double d0 = 1.0000001D; diff --git a/patches/server/0020-KeYi-Player-Skull-API.patch b/patches/server/0019-KeYi-Player-Skull-API.patch similarity index 92% rename from patches/server/0020-KeYi-Player-Skull-API.patch rename to patches/server/0019-KeYi-Player-Skull-API.patch index 2dcc79d31..34a1b1586 100644 --- a/patches/server/0020-KeYi-Player-Skull-API.patch +++ b/patches/server/0019-KeYi-Player-Skull-API.patch @@ -7,10 +7,10 @@ Original license: MIT Original project: https://github.com/KeYiMC/KeYi diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 173e4a075078af67f030750c9a6294ab3f796677..88668656c8586d758b636561066d96dd883e6201 100644 +index 63065a22ff359c142bab23fccacfd5ebd86f81a5..d0bdce91b073344f218c1624cd66fdda5d3e5b0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3663,4 +3663,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3675,4 +3675,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message))); } // Purpur end diff --git a/patches/server/0021-KeYi-Disable-arrow-despawn-counter-by-default.patch b/patches/server/0020-KeYi-Disable-arrow-despawn-counter-by-default.patch similarity index 81% rename from patches/server/0021-KeYi-Disable-arrow-despawn-counter-by-default.patch rename to patches/server/0020-KeYi-Disable-arrow-despawn-counter-by-default.patch index 6d950f9c3..ad02cf9c7 100644 --- a/patches/server/0021-KeYi-Disable-arrow-despawn-counter-by-default.patch +++ b/patches/server/0020-KeYi-Disable-arrow-despawn-counter-by-default.patch @@ -7,11 +7,11 @@ Original license: MIT Original project: https://github.com/KeYiMC/KeYi diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java -index 15b351e23ca2daac2a903d58774f2a9bf3b4b070..9df60b85bb47d25f375132b775163befb36987f7 100644 +index 5b9e55bc9c7a67487400f59ba6bfaa9f68c6504a..838d15a8c81f168b6d94adb602a996123313aaea 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java -@@ -136,7 +136,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { - public boolean loadPortalDestinationChunkBeforeEntityTeleport = false; // Gale - MultiPaper - load portal destination chunk before entity teleport +@@ -126,7 +126,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { + } - public boolean arrowMovementResetsDespawnCounter = true; // Gale - Purpur - make arrow movement resetting despawn counter configurable diff --git a/patches/server/0022-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch b/patches/server/0021-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch similarity index 93% rename from patches/server/0022-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch rename to patches/server/0021-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch index d267076e3..c443d5124 100644 --- a/patches/server/0022-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch +++ b/patches/server/0021-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch @@ -7,10 +7,10 @@ Original license: MIT Original project: https://github.com/KeYiMC/KeYi diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 3e89e3f5760690f30221b64e40e69bccb18178fa..a5b392364c2dfceafbee4523699431381db7e7f9 100644 +index 8162d95c111dc0e05c6993a43e40c3406060e600..186fb46e491bcf5d2a85e68ecf8e13b87381875c 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -354,7 +354,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -357,7 +357,7 @@ public class ItemEntity extends Entity implements TraceableEntity { ItemStack itemstack1 = other.getItem(); if (Objects.equals(this.target, other.target) && ItemEntity.areMergable(itemstack, itemstack1)) { diff --git a/patches/server/0023-Carpet-Fixes-Optimized-getBiome-method.patch b/patches/server/0022-Carpet-Fixes-Optimized-getBiome-method.patch similarity index 98% rename from patches/server/0023-Carpet-Fixes-Optimized-getBiome-method.patch rename to patches/server/0022-Carpet-Fixes-Optimized-getBiome-method.patch index c1b884bb1..74f440d49 100644 --- a/patches/server/0023-Carpet-Fixes-Optimized-getBiome-method.patch +++ b/patches/server/0022-Carpet-Fixes-Optimized-getBiome-method.patch @@ -10,7 +10,7 @@ Optimized the getBiome call to be 25% - 75% faster This is a fully vanilla optimization. diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java -index 01352cc83b25eb0e30b7e0ff521fc7c1b3d5155b..b90a323c4fc9af141758a73a72e6918300caf470 100644 +index 90f8360f547ce709fd13ee34f8e67d8bfa94b498..7750c0fe4416943ac82fc9682767e34fce6d8388 100644 --- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java +++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java @@ -14,6 +14,7 @@ public class BiomeManager { diff --git a/patches/server/0025-Rail-Optimization-optimized-PoweredRailBlock-logic.patch b/patches/server/0023-Rail-Optimization-optimized-PoweredRailBlock-logic.patch similarity index 99% rename from patches/server/0025-Rail-Optimization-optimized-PoweredRailBlock-logic.patch rename to patches/server/0023-Rail-Optimization-optimized-PoweredRailBlock-logic.patch index e46aeacfd..e0f434ec4 100644 --- a/patches/server/0025-Rail-Optimization-optimized-PoweredRailBlock-logic.patch +++ b/patches/server/0023-Rail-Optimization-optimized-PoweredRailBlock-logic.patch @@ -12,7 +12,7 @@ powered rail logic from a single rail instead of each block iterating separately expensive but also completely unnecessary and with a lot of massive overhead diff --git a/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java b/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java -index 8fc65c32a3c6e6842a76b36f45e1b1c23abbc480..b2a3150f08db32dcfecff0390eec810c9ec18a24 100644 +index bd14c08defe8afc5ceca59d16a5b1dbad178f594..b37ab12d4c51aca1576a14147a959188031d0fd7 100644 --- a/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java @@ -29,7 +29,7 @@ public class PoweredRailBlock extends BaseRailBlock { diff --git a/patches/server/0026-Akarin-Save-Json-list-asynchronously.patch b/patches/server/0024-Akarin-Save-Json-list-asynchronously.patch similarity index 100% rename from patches/server/0026-Akarin-Save-Json-list-asynchronously.patch rename to patches/server/0024-Akarin-Save-Json-list-asynchronously.patch diff --git a/patches/server/0027-Slice-Smooth-Teleports.patch b/patches/server/0025-Slice-Smooth-Teleports.patch similarity index 88% rename from patches/server/0027-Slice-Smooth-Teleports.patch rename to patches/server/0025-Slice-Smooth-Teleports.patch index 2ee431347..bcdd4af0c 100644 --- a/patches/server/0027-Slice-Smooth-Teleports.patch +++ b/patches/server/0025-Slice-Smooth-Teleports.patch @@ -9,10 +9,10 @@ Original project: https://github.com/Cryptite/Slice Co-authored-by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 1dc2af59bafa5a5dc6721da02cde19a3ca77af28..b2ae3fdf128e7d66e3f3430266321a6a09fa0be6 100644 +index 61a990d17adaa9f4144d8a1010e764ae5b4ee2fa..35a73243ce9a27af0c12ef7fb8b1a183f3efaaa5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -307,6 +307,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -332,6 +332,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple private boolean tpsBar = false; // Purpur private boolean compassBar = false; // Purpur private boolean ramBar = false; // Purpur @@ -21,10 +21,10 @@ index 1dc2af59bafa5a5dc6721da02cde19a3ca77af28..b2ae3fdf128e7d66e3f3430266321a6a // Paper start - rewrite chunk system private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index bf3561764bab8e1b237c2b9760181853f60c8fa7..fa658c59c61449e6499f5f0c334df180e532f883 100644 +index 3d6a728c6f9542109e7466d590bb8f015b8c4ac1..e1ceb6added5c5d473cf25162b77c7cf6bf9da49 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -901,10 +901,10 @@ public abstract class PlayerList { +@@ -865,10 +865,10 @@ public abstract class PlayerList { ServerLevel worldserver1 = entityplayer1.serverLevel(); LevelData worlddata = worldserver1.getLevelData(); @@ -37,7 +37,7 @@ index bf3561764bab8e1b237c2b9760181853f60c8fa7..fa658c59c61449e6499f5f0c334df180 entityplayer1.connection.send(new ClientboundSetDefaultSpawnPositionPacket(worldserver.getSharedSpawnPos(), worldserver.getSharedSpawnAngle())); entityplayer1.connection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); entityplayer1.connection.send(new ClientboundSetExperiencePacket(entityplayer1.experienceProgress, entityplayer1.totalExperience, entityplayer1.experienceLevel)); -@@ -965,6 +965,8 @@ public abstract class PlayerList { +@@ -931,6 +931,8 @@ public abstract class PlayerList { return entityplayer1; } @@ -47,11 +47,11 @@ index bf3561764bab8e1b237c2b9760181853f60c8fa7..fa658c59c61449e6499f5f0c334df180 this.sendActiveEffects(player, player.connection); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 88668656c8586d758b636561066d96dd883e6201..75f1e56281014a8fc7e682478307d8f40ad4bdcc 100644 +index d0bdce91b073344f218c1624cd66fdda5d3e5b0e..414e30430eb7bcb935ef2cc038fcb7c27747bdd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1365,6 +1365,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - // Paper end +@@ -1366,6 +1366,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + // Paper end - Teleportation API } + // Slice start diff --git a/patches/server/0028-Parchment-Make-FixLight-use-action-bar.patch b/patches/server/0026-Parchment-Make-FixLight-use-action-bar.patch similarity index 100% rename from patches/server/0028-Parchment-Make-FixLight-use-action-bar.patch rename to patches/server/0026-Parchment-Make-FixLight-use-action-bar.patch