craftbukkit/nms-patches/net/minecraft/server/players/JsonList.patch

66 lines
2.3 KiB
Diff
Raw Normal View History

2021-03-16 09:00:00 +11:00
--- a/net/minecraft/server/players/JsonList.java
+++ b/net/minecraft/server/players/JsonList.java
2021-06-11 15:00:00 +10:00
@@ -54,7 +54,7 @@
2018-07-15 10:00:00 +10:00
@Nullable
2015-02-26 22:41:06 +00:00
public V get(K k0) {
2020-06-25 10:00:00 +10:00
this.g();
2021-06-11 15:00:00 +10:00
- return (JsonListEntry) this.map.get(this.a(k0));
+ return (V) this.map.get(this.a(k0)); // CraftBukkit - fix decompile error
2015-02-26 22:41:06 +00:00
}
public void remove(K k0) {
2021-06-11 15:00:00 +10:00
@@ -76,6 +76,12 @@
return (String[]) this.map.keySet().toArray(new String[0]);
}
2015-02-26 22:41:06 +00:00
+ // CraftBukkit start
2015-02-26 22:41:06 +00:00
+ public Collection<V> getValues() {
2021-06-11 15:00:00 +10:00
+ return this.map.values();
+ }
+ // CraftBukkit end
2015-02-26 22:41:06 +00:00
+
public boolean isEmpty() {
2021-06-11 15:00:00 +10:00
return this.map.size() < 1;
}
2021-06-11 15:00:00 +10:00
@@ -93,7 +99,7 @@
Iterator iterator = this.map.values().iterator();
2018-12-26 08:00:00 +11:00
2018-07-15 10:00:00 +10:00
while (iterator.hasNext()) {
2018-12-26 08:00:00 +11:00
- V v0 = (JsonListEntry) iterator.next();
+ V v0 = (V) iterator.next(); // CraftBukkit - decompile error
if (v0.hasExpired()) {
list.add(v0.getKey());
2021-06-11 15:00:00 +10:00
@@ -103,7 +109,7 @@
2018-12-26 08:00:00 +11:00
iterator = list.iterator();
2018-07-15 10:00:00 +10:00
2018-12-26 08:00:00 +11:00
while (iterator.hasNext()) {
- K k0 = iterator.next();
+ K k0 = (K) iterator.next(); // CraftBukkit - decompile error
2021-06-11 15:00:00 +10:00
this.map.remove(this.a(k0));
2018-07-15 10:00:00 +10:00
}
2021-06-11 15:00:00 +10:00
@@ -118,11 +124,11 @@
public void save() throws IOException {
JsonArray jsonarray = new JsonArray();
- Stream stream = this.map.values().stream().map((jsonlistentry) -> {
+ Stream<JsonObject> stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error
2020-06-25 10:00:00 +10:00
JsonObject jsonobject = new JsonObject();
2021-06-11 15:00:00 +10:00
Objects.requireNonNull(jsonlistentry);
2020-06-25 10:00:00 +10:00
- return (JsonObject) SystemUtils.a((Object) jsonobject, jsonlistentry::a);
+ return (JsonObject) SystemUtils.a(jsonobject, jsonlistentry::a); // CraftBukkit - decompile error
2021-06-11 15:00:00 +10:00
});
Objects.requireNonNull(jsonarray);
2021-03-16 09:00:00 +11:00
@@ -165,7 +171,7 @@
2020-06-25 10:00:00 +10:00
JsonListEntry<K> jsonlistentry = this.a(jsonobject);
if (jsonlistentry.getKey() != null) {
2021-06-11 15:00:00 +10:00
- this.map.put(this.a(jsonlistentry.getKey()), jsonlistentry);
+ this.map.put(this.a(jsonlistentry.getKey()), (V) jsonlistentry); // CraftBukkit - fix decompile error
2017-05-19 21:00:13 +10:00
}
2015-02-26 22:41:06 +00:00
}
2021-06-11 15:00:00 +10:00
} catch (Throwable throwable) {