fix: bukkit chat init error & config save error
This commit is contained in:
parent
606f097989
commit
d01938487a
@ -13,8 +13,7 @@ let downgrade = false
|
||||
/**
|
||||
* 获取NMS版本
|
||||
*/
|
||||
//@ts-ignore
|
||||
let nmsVersion = org.bukkit.Bukkit.server.class.name.split('.')[3]
|
||||
let nmsVersion = undefined
|
||||
/**
|
||||
* 获取NMS类
|
||||
*/
|
||||
@ -47,6 +46,8 @@ function remapFieldName(clazz: any, origin: string, test: string) {
|
||||
}
|
||||
|
||||
function init() {
|
||||
//@ts-ignore
|
||||
nmsVersion = org.bukkit.Bukkit.server.class.name.split('.')[3]
|
||||
try {
|
||||
RemapUtils = Java.type('catserver.server.remapper.RemapUtils')
|
||||
} catch (ex) {
|
||||
|
@ -43,7 +43,7 @@ function loadConfig(plugin: plugin.Plugin) {
|
||||
base.save(configFile, configFactory.dump(plugin[config.variable]))
|
||||
console.i18n("ms.plugin.manager.config.save.default", { plugin: plugin.description.name, name: config.name, format: config.format })
|
||||
} else {
|
||||
plugin[config.variable] = configFactory.load(base.read(configFile))
|
||||
Object.defineProperty(plugin, config.variable, { value: configFactory.load(base.read(configFile)) })
|
||||
plugin[config.variable].save = () => {
|
||||
let result = configFactory.dump(plugin[config.variable])
|
||||
base.save(configFile, result)
|
||||
|
Loading…
Reference in New Issue
Block a user