From f2a3a8db27c6635cecf2d432c13419371a7daff1 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 17 Oct 2020 12:46:35 +0100 Subject: [PATCH] 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 --- .../Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch b/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch index 04bf5ad90..a2f5cd9bf 100644 --- a/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch +++ b/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch @@ -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"); + }