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>
</dependency>
<dependency>
<groupId>me.totalfreedom</groupId>
<artifactId>TotalFreedomMod</artifactId>
<version>7.1.0</version>
<groupId>me.telesphoreo</groupId>
<artifactId>DummyTFM</artifactId>
<version>1.1.a</version>
<scope>provided</scope>
</dependency>
</dependencies>

View file

@ -1,31 +1,13 @@
package net.goldtreeservers.worldguardextraflags.wg;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import me.totalfreedom.totalfreedommod.admin.AdminList;
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 = (TotalFreedomMod)plugin;
return totalFreedomMod;
}
return null;
}
private static final AdminList al = new AdminList();
public static boolean isAdmin(String name)
{
return getTFM().adminList.getEntryByName(name) != null;
return al.getEntryByName(name) != null;
}
}