PaperMC/nms-patches/JsonList.patch

61 lines
2.1 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/JsonList.java
+++ b/net/minecraft/server/JsonList.java
2020-06-25 02:00:00 +02:00
@@ -50,7 +50,7 @@
2018-07-15 02:00:00 +02:00
@Nullable
2015-02-26 23:41:06 +01:00
public V get(K k0) {
2020-06-25 02:00:00 +02:00
this.g();
2015-02-26 23:41:06 +01:00
- 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) {
2020-06-25 02:00:00 +02:00
@@ -72,6 +72,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;
}
2020-06-25 02:00:00 +02:00
@@ -89,7 +95,7 @@
2018-12-25 22:00:00 +01:00
Iterator iterator = this.d.values().iterator();
2018-07-15 02:00:00 +02:00
while (iterator.hasNext()) {
2018-12-25 22:00:00 +01:00
- V v0 = (JsonListEntry) iterator.next();
+ V v0 = (V) iterator.next(); // CraftBukkit - decompile error
if (v0.hasExpired()) {
list.add(v0.getKey());
2020-06-25 02:00:00 +02:00
@@ -99,7 +105,7 @@
2018-12-25 22:00:00 +01:00
iterator = list.iterator();
2018-07-15 02:00:00 +02:00
2018-12-25 22:00:00 +01:00
while (iterator.hasNext()) {
- K k0 = iterator.next();
+ K k0 = (K) iterator.next(); // CraftBukkit - decompile error
this.d.remove(this.a(k0));
2018-07-15 02:00:00 +02:00
}
2020-06-25 02:00:00 +02:00
@@ -119,7 +125,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;
@@ -163,7 +169,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
2017-05-19 13:00:13 +02:00
}
2015-02-26 23:41:06 +01:00
}
2020-06-25 02:00:00 +02:00
} catch (Throwable throwable1) {