feat: formatting code & remove chinese
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
@ -5,7 +5,7 @@ let Bukkit = org.bukkit.Bukkit;
|
||||
export class BukkitConsole extends MiaoScriptConsole {
|
||||
sender(sender, ...args) {
|
||||
if (!(sender instanceof Java.type('org.bukkit.command.CommandSender'))) {
|
||||
this.error("第一个参数未实现 org.bukkit.command.CommandSender 无法发送消息!")
|
||||
this.error(`First parameter ${sender} not instanceof org.bukkit.command.CommandSender can't send message!`)
|
||||
return;
|
||||
}
|
||||
if (Object.prototype.toString.call(args[0]) === "[object Array]") {
|
||||
@ -14,7 +14,7 @@ export class BukkitConsole extends MiaoScriptConsole {
|
||||
sender.sendMessage(this.prefix + args.join(' '));
|
||||
}
|
||||
}
|
||||
console(...args): void {
|
||||
console(...args: string[]): void {
|
||||
this.sender(Bukkit.getConsoleSender(), args.join(' '));
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ export class BukkitEvent extends event.Event {
|
||||
// 不是抽象类
|
||||
!Modifier.isAbstract(clazz.getModifiers());
|
||||
}
|
||||
register(eventCls: any, exec: Function, priority: any, ignoreCancel: boolean) {
|
||||
register(eventCls: any, exec: Function, priority: event.EventPriority, ignoreCancel: boolean) {
|
||||
let listener = new Listener({});
|
||||
Bukkit.pluginManager.registerEvent(
|
||||
eventCls,
|
||||
|
@ -14,7 +14,6 @@ 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'));
|
||||
|
||||
container.bind(event.Event).to(BukkitEvent).inSingletonScope();
|
||||
container.bind(server.Server).to(BukkitServer).inSingletonScope();
|
||||
|
Reference in New Issue
Block a user