3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00
Paper/nms-patches/JsonList.patch

52 Zeilen
1.8 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/JsonList.java
+++ b/net/minecraft/server/JsonList.java
2018-12-13 01:00:00 +01:00
@@ -56,7 +56,7 @@
this.c = file;
GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
- gsonbuilder.registerTypeHierarchyAdapter(JsonListEntry.class, new JsonList.JsonListEntrySerializer(null));
+ gsonbuilder.registerTypeHierarchyAdapter(JsonListEntry.class, new JsonList.JsonListEntrySerializer()); // CraftBukkit - decompile error
this.b = gsonbuilder.create();
}
2018-07-15 02:00:00 +02:00
@@ -86,7 +86,7 @@
@Nullable
2015-02-26 23:41:06 +01:00
public V get(K k0) {
this.h();
- return (JsonListEntry) this.d.get(this.a(k0));
+ return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error
}
public void remove(K k0) {
2018-07-15 02:00:00 +02:00
@@ -108,6 +108,12 @@
return (String[]) this.d.keySet().toArray(new String[this.d.size()]);
}
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2015-02-26 23:41:06 +01:00
+ public Collection<V> getValues() {
+ return this.d.values();
+ }
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+
public boolean isEmpty() {
return this.d.size() < 1;
}
2018-07-15 02:00:00 +02:00
@@ -137,7 +143,7 @@
while (iterator.hasNext()) {
Object object = iterator.next();
- this.d.remove(this.a(object));
+ this.d.remove(this.a((K) object)); // CraftBukkit - decompile error
}
}
@@ -180,7 +186,7 @@
JsonListEntry jsonlistentry = (JsonListEntry) iterator.next();
2018-07-15 02:00:00 +02:00
if (jsonlistentry.getKey() != null) {
- this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry);
+ this.d.put(this.a((K) jsonlistentry.getKey()), (V) jsonlistentry); // CraftBukkit - fix decompile error
}
2017-05-19 13:00:13 +02:00
}
2015-02-26 23:41:06 +01:00
}