mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-08 00:21:50 +01:00
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:
parent
2942a2d247
commit
f2a3a8db27
@ -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");
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user