PaperMC/nms-patches/JsonList.patch

61 lines
1.9 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/JsonList.java
+++ b/net/minecraft/server/JsonList.java
2018-12-25 22:00:00 +01:00
@@ -85,7 +85,7 @@
2018-07-15 02:00:00 +02:00
@Nullable
2015-02-26 23:41:06 +01:00
public V get(K k0) {
this.h();
- return (JsonListEntry) this.d.get(this.a(k0));
+ return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error
}
public void remove(K k0) {
2018-12-25 22:00:00 +01:00
@@ -107,6 +107,12 @@
return (String[]) this.d.keySet().toArray(new String[this.d.size()]);
}
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2015-02-26 23:41:06 +01:00
+ public Collection<V> getValues() {
+ return this.d.values();
+ }
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+
public boolean isEmpty() {
return this.d.size() < 1;
}
2018-12-25 22:00:00 +01:00
@@ -124,7 +130,7 @@
Iterator iterator = this.d.values().iterator();
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()) {
list.add(v0.getKey());
@@ -134,7 +140,7 @@
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
this.d.remove(this.a(k0));
2018-07-15 02:00:00 +02:00
}
2018-12-25 22:00:00 +01:00
@@ -142,7 +148,7 @@
}
2018-07-15 02:00:00 +02:00
2018-12-25 22:00:00 +01:00
protected JsonListEntry<K> a(JsonObject jsonobject) {
- return new JsonListEntry<>((Object) null, jsonobject);
+ return new JsonListEntry<>((K) null, jsonobject); // CraftBukkit - decompile error
2018-07-15 02:00:00 +02:00
}
2018-12-25 22:00:00 +01:00
public Collection<V> e() {
@@ -179,7 +185,7 @@
JsonListEntry<K> jsonlistentry = (JsonListEntry) iterator.next();
2018-07-15 02:00:00 +02:00
if (jsonlistentry.getKey() != null) {
- this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry);
+ this.d.put(this.a((K) jsonlistentry.getKey()), (V) jsonlistentry); // CraftBukkit - fix decompile error
}
2017-05-19 13:00:13 +02:00
}
2015-02-26 23:41:06 +01:00
}