feat: formatting code & remove chinese
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
@ -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()
|
||||
|
@ -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
|
||||
});
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user