9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/patches/server/0024-Config-to-disable-method-profiler.patch
2024-07-12 14:34:28 +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 778a8c8a88128107b7ccd9bb4a783c0b519da9b1..cb9aae6ff466c07781963ca818ff7421e6bc3964 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2548,6 +2548,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 6bda11e309ec1216f2d5c4fb4eafa8d8ff897192..cf48bc7e256af656dc1f491becb54faa2e648fac 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1893,6 +1893,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();
}