示例#1
0
        /// <summary>
        ///     The method that gets invoked as soon as a plugin gets Disabled.
        ///     Any content initialized in <see cref="M:OpenAPI.Plugins.OpenPlugin.Enabled(OpenAPI.OpenApi)" /> should be de-initialized in here.
        /// </summary>
        /// <param name="api">An instance to OpenApi</param>
        public override void Disabled(OpenApi api)
        {
            api.EventDispatcher.UnregisterEvents(this);
            api.CommandManager.UnloadCommands(Commands);

            GeneratorManager.Close();
            MultiVerseManager.Close();
        }
示例#2
0
        public Multiverse(OpenAPI.OpenApi api)
        {
            Api = api;
            GeneratorManager  = new GeneratorManager();
            MultiVerseManager = new MultiVerseManager(api, GeneratorManager);
            Commands          = new MultiVerseCommands(this);

            PermissionsEnabled = Config.GetProperty("mv.permissions.enabled", false);

            GeneratorManager.TryRegister <SuperflatGenerator>("flatland", () =>
            {
                return(new SuperflatGenerator(Dimension.Overworld));
            });
        }
示例#3
0
        public void OnServerReady(ServerReadyEvent e)
        {
            var searchName = typeof(OpenAPI.OpenApi).Assembly.GetName().Name;

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                if (assembly.GetReferencedAssemblies().Any(x =>
                                                           x.FullName.Contains("MiNET", StringComparison.InvariantCultureIgnoreCase) ||
                                                           x.Name.Equals(searchName)))
                {
                    GeneratorManager.AutoRegister(assembly);
                }
            }

            MultiVerseManager.Load();
        }