--- a/net/minecraft/server/players/JsonList.java +++ b/net/minecraft/server/players/JsonList.java @@ -40,7 +40,7 @@ } 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)); } @@ -92,7 +93,7 @@ for (V v0 : this.map.values()) { if (v0.hasExpired()) { - list.add(((JsonListEntry) v0).getUser()); + list.add((v0).getUser()); // CraftBukkit - decompile error } } @@ -110,7 +111,7 @@ public void save() throws IOException { JsonArray jsonarray = new JsonArray(); - Stream stream = this.map.values().stream().map((jsonlistentry) -> { + Stream stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error JsonObject jsonobject = new JsonObject(); Objects.requireNonNull(jsonlistentry); @@ -141,7 +142,7 @@ JsonListEntry 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 } } }