mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-12-22 16:05:00 +00:00
ok
This commit is contained in:
parent
2e16d257e5
commit
338fd7b40e
3 changed files with 51 additions and 0 deletions
5
pom.xml
5
pom.xml
|
@ -78,5 +78,10 @@
|
||||||
<version>1.18.12</version>
|
<version>1.18.12</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.totalfreedom</groupId>
|
||||||
|
<artifactId>totalfreedom</artifactId>
|
||||||
|
<version>5.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package totalfreedom.tfguilds;
|
package totalfreedom.tfguilds;
|
||||||
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import totalfreedom.tfguilds.bridge.TFMBridge;
|
||||||
import totalfreedom.tfguilds.command.CreateGuildCommand;
|
import totalfreedom.tfguilds.command.CreateGuildCommand;
|
||||||
import totalfreedom.tfguilds.command.TfGuildsCommand;
|
import totalfreedom.tfguilds.command.TfGuildsCommand;
|
||||||
import totalfreedom.tfguilds.config.Config;
|
import totalfreedom.tfguilds.config.Config;
|
||||||
|
@ -11,6 +12,7 @@ public final class TFGuilds extends JavaPlugin
|
||||||
public static TFGuilds plugin;
|
public static TFGuilds plugin;
|
||||||
public Config config;
|
public Config config;
|
||||||
public Config guilds;
|
public Config guilds;
|
||||||
|
public TFMBridge tfmb;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable()
|
public void onEnable()
|
||||||
|
@ -19,6 +21,7 @@ public final class TFGuilds extends JavaPlugin
|
||||||
enableCommands();
|
enableCommands();
|
||||||
config = new Config(plugin, "config.yml");
|
config = new Config(plugin, "config.yml");
|
||||||
guilds = new Config(plugin, "guilds.yml");
|
guilds = new Config(plugin, "guilds.yml");
|
||||||
|
tfmb = new TFMBridge();
|
||||||
GLog.info("Enabled");
|
GLog.info("Enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
43
src/main/java/totalfreedom/tfguilds/bridge/TFMBridge.java
Normal file
43
src/main/java/totalfreedom/tfguilds/bridge/TFMBridge.java
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
package totalfreedom.tfguilds.bridge;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import totalfreedom.tfguilds.TFGuilds;
|
||||||
|
|
||||||
|
public class TFMBridge
|
||||||
|
{
|
||||||
|
private TFGuilds plugin;
|
||||||
|
private TotalFreedomMod tfmPlugin;
|
||||||
|
|
||||||
|
public TFMBridge()
|
||||||
|
{
|
||||||
|
this.plugin = TFGuilds.plugin;
|
||||||
|
this.tfmPlugin = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TotalFreedomMod getTFM()
|
||||||
|
{
|
||||||
|
if (tfmPlugin == null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
final Plugin tfm = plugin.getServer().getPluginManager().getPlugin("TotalFreedomMod");
|
||||||
|
if (tfm != null && tfm instanceof TotalFreedomMod)
|
||||||
|
{
|
||||||
|
tfmPlugin = (TotalFreedomMod) tfm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tfmPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAdmin(Player player)
|
||||||
|
{
|
||||||
|
return tfmPlugin.al.isAdmin(player);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue