mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 23:09:14 +00:00
Now fully reliable and added support for health, max health, etc
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package me.william278.crossserversync;
|
||||
|
||||
import me.william278.crossserversync.bukkit.config.ConfigLoader;
|
||||
import me.william278.crossserversync.bukkit.data.LastDataUpdateUUIDCache;
|
||||
import me.william278.crossserversync.bukkit.listener.BukkitRedisListener;
|
||||
import me.william278.crossserversync.bukkit.listener.EventListener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class CrossServerSyncBukkit extends JavaPlugin {
|
||||
|
||||
private static CrossServerSyncBukkit instance;
|
||||
public static CrossServerSyncBukkit getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static LastDataUpdateUUIDCache lastDataUpdateUUIDCache;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
|
||||
// Load the config file
|
||||
getConfig().options().copyDefaults(true);
|
||||
saveDefaultConfig();
|
||||
saveConfig();
|
||||
reloadConfig();
|
||||
ConfigLoader.loadSettings(getConfig());
|
||||
|
||||
// Initialize last data update UUID cache
|
||||
lastDataUpdateUUIDCache = new LastDataUpdateUUIDCache();
|
||||
|
||||
// Initialize event listener
|
||||
getServer().getPluginManager().registerEvents(new EventListener(), this);
|
||||
|
||||
// Initialize the redis listener
|
||||
new BukkitRedisListener();
|
||||
|
||||
// Log to console
|
||||
getLogger().info("Enabled CrossServerSync (" + getServer().getName() + ") v" + getDescription().getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
getLogger().info("Disabled CrossServerSync (" + getServer().getName() + ") v" + getDescription().getVersion());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user