feat: add molang package

1. upgrade bukkit chat
2. fix config update error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2022-02-12 16:29:40 +08:00
parent 5ed61829e1
commit 6816e51239
73 changed files with 3103 additions and 129 deletions

View File

@ -110,11 +110,12 @@ export class PluginConfigManager {
let needSave = false
for (const key of Object.keys(defaultValue)) {
// 当配置文件不存在当前属性时才进行赋值
if (!Object.prototype.hasOwnProperty.call(configValue, key)) {
if (!Object.prototype.hasOwnProperty.call(configValue, key) && key != '____deep_copy____') {
configValue[key] = defaultValue[key]
needSave = true
} else if (Object.prototype.toString.call(configValue[key]) == "[object Object]" && !Object.prototype.hasOwnProperty.call(defaultValue[key], '____ignore____')) {
// 对象需要递归检测 如果对象内存在 ____ignore____ 那就忽略设置
} else if (Object.prototype.toString.call(configValue[key]) == "[object Object]"
&& Object.prototype.hasOwnProperty.call(defaultValue[key], '____deep_copy____')) {
// 对象需要递归检测 如果对象内存在 ____deep_copy____ 那就忽略设置
needSave ||= this.setDefaultValue(configValue[key], defaultValue[key])
}
}