2019-09-19 10:58:01 +00:00
|
|
|
import './typings'
|
|
|
|
|
|
|
|
import { server, plugin, command, event } from '@ms/api'
|
2019-09-07 04:23:15 +00:00
|
|
|
import { DefaultContainer as container } from '@ms/container'
|
|
|
|
|
2019-09-19 10:58:01 +00:00
|
|
|
import { BukkitEvent } from './event';
|
|
|
|
import { BukkitConsole } from './console';
|
2019-09-10 09:21:27 +00:00
|
|
|
import { BukkitCommand } from './command';
|
2019-09-07 04:23:15 +00:00
|
|
|
|
|
|
|
let BukkitServerType = 'bukkit';
|
|
|
|
let Bukkit = Java.type("org.bukkit.Bukkit");
|
|
|
|
|
|
|
|
container.bind(server.Console).toConstantValue(BukkitConsole);
|
|
|
|
container.bind(server.ServerType).toConstantValue(BukkitServerType);
|
|
|
|
container.bind(plugin.PluginInstance).toConstantValue(Bukkit.pluginManager.getPlugin('MiaoScript'));
|
2019-09-10 09:21:27 +00:00
|
|
|
|
2019-09-19 10:58:01 +00:00
|
|
|
container.bind(event.Event).to(BukkitEvent).inSingletonScope();
|
2019-09-10 09:21:27 +00:00
|
|
|
container.bind(command.Command).to(BukkitCommand).inSingletonScope();
|
2019-09-19 10:58:01 +00:00
|
|
|
|
|
|
|
console.debug(`Detect Sponge Compatible set ServerType to ${BukkitServerType} ...`)
|