mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 02:25:51 +01:00
remove 0022-Add-JsonList-save-timings.patch (#400)
This commit is contained in:
parent
dede8ef2f5
commit
d11f37a964
@ -20,7 +20,6 @@ # Patches
|
||||
| server | Add GameProfileLookupEvent | tr7zw | |
|
||||
| api | Add GameProfileLookupEvent | tr7zw | |
|
||||
| server | Add IntelliJ IDEA runnable | Zoe | |
|
||||
| server | Add JsonList save timings | Ivan Pekov | |
|
||||
| server | Add NBT API as a first-class lib | tr7zw | |
|
||||
| api | Add NBT API as a first-class lib | tr7zw | |
|
||||
| server | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm |
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Pekov <ivan@mrivanplays.com>
|
||||
Date: Fri, 2 Oct 2020 17:48:01 +0300
|
||||
Subject: [PATCH] Add JsonList save timings
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
index 68ab5ccb2fcfe1de0503c9336572f28e11832b2d..d8c1a8dd867437443494ac169569139e25c9a635 100644
|
||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -149,4 +149,6 @@ public final class MinecraftTimings {
|
||||
public static Timing getCommandFunctionTiming(CustomFunction function) {
|
||||
return Timings.ofSafe("Command Function - " + function.getMinecraftKey().toString());
|
||||
}
|
||||
+
|
||||
+ public static Timing getJsonListTiming(String className) { return Timings.ofSafe("Save JsonList ( " + className + " )"); } // Yatopia
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index 1fc0139cb9694ddea41f57d95774c3b47e8530c5..a674140b61547841a1a6060e9f36aa14d0a86ff9 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -44,9 +44,11 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
+ private final co.aikar.timings.Timing saveTiming; // Yatopia
|
||||
|
||||
public JsonList(File file) {
|
||||
this.c = file;
|
||||
+ saveTiming = co.aikar.timings.MinecraftTimings.getJsonListTiming(getClass().getSimpleName()); // Yatopia
|
||||
}
|
||||
|
||||
public File b() {
|
||||
@@ -146,6 +148,9 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
+ // Yatopia start
|
||||
+ saveTiming.startTiming();
|
||||
+ try { // Yatopia end
|
||||
this.removeStaleEntries(); // Paper - remove expired values before saving
|
||||
JsonArray jsonarray = new JsonArray();
|
||||
|
||||
@@ -177,6 +182,9 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
}
|
||||
|
||||
}
|
||||
+ } finally { // Yatopia start
|
||||
+ saveTiming.stopTiming();
|
||||
+ } // Yatopia end
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add timings for Pathfinder
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
index d8c1a8dd867437443494ac169569139e25c9a635..0efdddc12247ed4aa6acce118c707090270bee39 100644
|
||||
index 68ab5ccb2fcfe1de0503c9336572f28e11832b2d..4d4c25cb328b0ca2e16d3c823214aca5854e4deb 100644
|
||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -54,6 +54,8 @@ public final class MinecraftTimings {
|
@ -14,10 +14,10 @@ Our changes are the following:
|
||||
triggers removing of all stale entries.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index a674140b61547841a1a6060e9f36aa14d0a86ff9..99580abac1ff30c784b6792d69c9d4cad12c1b1f 100644
|
||||
index 1fc0139cb9694ddea41f57d95774c3b47e8530c5..d683e3e509cc21d007d3e32f68235cfad007d0d0 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -71,9 +71,13 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
@@ -69,9 +69,13 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
// Paper start
|
||||
// this.g();
|
||||
// return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error
|
||||
@ -31,7 +31,7 @@ index a674140b61547841a1a6060e9f36aa14d0a86ff9..99580abac1ff30c784b6792d69c9d4ca
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -154,12 +158,22 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
@@ -149,12 +153,22 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
this.removeStaleEntries(); // Paper - remove expired values before saving
|
||||
JsonArray jsonarray = new JsonArray();
|
||||
|
@ -139,10 +139,10 @@ index 81f7d5bc581b42289a79121da15868999ab9feef..7ee038e24cf696b7a32c5c67d4b0dd46
|
||||
public float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
switch (entitypose) {
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index 99580abac1ff30c784b6792d69c9d4cad12c1b1f..1daeb9571663a128a749c735a70f6e92603ffeda 100644
|
||||
index d683e3e509cc21d007d3e32f68235cfad007d0d0..83109fb0ad57eef2b24b5c3cb5875535e0a8e67f 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -66,6 +66,20 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
@@ -64,6 +64,20 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ index 99580abac1ff30c784b6792d69c9d4cad12c1b1f..1daeb9571663a128a749c735a70f6e92
|
||||
@Nullable
|
||||
public V get(K k0) {
|
||||
// Paper start
|
||||
@@ -96,6 +110,20 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
@@ -94,6 +108,20 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
this.remove(jsonlistentry.getKey());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user