diff --git a/pom.xml b/pom.xml index 0c1a819..8b3ca50 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ cc.carm.plugin moeteleport - 1.0.4 + 1.0.5 MoeTeleport 喵喵传送,简单的传送、设置家的插件。 diff --git a/src/main/java/cc/carm/plugin/moeteleport/configuration/values/ConfigValueMap.java b/src/main/java/cc/carm/plugin/moeteleport/configuration/values/ConfigValueMap.java index 11b6ab0..0498222 100644 --- a/src/main/java/cc/carm/plugin/moeteleport/configuration/values/ConfigValueMap.java +++ b/src/main/java/cc/carm/plugin/moeteleport/configuration/values/ConfigValueMap.java @@ -7,7 +7,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; @@ -50,13 +49,13 @@ public Map get() { if (valueCache != null) return valueCache; ConfigurationSection section = getConfiguration().getConfigurationSection(this.configSection); if (section == null) return new LinkedHashMap<>(); - Set keys = getConfiguration().getKeys(false); + Set keys = section.getKeys(false); if (keys.isEmpty()) return new LinkedHashMap<>(); else { LinkedHashMap result = new LinkedHashMap<>(); for (String key : keys) { K finalKey = keyCast.apply(key); - Object val = getConfiguration().get(this.configSection); + Object val = section.get(key); V finalValue = this.valueClazz.isInstance(val) ? this.valueClazz.cast(val) : null; if (finalKey != null && finalValue != null) { result.put(finalKey, finalValue); @@ -67,7 +66,8 @@ public Map get() { } } - public void set(HashMap valuesMap) { + public void set(LinkedHashMap valuesMap) { + this.valueCache = valuesMap; getConfiguration().createSection(this.configSection, valuesMap); this.save(); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 78abf7f..d68b5f6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -5,7 +5,7 @@ defaultHome: 1 permissions: # 以下命令全部为 MoeTeleport 的子节点 # 如 "home.vip" 的权限全拼就是 "MoeTeleport.home.vip" - "home.vip": 10 # 最多可以设置10个家 + 10: "home.vip" # 最多可以设置10个家 # 传送请求过期时间 expireTime: 30