[Bleeding] Removing the last metadata item for a key now sets hasMetadata(key) to false. Addresses BUKKIT-1380

By: rmichela <deltahat@gmail.com>
This commit is contained in:
Bukkit/Spigot
2012-03-28 01:41:33 -04:00
parent 853f14f0dc
commit cc95e9f5ef
2 changed files with 12 additions and 0 deletions

View File

@@ -86,6 +86,9 @@ public abstract class MetadataStoreBase<T> {
for (int i = 0; i < metadataList.size(); i++) {
if (metadataList.get(i).getOwningPlugin().equals(owningPlugin)) {
metadataList.remove(i);
if (metadataList.isEmpty()) {
metadataMap.remove(key);
}
}
}
}