-
Notifications
You must be signed in to change notification settings - Fork 110
/
0024-Config-to-disable-method-profiler.patch
47 lines (39 loc) · 2.25 KB
/
0024-Config-to-disable-method-profiler.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Mon, 26 Apr 2021 11:34:29 -0500
Subject: [PATCH] Config to disable method profiler
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 9ff0f60f03a532dabb8740ad5c44e068d5a9c8bf..03ef5e6b578aa1e9391e891d3e005b30925eb5a8 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -279,4 +279,10 @@ public class PufferfishConfig {
}
-}
\ No newline at end of file
+ public static boolean disableMethodProfiler;
+ private static void miscSettings() {
+ disableMethodProfiler = getBoolean("misc.disable-method-profiler", true);
+ setComment("misc", "Settings for things that don't belong elsewhere");
+ }
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2e06ffbb87d234bbd6d1d42390b4c6d2b5431ddb..a37e03278ff69ae1012c7a53774b60a45acb6125 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2453,6 +2453,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
+ if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE;
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 5310141d75aa308903f72aaafe3e3bcb7134db77..a9500a588387c045739dfe7bdad99f375ef2a4f9 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1799,6 +1799,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public ProfilerFiller getProfiler() {
+ if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish
return (ProfilerFiller) this.profiler.get();
}