13
0
geforkt von Mirrors/Paper

Fix SafeNBTCopy#hasKey semantics

Fixes hasKey to check that a key actually exists, while retaining the
option to scream at keys which are requested which haven't been marked as
needing to be copied
Dieser Commit ist enthalten in:
Shane Freeder 2020-10-17 12:46:35 +01:00
Ursprung 2942a2d247
Commit f2a3a8db27

Datei anzeigen

@ -61,8 +61,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public boolean hasKey(String s) {
+ if (this.keys.contains(s)) {
+ if (super.hasKey(s)) {
+ return true;
+ } else if (keys.contains(s)) {
+ return false;
+ }
+ throw new IllegalStateException("Missing Key " + s + " in SafeNBTCopy");
+ }