Minor refactor - use containsKey method.

This commit is contained in:
tastybento 2023-07-08 08:39:56 -07:00
parent 39a6fc5006
commit 9a464ab795

View File

@ -188,7 +188,7 @@ public class AddonsManager {
}
private PladdonData loadPladdon(YamlConfiguration data, @NonNull File f) throws InvalidAddonInheritException, MalformedURLException, InvalidAddonDescriptionException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InvalidDescriptionException {
Addon addon = null;
Addon addon;
try {
Plugin pladdon = Bukkit.getPluginManager().loadPlugin(f);
if (pladdon instanceof Pladdon pl) {
@ -451,7 +451,7 @@ public class AddonsManager {
if (!getEnabledAddons().isEmpty()) {
plugin.log("Disabling addons...");
// Disable addons - pladdons are disabled by the server
getEnabledAddons().stream().filter(addon -> !pladdons.keySet().contains(addon)).forEach(this::disable);
getEnabledAddons().stream().filter(addon -> !pladdons.containsKey(addon)).forEach(this::disable);
plugin.log("Addons successfully disabled.");
}
// Unregister all commands