PaperMC/paper-server/nms-patches/net/minecraft/server/players/JsonList.patch
CraftBukkit/Spigot 43702a9e10 Update to Minecraft 1.18-pre5
By: md_5 <git@md-5.net>
2021-11-22 09:00:00 +11:00

60 lines
2.2 KiB
Diff

--- a/net/minecraft/server/players/JsonList.java
+++ b/net/minecraft/server/players/JsonList.java
@@ -54,7 +54,7 @@
@Nullable
public V get(K k0) {
this.removeExpired();
- return (JsonListEntry) this.map.get(this.getKeyForUser(k0));
+ return (V) this.map.get(this.getKeyForUser(k0)); // CraftBukkit - fix decompile error
}
public void remove(K k0) {
@@ -76,6 +76,12 @@
return (String[]) this.map.keySet().toArray(new String[0]);
}
+ // CraftBukkit start
+ public Collection<V> getValues() {
+ return this.map.values();
+ }
+ // CraftBukkit end
+
public boolean isEmpty() {
return this.map.size() < 1;
}
@@ -93,7 +99,7 @@
Iterator iterator = this.map.values().iterator();
while (iterator.hasNext()) {
- V v0 = (JsonListEntry) iterator.next();
+ V v0 = (V) iterator.next(); // CraftBukkit - decompile error
if (v0.hasExpired()) {
list.add(v0.getUser());
@@ -103,7 +109,7 @@
iterator = list.iterator();
while (iterator.hasNext()) {
- K k0 = iterator.next();
+ K k0 = (K) iterator.next(); // CraftBukkit - decompile error
this.map.remove(this.getKeyForUser(k0));
}
@@ -118,7 +124,7 @@
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
JsonObject jsonobject = new JsonObject();
Objects.requireNonNull(jsonlistentry);
@@ -165,7 +171,7 @@
JsonListEntry<K> jsonlistentry = this.createEntry(jsonobject);
if (jsonlistentry.getUser() != null) {
- this.map.put(this.getKeyForUser(jsonlistentry.getUser()), jsonlistentry);
+ this.map.put(this.getKeyForUser(jsonlistentry.getUser()), (V) jsonlistentry); // CraftBukkit - decompile error
}
}
} catch (Throwable throwable) {