Create 0044-Kill-the-vanilla-GameProfiler.patch

This commit is contained in:
tr7zw 2020-03-05 23:08:47 +01:00
parent 2062c5e74c
commit aa6b9d6a8d

View File

@ -0,0 +1,93 @@
From ead0f031e6ffc43a68ed0842ef4896bde0fd13ec 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
index 000000000..96a2270a8
--- /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
index d5efea027..692c0cac9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -82,7 +82,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();
@@ -935,7 +935,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