2019-09-07 04:23:15 +00:00
|
|
|
import '@ms/nashorn'
|
|
|
|
|
2019-09-10 09:22:22 +00:00
|
|
|
import { plugin, server } from '@ms/api'
|
2019-09-07 04:23:15 +00:00
|
|
|
import { DefaultContainer as container } from '@ms/container'
|
|
|
|
import { PluginManagerImpl } from '@ms/plugin'
|
|
|
|
|
2019-09-10 09:22:22 +00:00
|
|
|
try {
|
|
|
|
Java.type("org.bukkit.Bukkit");
|
|
|
|
require('@ms/bukkit');
|
|
|
|
} catch (ex) {
|
|
|
|
}
|
2019-09-07 04:23:15 +00:00
|
|
|
|
2019-09-10 09:22:22 +00:00
|
|
|
try {
|
|
|
|
Java.type("org.spongepowered.api.Sponge");
|
|
|
|
require('@ms/sponge');
|
|
|
|
} catch (ex) {
|
|
|
|
}
|
|
|
|
|
|
|
|
let Console = container.get(server.Console);
|
|
|
|
//@ts-ignore
|
2019-09-07 04:23:15 +00:00
|
|
|
global.console = new Console();
|
|
|
|
|
|
|
|
container.bind(plugin.PluginManager).to(PluginManagerImpl).inSingletonScope();
|
|
|
|
|
|
|
|
let manager = container.get<plugin.PluginManager>(plugin.PluginManager);
|
|
|
|
manager.scan('plugins');
|
|
|
|
manager.load(container);
|
|
|
|
manager.enable();
|