mirror of https://github.com/YatopiaMC/Yatopia.git
61 lines
2.6 KiB
Diff
61 lines
2.6 KiB
Diff
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/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
|
|
index c9e00334655ccd273ba108a541ed1cb0633f69b7..65adf3ceda012c8cfdea675c40e2bb27d34ebac7 100644
|
|
--- a/src/main/java/gg/airplane/AirplaneConfig.java
|
|
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
|
|
@@ -111,4 +111,13 @@ public class AirplaneConfig {
|
|
}
|
|
|
|
|
|
+ public static boolean disableMethodProfiler;
|
|
+
|
|
+ private static void miscSettings() {
|
|
+ config.setComment("misc", "Settings for things that don't belong elsewhere");
|
|
+
|
|
+ disableMethodProfiler = config.getBoolean("misc.disable-method-profiler", true);
|
|
+ }
|
|
+
|
|
+
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index b2ae9d92dd2c93304a282b08099dfb1acd72ef4f..baa6698a2444edc1e9a264eeb8771df47e956849 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -2200,7 +2200,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
}
|
|
}
|
|
|
|
+ // Airplane start
|
|
+ private final GameProfilerFiller disabledProfiler = net.minecraft.util.profiling.GameProfilerDisabled.a;
|
|
public GameProfilerFiller getMethodProfiler() {
|
|
+ if (gg.airplane.AirplaneConfig.disableMethodProfiler) return disabledProfiler;
|
|
+ // Airplane end
|
|
return this.methodProfiler;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
|
index 3abea117b29e57013fb556855ef9def023069bf9..f8d11a1f0337acf60f2d9f94bd4bbbf6eb77c6de 100644
|
|
--- a/src/main/java/net/minecraft/world/level/World.java
|
|
+++ b/src/main/java/net/minecraft/world/level/World.java
|
|
@@ -18,6 +18,7 @@ import java.util.function.Consumer;
|
|
import java.util.function.Predicate;
|
|
import java.util.function.Supplier;
|
|
import javax.annotation.Nullable;
|
|
+
|
|
import net.minecraft.CrashReport;
|
|
import net.minecraft.CrashReportSystemDetails;
|
|
import net.minecraft.ReportedException;
|
|
@@ -1815,6 +1816,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
|
}
|
|
|
|
public GameProfilerFiller getMethodProfiler() {
|
|
+ if (gg.airplane.AirplaneConfig.disableMethodProfiler) return net.minecraft.util.profiling.GameProfilerDisabled.a; // Airplane
|
|
return (GameProfilerFiller) this.methodProfiler.get();
|
|
}
|
|
|