feat: formatting code & remove chinese

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-01-15 16:48:18 +08:00
parent d724feaec0
commit e4bb878648
12 changed files with 111 additions and 61 deletions

View File

@ -12,11 +12,12 @@ var Optional = Java.type('java.util.Optional');
class SimpleCommandCallable {
public callable: any;
private name: string;
private executor: Function;
private tabCompleter: Function;
constructor(command: string, description: string = '暂无描述!') {
this.name = command;
this.callable = new CommandCallable({
//CommandResult process(CommandSource source, String arguments) throws CommandException;
process: (sender: any, args) => {
@ -47,7 +48,7 @@ class SimpleCommandCallable {
setExecutor = (executor: Function) => this.executor = executor;
setTabCompleter = (tabCompleter: Function) => this.tabCompleter = tabCompleter;
toString = () => `Sponge SimpleCommandCallable`
toString = () => `Sponge SimpleCommandCallable(${this.name})`
}
@injectable()

View File

@ -40,7 +40,7 @@ export class SpongeEvent extends event.Event {
class2Name(clazz: any) {
return clazz.name.substring(clazz.name.lastIndexOf(".") + 1);
}
register(eventCls: any, exec: Function, priority: any = 'NORMAL', ignoreCancel: boolean = true) {
register(eventCls: any, exec: Function, priority: event.EventPriority = event.EventPriority.NORMAL, ignoreCancel: boolean = true) {
var listener = new EventListener({
handle: exec
});

View File

@ -14,7 +14,6 @@ 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.getPluginManager().getPlugin('MiaoScript').orElse(null));
container.bind(event.Event).to(SpongeEvent).inSingletonScope();
container.bind(server.Server).to(SpongeServer).inSingletonScope();