2019-09-21 07:04:47 +00:00
|
|
|
import './typings'
|
|
|
|
|
|
|
|
import { server, plugin, command, event, task } from '@ms/api'
|
2019-09-10 09:21:44 +00:00
|
|
|
import { DefaultContainer as container } from '@ms/container'
|
|
|
|
|
2019-09-21 07:04:47 +00:00
|
|
|
import { SpongeConsole } from './console';
|
|
|
|
import { SpongeEvent } from './event';
|
|
|
|
import { SpongeCommand } from './command';
|
|
|
|
import { SpongeTaskManager } from './task';
|
2019-09-10 09:21:44 +00:00
|
|
|
|
|
|
|
let SpongeServerType = 'sponge';
|
|
|
|
let Sponge = Java.type("org.spongepowered.api.Sponge");
|
|
|
|
|
|
|
|
container.bind(server.Console).toConstantValue(SpongeConsole);
|
|
|
|
container.bind(server.ServerType).toConstantValue(SpongeServerType);
|
|
|
|
container.bind(plugin.PluginInstance).toConstantValue(Sponge.pluginManager.getPlugin('MiaoScript').orElse(null));
|
2019-09-21 07:04:47 +00:00
|
|
|
|
|
|
|
container.bind(event.Event).to(SpongeEvent).inSingletonScope();
|
|
|
|
container.bind(command.Command).to(SpongeCommand).inSingletonScope();
|
|
|
|
container.bind(task.TaskManager).to(SpongeTaskManager).inSingletonScope();
|
|
|
|
|
|
|
|
console.debug(`Detect Sponge Compatible set ServerType to ${SpongeServerType} ...`)
|