9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/patches/server/0023-Config-to-disable-method-profiler.patch
violetc c33b54733c New FakePlayer (#337)
---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
2024-09-16 13:11:32 +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 c68e0a6715c690298268457d6438b12cd5c6baf2..f742d01b441644f5de845c772a779eba0d49d6c1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2559,6 +2559,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 33a5137b1057fe6203e10f9e7e0cb7c4251466e9..e935903d918f12e5e1617ebf2d74399b9cd4f79c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1937,6 +1937,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();
}