mirror of
https://github.com/CarmJos/UserPrefix.git
synced 2026-06-05 00:35:02 +08:00
fix: 修复前缀内容显示错误的问题。
This commit is contained in:
@@ -135,10 +135,20 @@ public class PrefixManager {
|
|||||||
String name = conf.getString("name");
|
String name = conf.getString("name");
|
||||||
if (name == null) throw new Exception("配置文件 " + file.getAbsolutePath() + " 中没有配置前缀的显示名称。");
|
if (name == null) throw new Exception("配置文件 " + file.getAbsolutePath() + " 中没有配置前缀的显示名称。");
|
||||||
|
|
||||||
|
|
||||||
|
List<String> content = new ArrayList<>();
|
||||||
|
if (conf.isList("content")) {
|
||||||
|
content = conf.getStringList("content");
|
||||||
|
} else {
|
||||||
|
String single = conf.getString("content");
|
||||||
|
if (single != null) content.add(single);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new PrefixConfig(
|
return new PrefixConfig(
|
||||||
identifier, name,
|
identifier, name,
|
||||||
conf.getStringList("description"),
|
conf.getStringList("description"),
|
||||||
conf.getStringList("content"),
|
content,
|
||||||
conf.getLong("period", -1L),
|
conf.getLong("period", -1L),
|
||||||
conf.getInt("weight", 1),
|
conf.getInt("weight", 1),
|
||||||
conf.getString("permission"),
|
conf.getString("permission"),
|
||||||
|
|||||||
Reference in New Issue
Block a user