mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-30 20:39:53 -05:00
Add Global Plugin Object
This commit is contained in:
1 parent
5f0c3bd075
commit
e0df683be2
5 files changed
+10
No files matched your search
@@ -20,6 +20,7 @@ public class Storage {
|
||||
|
||||
public static String TOKEN = "", SERVER_NAME = null, CURRENT_VERSION = "", NEWER_VERSION = "";
|
||||
public static boolean OUTDATED = false, SEND_CONSOLE_NOTIFICATION = true;
|
||||
public static Object PLUGIN_OBJECT;
|
||||
|
||||
public static void loadAll(boolean loadBlacklist) {
|
||||
loadConfig();
|
||||
|
||||
@@ -66,6 +66,8 @@ public class BukkitLoader extends JavaPlugin {
|
||||
registerCommand("proantitab", "pat");
|
||||
startUpdaterTask();
|
||||
|
||||
Storage.PLUGIN_OBJECT = this;
|
||||
|
||||
if(getServer().getPluginManager().getPlugin("LuckPerms") != null)
|
||||
LuckPermsAdapter.initialize();
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ public class BungeeLoader extends Plugin {
|
||||
ClientCommunication.syncData();
|
||||
}, 5, TimeUnit.SECONDS);
|
||||
|
||||
Storage.PLUGIN_OBJECT = this;
|
||||
|
||||
if(manager.getPlugin("LuckPerms") != null)
|
||||
LuckPermsAdapter.initialize();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,8 @@ public class VelocityLoader {
|
||||
ClientCommunication.syncData();
|
||||
}).delay(2, TimeUnit.SECONDS).schedule();
|
||||
|
||||
Storage.PLUGIN_OBJECT = this;
|
||||
|
||||
if(server.getPluginManager().getPlugin("luckperms").isPresent())
|
||||
LuckPermsAdapter.initialize();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.rayzs.pat.utils.luckperms;
|
||||
|
||||
import de.rayzs.pat.plugin.logger.Logger;
|
||||
import de.rayzs.pat.utils.permission.PermissionUtil;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.event.EventBus;
|
||||
@@ -10,6 +11,8 @@ import net.luckperms.api.*;
|
||||
public class LuckPermsAdapter {
|
||||
|
||||
public static void initialize() {
|
||||
Logger.info("You're using LuckPerms? Hope you don't mind if I hook myself into it. ^^");
|
||||
|
||||
LuckPerms provider = LuckPermsProvider.get();
|
||||
EventBus eventBus = provider.getEventBus();
|
||||
|
||||
|
||||
Reference in new issue
Block a user