diff --git a/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java b/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java index a9a1e869..e7942a4c 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java +++ b/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java @@ -234,6 +234,7 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI { deleteAllInstances(); HandlerList.unregisterAll(this); getServer().getScheduler().cancelTasks(this); + DPermission.unregister(); loaded = false; } diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DPermission.java b/core/src/main/java/de/erethon/dungeonsxl/player/DPermission.java index 8fe795d5..e44b3184 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DPermission.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DPermission.java @@ -213,4 +213,13 @@ public enum DPermission { } } + /** + * Unregisters the permissions. + */ + public static void unregister() { + for (DPermission permission : values()) { + Bukkit.getPluginManager().removePermission(permission.getNode()); + } + } + }