use of mc.dragons.core.storage.loader.LightweightLoaderRegistry in project DragonsOnline by UniverseCraft.
the class DragonsResidences method onEnable.
public void onEnable() {
enableDebugLogging();
dragons = Dragons.getInstance();
resetResWorld();
MongoConfig mongoConfig = dragons.getMongoConfig();
ResLoader resLoader = new ResLoader(mongoConfig);
ResPointLoader resPointLoader = new ResPointLoader(mongoConfig);
LightweightLoaderRegistry registry = dragons.getLightweightLoaderRegistry();
registry.register(resLoader);
registry.register(resPointLoader);
dragons.getUserHookRegistry().registerHook(new ResUserHook(dragons));
resPointLoader.loadAllResPoints();
getServer().getPluginManager().registerEvents(new ResEvents(dragons), this);
ResCommands resCommands = new ResCommands(dragons);
getCommand("res").setExecutor(resCommands);
getCommand("resadmin").setExecutor(resCommands);
getCommand("restest").setExecutor(resCommands);
getCommand("testschematic").setExecutor(resCommands);
getCommand("testcontextualholograms").setExecutor(resCommands);
getLogger().info("Loading holograms for res points...");
for (ResPoint resPoint : resPointLoader.getAllResPoints()) {
resPointLoader.createResPointHologram(resPoint);
}
}
use of mc.dragons.core.storage.loader.LightweightLoaderRegistry in project DragonsOnline by UniverseCraft.
the class Dragons method onLoad.
@Override
public synchronized void onLoad() {
FIXED_ENTITY_KEY = new NamespacedKey(this, "fixed");
started = System.currentTimeMillis();
getLogger().info("Searching for compatible version...");
switch(BUKKIT_API_VERSION) {
case "1_16_R3":
bridge = new BridgeSpigot116R3();
break;
default:
getLogger().severe("Incompatible server version (" + BUKKIT_API_VERSION + ")");
getLogger().severe("Cannot run DragonsOnline.");
getServer().getPluginManager().disablePlugin(this);
return;
}
joinable = false;
getLogger().info("Disabled player joins until Dragons startup completes");
serverName = getConfig().getString("serverName");
getLogger().info("Server instance name is " + serverName);
getLogger().info("Initializing storage and registries...");
saveDefaultConfig();
mongoConfig = new MongoConfig(this);
persistentStorageManager = new MongoStorageManager(this);
localStorageManager = new LocalStorageManager();
gameObjectRegistry = new GameObjectRegistry(this, persistentStorageManager);
addonRegistry = new AddonRegistry(this);
userHookRegistry = new UserHookRegistry();
lightweightLoaderRegistry = new LightweightLoaderRegistry();
sidebarManager = new SidebarManager(this);
chatMessageRegistry = new ChatMessageRegistry();
messageDispatcher = new MessageDispatcher(this);
setCustomLoggingProvider(new CustomLoggingProvider(this));
autoSaveRunnable = new AutoSaveTask(this);
spawnEntityRunnable = new SpawnEntityTask(this);
verifyGameIntegrityRunnable = new VerifyGameIntegrityTask(this);
lagMeter = new LagMeter();
lagMonitorTask = new LagMonitorTask();
updateScoreboardTask = new UpdateScoreboardTask(this);
serverOptions = new ServerOptions(this);
serverOptions.setLogLevel(Level.parse(getConfig().getString("loglevel")));
debug = getConfig().getBoolean("debug");
if (debug) {
if (serverOptions.getLogLevel().intValue() > Level.CONFIG.intValue()) {
serverOptions.setLogLevel(Level.CONFIG);
}
serverOptions.setVerifyIntegrityEnabled(false);
getLogger().warning("==========================================================");
getLogger().warning("THIS SERVER IS IN DEVELOPMENT MODE.");
getLogger().warning("GAME INTEGRITY WILL NOT BE VERIFIED AFTER INITIAL LOAD.");
getLogger().warning("==========================================================");
}
customLoggingProvider.enableCustomLogging();
enableDebugLogging();
getLogger().info("Log token is " + customLoggingProvider.getCustomLogFilter().getLogEntryUUID());
}
Aggregations