From f8803752b7e4cf59bbbcf33c48043e8b81201810 Mon Sep 17 00:00:00 2001 From: tr7zw 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 index 0000000000..96a2270a81 --- /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 var0) { + } + + @Override + public void exit() { + } + + @Override + public void exitEnter(String var0) { + } + + @Override + public void c(String var0) { + } + + @Override + public void c(Supplier var0) { + } + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 136602ac31..5305799002 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -80,7 +80,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 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(); @@ -944,7 +944,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant