9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-23 00:49:23 +00:00
Files
LeavesMC/patches/server/0025-Config-to-disable-method-profiler.patch
violetc 4a69af351b 1.21 (#238)
---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
Co-authored-by: LittleChest <81231195+LittleChest@users.noreply.github.com>
2024-07-05 01:30:46 +08:00

40 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Mon, 15 Aug 2022 10:18:36 +0800
Subject: [PATCH] Config to disable method profiler
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e91c1db3bcb9f9139d4082e3868d7bcb9a9b084e..8806c9612e81f53241f5f16663aa781b8e03a98f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2546,6 +2546,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
+ // Leaves start - disable method profiler
+ if (org.leavesmc.leaves.LeavesConfig.disableMethodProfiler) {
+ return net.minecraft.util.profiling.InactiveProfiler.INSTANCE;
+ }
+ // Leaves end - disable method profiler
return this.profiler;
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 42206013ca0790f1366319669fe433640a74798c..6ff8be0ee869860d0afe0026f10aad1a108d0b56 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1520,6 +1520,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
public ProfilerFiller getProfiler() {
+ // Leaves start - disable method profiler
+ if (org.leavesmc.leaves.LeavesConfig.disableMethodProfiler) {
+ return net.minecraft.util.profiling.InactiveProfiler.INSTANCE;
+ }
+ // Leaves end - disable method profiler
return (ProfilerFiller) this.profiler.get();
}