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