PaperMC/paper-server/nms-patches/net/minecraft/server/players/JsonList.patch
CraftBukkit/Spigot 9da047989c Repackage NMS
By: md_5 <git@md-5.net>
2021-03-16 09:00:00 +11:00

60 lines
2.1 KiB
Diff

--- a/net/minecraft/server/players/JsonList.java
+++ b/net/minecraft/server/players/JsonList.java
@@ -52,7 +52,7 @@
@Nullable
public V get(K k0) {
this.g();
- 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) {
@@ -74,6 +74,12 @@
return (String[]) this.d.keySet().toArray(new String[this.d.size()]);
}
+ // CraftBukkit start
+ public Collection<V> getValues() {
+ return this.d.values();
+ }
+ // CraftBukkit end
+
public boolean isEmpty() {
return this.d.size() < 1;
}
@@ -91,7 +97,7 @@
Iterator iterator = this.d.values().iterator();
while (iterator.hasNext()) {
- V v0 = (JsonListEntry) iterator.next();
+ V v0 = (V) iterator.next(); // CraftBukkit - decompile error
if (v0.hasExpired()) {
list.add(v0.getKey());
@@ -101,7 +107,7 @@
iterator = list.iterator();
while (iterator.hasNext()) {
- K k0 = iterator.next();
+ K k0 = (K) iterator.next(); // CraftBukkit - decompile error
this.d.remove(this.a(k0));
}
@@ -121,7 +127,7 @@
JsonObject jsonobject = new JsonObject();
jsonlistentry.getClass();
- return (JsonObject) SystemUtils.a((Object) jsonobject, jsonlistentry::a);
+ return (JsonObject) SystemUtils.a(jsonobject, jsonlistentry::a); // CraftBukkit - decompile error
}).forEach(jsonarray::add);
BufferedWriter bufferedwriter = Files.newWriter(this.c, StandardCharsets.UTF_8);
Throwable throwable = null;
@@ -165,7 +171,7 @@
JsonListEntry<K> jsonlistentry = this.a(jsonobject);
if (jsonlistentry.getKey() != null) {
- this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry);
+ this.d.put(this.a(jsonlistentry.getKey()), (V) jsonlistentry); // CraftBukkit - fix decompile error
}
}
} catch (Throwable throwable1) {