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
This commit is contained in:
@@ -61,8 +61,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean hasKey(String s) {
|
+ public boolean hasKey(String s) {
|
||||||
+ if (this.keys.contains(s)) {
|
+ if (super.hasKey(s)) {
|
||||||
+ return true;
|
+ return true;
|
||||||
|
+ } else if (keys.contains(s)) {
|
||||||
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ throw new IllegalStateException("Missing Key " + s + " in SafeNBTCopy");
|
+ throw new IllegalStateException("Missing Key " + s + " in SafeNBTCopy");
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
Reference in New Issue
Block a user