mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
40 lines
1.9 KiB
Diff
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 c671f0ffae3c54290f8cff233306a1cd91aa9ffe..b22d0b0a2cb7e877875739abd87a3beac977c82a 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -2530,6 +2530,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 f7823ed9b293b040e38c517d6b96789c7ebba276..db64aef6cd6bc961c2b69853cb2f5a86a044d49d 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -1782,6 +1782,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
}
|
|
|
|
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();
|
|
}
|
|
|