2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/server/players/JsonList.java
|
|
|
|
+++ b/net/minecraft/server/players/JsonList.java
|
2024-02-22 09:55:53 +01:00
|
|
|
@@ -54,7 +54,7 @@
|
2018-07-15 02:00:00 +02:00
|
|
|
@Nullable
|
2015-02-26 23:41:06 +01:00
|
|
|
public V get(K k0) {
|
2021-11-21 23:00:00 +01:00
|
|
|
this.removeExpired();
|
|
|
|
- return (JsonListEntry) this.map.get(this.getKeyForUser(k0));
|
|
|
|
+ return (V) this.map.get(this.getKeyForUser(k0)); // CraftBukkit - fix decompile error
|
2015-02-26 23:41:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void remove(K k0) {
|
2024-02-22 09:55:53 +01:00
|
|
|
@@ -85,6 +85,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));
|
|
|
|
}
|
|
|
|
|
2023-06-24 09:15:05 +02:00
|
|
|
@@ -93,7 +94,7 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
Iterator iterator = this.map.values().iterator();
|
2018-12-25 22:00:00 +01:00
|
|
|
|
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()) {
|
2021-11-21 23:00:00 +01:00
|
|
|
list.add(v0.getUser());
|
2023-06-24 09:15:05 +02:00
|
|
|
@@ -103,7 +104,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
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
this.map.remove(this.getKeyForUser(k0));
|
2018-07-15 02:00:00 +02:00
|
|
|
}
|
2023-06-24 09:15:05 +02:00
|
|
|
@@ -118,7 +119,7 @@
|
2021-06-11 07:00:00 +02: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 02:00:00 +02:00
|
|
|
JsonObject jsonobject = new JsonObject();
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
Objects.requireNonNull(jsonlistentry);
|
2023-09-21 18:40:00 +02:00
|
|
|
@@ -171,7 +172,7 @@
|
|
|
|
JsonListEntry<K> jsonlistentry = this.createEntry(jsonobject);
|
2020-06-25 02:00:00 +02:00
|
|
|
|
2023-09-21 18:40:00 +02: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 13:00:13 +02:00
|
|
|
}
|
2023-09-21 18:40:00 +02:00
|
|
|
} catch (Throwable throwable) {
|