1
mirror of https://github.com/CarmJos/UserPrefix.git synced 2024-09-19 20:15:47 +00:00

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

This commit is contained in:
Carm Jos 2022-07-01 20:36:32 +08:00
parent cbd2a4373d
commit 9693bc6b8a
3 changed files with 4 additions and 3 deletions

View File

@ -13,7 +13,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<easyplugin.version>1.4.9</easyplugin.version>
<easyplugin.version>1.4.10</easyplugin.version>
<mineconfig.version>2.0.1</mineconfig.version>
</properties>

View File

@ -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)

View File

@ -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)
);
}