From 5aa69152c643baa672178123dd4d2f36ca94e550 Mon Sep 17 00:00:00 2001 From: Wolfieheart Date: Sat, 10 Sep 2022 11:43:21 +0200 Subject: [PATCH] [CORE] Hotfix - Protections not detecting Plugins Enabled Correctly. Closes #120 Signed-off-by: Wolfieheart --- .../armorstandeditor/protections/GriefDefenderProtection.java | 1 + .../rypofalem/armorstandeditor/protections/LandsProtection.java | 2 ++ .../armorstandeditor/protections/SkyblockProtection.java | 1 + .../rypofalem/armorstandeditor/protections/TownyProtection.java | 1 + .../armorstandeditor/protections/WorldGuardProtection.java | 1 + 5 files changed, 6 insertions(+) diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/protections/GriefDefenderProtection.java b/src/main/java/io/github/rypofalem/armorstandeditor/protections/GriefDefenderProtection.java index 18221a7c..60ac7919 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/protections/GriefDefenderProtection.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/protections/GriefDefenderProtection.java @@ -18,6 +18,7 @@ public class GriefDefenderProtection implements Protection { public GriefDefenderProtection() { gdEnabled = Bukkit.getPluginManager().isPluginEnabled("GriefDefender"); + if(!gdEnabled) return; } public boolean checkPermission(Block block, Player player) { diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/protections/LandsProtection.java b/src/main/java/io/github/rypofalem/armorstandeditor/protections/LandsProtection.java index aac12c11..c55ecec5 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/protections/LandsProtection.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/protections/LandsProtection.java @@ -18,6 +18,8 @@ public LandsProtection() { if (landsEnabled) lands = new LandsIntegration(ArmorStandEditorPlugin.instance()); + else + return; } @Override diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/protections/SkyblockProtection.java b/src/main/java/io/github/rypofalem/armorstandeditor/protections/SkyblockProtection.java index 7dd5a0f0..b1a41d65 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/protections/SkyblockProtection.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/protections/SkyblockProtection.java @@ -15,6 +15,7 @@ public SkyblockProtection(){ //IF YOU WANT YOUR SKYBLOCK ADDED, PLEASE SUBMIT A FEATURE REQUEST! skyblockEnabled = Bukkit.getPluginManager().isPluginEnabled("SuperiorSkyblock2"); + if(!skyblockEnabled) return; } public boolean checkPermission(Block block, Player player) { diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/protections/TownyProtection.java b/src/main/java/io/github/rypofalem/armorstandeditor/protections/TownyProtection.java index 04f1c511..9c5a1da0 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/protections/TownyProtection.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/protections/TownyProtection.java @@ -16,6 +16,7 @@ public class TownyProtection implements Protection { public TownyProtection(){ tEnabled = Bukkit.getPluginManager().isPluginEnabled("Towny"); + if(!tEnabled) return; } public boolean checkPermission(Block block, Player player){ diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/protections/WorldGuardProtection.java b/src/main/java/io/github/rypofalem/armorstandeditor/protections/WorldGuardProtection.java index 25cc4941..5d172cbf 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/protections/WorldGuardProtection.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/protections/WorldGuardProtection.java @@ -38,6 +38,7 @@ public class WorldGuardProtection implements Protection { public WorldGuardProtection(){ wgEnabled = Bukkit.getPluginManager().isPluginEnabled("WorldGuard"); + if(!wgEnabled) return; RegionContainer regionContainer = WorldGuard.getInstance().getPlatform().getRegionContainer(); regionQry = regionContainer.createQuery();