Search in sources :

Example 1 with AddonRegistry

use of mc.dragons.core.addon.AddonRegistry in project DragonsOnline by UniverseCraft.

the class DragonsNPCAddons method onLoad.

public void onLoad() {
    enableDebugLogging();
    dragons = Dragons.getInstance();
    getLogger().info("Loading NPC addons...");
    AddonRegistry registry = dragons.getAddonRegistry();
    registry.register(new GuardAddon(dragons));
    registry.register(new EnchanterAddon());
    registry.register(new BoneCrusherAddon());
    registry.register(new UndeadMurdererAddon());
    registry.register(new SoulStealerAddon(dragons));
    registry.register(new AuraAddon());
    registry.register(new WalkingArmorStandAddon());
    registry.register(new PossessedWoodChipsAddon(dragons));
    registry.register(new CompanionAddon());
    dragons.getUserHookRegistry().registerHook(new NPCUserHook(this));
}
Also used : WalkingArmorStandAddon(mc.dragons.npcs.model.WalkingArmorStandAddon) SoulStealerAddon(mc.dragons.npcs.model.SoulStealerAddon) PossessedWoodChipsAddon(mc.dragons.npcs.model.PossessedWoodChipsAddon) BoneCrusherAddon(mc.dragons.npcs.model.BoneCrusherAddon) AddonRegistry(mc.dragons.core.addon.AddonRegistry) UndeadMurdererAddon(mc.dragons.npcs.model.UndeadMurdererAddon)

Example 2 with AddonRegistry

use of mc.dragons.core.addon.AddonRegistry in project DragonsOnline by UniverseCraft.

the class DragonsSpells method onLoad.

public void onLoad() {
    enableDebugLogging();
    Dragons dragons = getDragonsInstance();
    getLogger().info("Loading item addons...");
    spellRegistry = new SpellRegistry();
    AddonRegistry registry = dragons.getAddonRegistry();
    registry.register(spellCastAddon = new SpellCastAddon(this));
    registry.register(spellScrollAddon = new SpellScrollAddon());
    dragons.getUserHookRegistry().registerHook(new SpellUserHook(this));
    // Instantiate all spells here
    new TestSpell(this);
}
Also used : Dragons(mc.dragons.core.Dragons) AddonRegistry(mc.dragons.core.addon.AddonRegistry) TestSpell(mc.dragons.spells.spells.TestSpell) SpellRegistry(mc.dragons.spells.spells.SpellRegistry)

Example 3 with AddonRegistry

use of mc.dragons.core.addon.AddonRegistry 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());
}
Also used : LightweightLoaderRegistry(mc.dragons.core.storage.loader.LightweightLoaderRegistry) AddonRegistry(mc.dragons.core.addon.AddonRegistry) ChatMessageRegistry(mc.dragons.core.gameobject.user.chat.ChatMessageRegistry) SidebarManager(mc.dragons.core.gameobject.user.SidebarManager) LocalStorageManager(mc.dragons.core.storage.local.LocalStorageManager) UserHookRegistry(mc.dragons.core.gameobject.user.UserHookRegistry) LagMonitorTask(mc.dragons.core.tasks.LagMonitorTask) MongoConfig(mc.dragons.core.storage.mongo.MongoConfig) MongoStorageManager(mc.dragons.core.storage.mongo.MongoStorageManager) GameObjectRegistry(mc.dragons.core.gameobject.GameObjectRegistry) MessageDispatcher(mc.dragons.core.networking.MessageDispatcher) LagMeter(mc.dragons.core.tasks.LagMeter) AutoSaveTask(mc.dragons.core.tasks.AutoSaveTask) SpawnEntityTask(mc.dragons.core.tasks.SpawnEntityTask) NamespacedKey(org.bukkit.NamespacedKey) CustomLoggingProvider(mc.dragons.core.logging.CustomLoggingProvider) UpdateScoreboardTask(mc.dragons.core.tasks.UpdateScoreboardTask) VerifyGameIntegrityTask(mc.dragons.core.tasks.VerifyGameIntegrityTask) BridgeSpigot116R3(mc.dragons.core.bridge.impl.BridgeSpigot116R3)

Example 4 with AddonRegistry

use of mc.dragons.core.addon.AddonRegistry in project DragonsOnline by UniverseCraft.

the class ItemClass method reloadAddons.

@SuppressWarnings("unchecked")
public void reloadAddons() {
    AddonRegistry registry = Dragons.getInstance().getAddonRegistry();
    addons = ((List<String>) getData("addons")).stream().map(addonName -> (ItemAddon) registry.getAddonByName(addonName)).collect(Collectors.toList());
}
Also used : AddonRegistry(mc.dragons.core.addon.AddonRegistry)

Aggregations

AddonRegistry (mc.dragons.core.addon.AddonRegistry)4 Dragons (mc.dragons.core.Dragons)1 BridgeSpigot116R3 (mc.dragons.core.bridge.impl.BridgeSpigot116R3)1 GameObjectRegistry (mc.dragons.core.gameobject.GameObjectRegistry)1 SidebarManager (mc.dragons.core.gameobject.user.SidebarManager)1 UserHookRegistry (mc.dragons.core.gameobject.user.UserHookRegistry)1 ChatMessageRegistry (mc.dragons.core.gameobject.user.chat.ChatMessageRegistry)1 CustomLoggingProvider (mc.dragons.core.logging.CustomLoggingProvider)1 MessageDispatcher (mc.dragons.core.networking.MessageDispatcher)1 LightweightLoaderRegistry (mc.dragons.core.storage.loader.LightweightLoaderRegistry)1 LocalStorageManager (mc.dragons.core.storage.local.LocalStorageManager)1 MongoConfig (mc.dragons.core.storage.mongo.MongoConfig)1 MongoStorageManager (mc.dragons.core.storage.mongo.MongoStorageManager)1 AutoSaveTask (mc.dragons.core.tasks.AutoSaveTask)1 LagMeter (mc.dragons.core.tasks.LagMeter)1 LagMonitorTask (mc.dragons.core.tasks.LagMonitorTask)1 SpawnEntityTask (mc.dragons.core.tasks.SpawnEntityTask)1 UpdateScoreboardTask (mc.dragons.core.tasks.UpdateScoreboardTask)1 VerifyGameIntegrityTask (mc.dragons.core.tasks.VerifyGameIntegrityTask)1 BoneCrusherAddon (mc.dragons.npcs.model.BoneCrusherAddon)1