2022-12-21 16:31:21 +01:00
|
|
|
package fr.pandacube.lib.bungee;
|
|
|
|
|
2023-05-10 10:26:02 +02:00
|
|
|
import fr.pandacube.lib.bungee.util.BungeeDailyLogRotateFileHandler;
|
2022-12-21 16:31:21 +01:00
|
|
|
import fr.pandacube.lib.bungee.util.PluginMessagePassthrough;
|
|
|
|
import net.md_5.bungee.api.plugin.Plugin;
|
|
|
|
|
2023-08-27 17:28:12 +02:00
|
|
|
/**
|
|
|
|
* General class used to initialize some tools of pandalib-bungee, following the bungee plugin's lifecycle.
|
|
|
|
*/
|
2022-12-21 16:31:21 +01:00
|
|
|
public class PandaLibBungee {
|
|
|
|
|
|
|
|
private static Plugin plugin;
|
|
|
|
|
2023-08-27 17:28:12 +02:00
|
|
|
/**
|
|
|
|
* Method to be called in {@link Plugin#onLoad()} method.
|
|
|
|
* @param plugin the plugin instance.
|
|
|
|
*/
|
2022-12-21 16:31:21 +01:00
|
|
|
public static void onLoad(Plugin plugin) {
|
|
|
|
PandaLibBungee.plugin = plugin;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-08-27 17:28:12 +02:00
|
|
|
/**
|
|
|
|
* Method to be called in {@link Plugin#onEnable()} method.
|
|
|
|
*/
|
2022-12-21 16:31:21 +01:00
|
|
|
public static void onEnable() {
|
|
|
|
PluginMessagePassthrough.init(plugin);
|
2023-05-10 10:26:02 +02:00
|
|
|
BungeeDailyLogRotateFileHandler.init(true);
|
2022-12-21 16:31:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-27 17:28:12 +02:00
|
|
|
/**
|
|
|
|
* Method to be called in {@link Plugin#onDisable()} method.
|
|
|
|
*/
|
2022-12-21 16:31:21 +01:00
|
|
|
public static void disable() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-08-27 17:28:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the plugin instance.
|
|
|
|
* @return the plugin instance.
|
|
|
|
*/
|
2022-12-21 16:31:21 +01:00
|
|
|
public static Plugin getPlugin() {
|
|
|
|
return plugin;
|
|
|
|
}
|
2024-06-06 23:59:32 +02:00
|
|
|
|
|
|
|
private PandaLibBungee() {}
|
|
|
|
|
2022-12-21 16:31:21 +01:00
|
|
|
}
|