1
mirror of https://github.com/CarmJos/UserPrefix.git synced 2026-06-04 15:28:21 +08:00

fix(gui): 修复GUI物品无法初始化的问题

This commit is contained in:
2022-07-01 20:36:32 +08:00
parent cbd2a4373d
commit 9693bc6b8a
3 changed files with 4 additions and 3 deletions
@@ -122,7 +122,7 @@ public class PluginConfig extends ConfigurationRoot {
.serializeValue(GUIItemConfiguration::serialize)
.parseValue((v, d) -> GUIItemReader.readFrom(v))
.defaults(new GUIItemConfiguration(
Material.BARRIER, 0, "&c&l返回",
Material.BARRIER, 1, 0, "&c&l返回",
Collections.singletonList("&f点击即可返回上一菜单"),
Collections.singletonList(GUIActionConfiguration.of(GUIActionType.CHAT, "/menu")),
Collections.singletonList(49)
@@ -18,6 +18,7 @@ public class GUIItemReader {
String material = Optional.ofNullable(section.getString("type")).orElse("STONE");
Material type = Optional.ofNullable(Material.matchMaterial(material)).orElse(Material.STONE);
int data = section.getInt("data", 0);
int amount = section.getInt("amount", 1);
String name = section.getString("name");
List<String> lore = section.getStringList("lore");
@@ -33,7 +34,7 @@ public class GUIItemReader {
}
return new GUIItemConfiguration(
type, data, name, lore, actions,
type, amount, data, name, lore, actions,
slots.size() > 0 ? slots : Collections.singletonList(slot)
);
}