diff --git a/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/TFMHandler.java b/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/TFMHandler.java new file mode 100644 index 0000000..17b81a2 --- /dev/null +++ b/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/TFMHandler.java @@ -0,0 +1,33 @@ +package net.goldtreeservers.worldguardextraflags.wg; + +import me.totalfreedom.totalfreedommod.TotalFreedomMod; +import org.bukkit.Bukkit; +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.Plugin; + +public class TFMHandler +{ + private static TotalFreedomMod totalFreedomMod = null; + + public static TotalFreedomMod getTFM() + { + if (totalFreedomMod != null) + { + return totalFreedomMod; + } + Plugin plugin = Bukkit.getPluginManager().getPlugin("TotalFreedomMod"); + if (plugin != null && plugin.isEnabled()) + { + TotalFreedomMod tfm = (TotalFreedomMod)plugin; + totalFreedomMod = tfm; + return totalFreedomMod; + } + + return null; + } + + public static boolean isStaff(CommandSender sender) + { + return getTFM().sl.isStaff(sender); + } +} \ No newline at end of file diff --git a/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java b/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java index 47e1451..da99f6e 100644 --- a/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java +++ b/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java @@ -45,7 +45,7 @@ public class WorldGuardUtils } // Fuck your shitty permission system - packs - return TotalFreedomMod.plugin().sl.isStaff(player); + return TFMHandler.isStaff(player); } public static State queryState(Player player, World world, Set regions, StateFlag flag)