Yatopia/patches/server/0043-Kill-the-vanilla-GameProfiler.patch

94 lines
2.8 KiB
Diff
Raw Normal View History

2020-03-21 17:29:35 +01:00
From 9ae232d05c7db4372c14cd33c9ef11e29770c731 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Thu, 5 Mar 2020 23:08:01 +0100
Subject: [PATCH] Kill the vanilla "GameProfiler"
---
.../de/tr7zw/yapfa/GameProfilerDisabled.java | 51 +++++++++++++++++++
.../net/minecraft/server/MinecraftServer.java | 4 +-
2 files changed, 53 insertions(+), 2 deletions(-)
create mode 100644 src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java
diff --git a/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java b/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java
new file mode 100644
2020-03-21 17:29:35 +01:00
index 00000000..96a2270a
--- /dev/null
+++ b/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java
@@ -0,0 +1,51 @@
+package de.tr7zw.yapfa;
+
+import java.util.function.IntSupplier;
+import java.util.function.Supplier;
+
+import net.minecraft.server.GameProfiler;
+
+public class GameProfilerDisabled extends GameProfiler{
+
+ public GameProfilerDisabled(IntSupplier var0) {
+ super(var0);
+ }
+
+ @Override
+ public net.minecraft.server.GameProfiler.a d() {
+ return super.d();
+ }
+
+ @Override
+ public void a() {
+ }
+
+ @Override
+ public void b() {
+ }
+
+ @Override
+ public void enter(String var0) {
+ }
+
+ @Override
+ public void a(Supplier<String> var0) {
+ }
+
+ @Override
+ public void exit() {
+ }
+
+ @Override
+ public void exitEnter(String var0) {
+ }
+
+ @Override
+ public void c(String var0) {
+ }
+
+ @Override
+ public void c(Supplier<String> var0) {
+ }
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
2020-03-21 17:29:35 +01:00
index 0276abe1..e803c968 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
2020-03-21 17:29:35 +01:00
@@ -80,7 +80,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
private final MojangStatisticsGenerator snooper = new MojangStatisticsGenerator("server", this, SystemUtils.getMonotonicMillis());
public File universe;
private final List<Runnable> tickables = Lists.newArrayList();
- private final GameProfiler methodProfiler = new GameProfiler(this::ak);
+ private final GameProfiler methodProfiler = new de.tr7zw.yapfa.GameProfilerDisabled(this::ak); // YAPFA
private ServerConnection serverConnection;
public final WorldLoadListenerFactory worldLoadListenerFactory;
private final ServerPing serverPing = new ServerPing();
2020-03-21 17:29:35 +01:00
@@ -932,7 +932,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.nextTick += 50L;
if (this.T) {
this.T = false;
- this.methodProfiler.d().d();
+ //this.methodProfiler.d().d(); // YAPFA
}
--
2.25.1.windows.1