Make the plugin work again

This commit is contained in:
Telesphoreo 2022-03-25 16:38:46 -05:00
parent 492250caca
commit a0eb111adc
2 changed files with 6 additions and 24 deletions

View file

@ -71,9 +71,9 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>me.totalfreedom</groupId> <groupId>me.telesphoreo</groupId>
<artifactId>TotalFreedomMod</artifactId> <artifactId>DummyTFM</artifactId>
<version>7.1.0</version> <version>1.1.a</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -1,31 +1,13 @@
package net.goldtreeservers.worldguardextraflags.wg; package net.goldtreeservers.worldguardextraflags.wg;
import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.admin.AdminList;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
public class TFMHandler public class TFMHandler
{ {
private static TotalFreedomMod totalFreedomMod = null; private static final AdminList al = new AdminList();
public static TotalFreedomMod getTFM()
{
if (totalFreedomMod != null)
{
return totalFreedomMod;
}
Plugin plugin = Bukkit.getPluginManager().getPlugin("TotalFreedomMod");
if (plugin != null && plugin.isEnabled())
{
totalFreedomMod = (TotalFreedomMod)plugin;
return totalFreedomMod;
}
return null;
}
public static boolean isAdmin(String name) public static boolean isAdmin(String name)
{ {
return getTFM().adminList.getEntryByName(name) != null; return al.getEntryByName(name) != null;
} }
} }