summaryrefslogtreecommitdiffstats
path: root/nms-patches/MethodProfiler.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/MethodProfiler.patch')
-rw-r--r--nms-patches/MethodProfiler.patch19
1 files changed, 13 insertions, 6 deletions
diff --git a/nms-patches/MethodProfiler.patch b/nms-patches/MethodProfiler.patch
index 883f9d9a..b608e64a 100644
--- a/nms-patches/MethodProfiler.patch
+++ b/nms-patches/MethodProfiler.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MethodProfiler.java
+++ b/net/minecraft/server/MethodProfiler.java
-@@ -12,6 +12,7 @@
+@@ -13,6 +13,7 @@
public class MethodProfiler {
@@ -8,7 +8,7 @@
private static final Logger b = LogManager.getLogger();
private final List<String> c = Lists.newArrayList();
private final List<Long> d = Lists.newArrayList();
-@@ -22,12 +23,14 @@
+@@ -23,12 +24,14 @@
public MethodProfiler() {}
public void a() {
@@ -23,7 +23,14 @@
if (this.a) {
if (!this.e.isEmpty()) {
this.e = this.e + ".";
-@@ -40,6 +43,7 @@
+@@ -41,12 +44,14 @@
+ }
+
+ public void a(Supplier<String> supplier) {
++ if (!ENABLED) return; // CraftBukkit
+ if (this.a) {
+ this.a((String) supplier.get());
+ }
}
public void b() {
@@ -31,7 +38,7 @@
if (this.a) {
long i = System.nanoTime();
long j = ((Long) this.d.remove(this.d.size() - 1)).longValue();
-@@ -62,7 +66,7 @@
+@@ -69,7 +74,7 @@
}
public List<MethodProfiler.ProfilerInfo> b(String s) {
@@ -40,7 +47,7 @@
return Collections.emptyList();
} else {
long i = this.f.containsKey("root") ? ((Long) this.f.get("root")).longValue() : 0L;
-@@ -128,11 +132,13 @@
+@@ -135,11 +140,13 @@
}
public void c(String s) {
@@ -54,7 +61,7 @@
return this.c.isEmpty() ? "[UNKNOWN]" : (String) this.c.get(this.c.size() - 1);
}
-@@ -152,7 +158,7 @@
+@@ -159,7 +166,7 @@
return methodprofiler_profilerinfo.a < this.a ? -1 : (methodprofiler_profilerinfo.a > this.a ? 1 : methodprofiler_profilerinfo.c.compareTo(this.c));
}