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

47 lines
1.7 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
2025-03-26 03:05:00 +11:00
@@ -40,7 +40,7 @@
2015-02-26 22:41:06 +00:00
}
2025-03-26 03:05:00 +11:00
public void add(V v0) {
- this.map.put(this.getKeyForUser(((JsonListEntry) v0).getUser()), v0);
+ this.map.put(this.getKeyForUser((v0).getUser()), v0); // CraftBukkit - decompile error
try {
this.save();
@@ -84,6 +84,7 @@
}
protected boolean contains(K k0) {
+ this.removeExpired(); // CraftBukkit - SPIGOT-7589: Consistently remove expired entries to mirror .get(...)
return this.map.containsKey(this.getKeyForUser(k0));
}
2025-03-26 03:05:00 +11:00
@@ -92,7 +93,7 @@
2018-12-26 08:00:00 +11:00
2025-03-26 03:05:00 +11:00
for (V v0 : this.map.values()) {
2018-12-26 08:00:00 +11:00
if (v0.hasExpired()) {
2025-03-26 03:05:00 +11:00
- list.add(((JsonListEntry) v0).getUser());
+ list.add((v0).getUser()); // CraftBukkit - decompile error
}
2018-07-15 10:00:00 +10:00
}
2025-03-26 03:05:00 +11:00
@@ -110,7 +111,7 @@
2021-06-11 15:00:00 +10:00
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);
2025-03-26 03:05:00 +11:00
@@ -141,7 +142,7 @@
JsonListEntry<K> jsonlistentry = this.createEntry(jsonobject);
2020-06-25 10:00:00 +10:00
2025-03-26 03:05:00 +11:00
if (jsonlistentry.getUser() != null) {
- this.map.put(this.getKeyForUser(jsonlistentry.getUser()), jsonlistentry);
+ this.map.put(this.getKeyForUser(jsonlistentry.getUser()), (V) jsonlistentry); // CraftBukkit - decompile error
2017-05-19 21:00:13 +10:00
}
2025-03-26 03:05:00 +11:00
}
}