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:
parent
cbd2a4373d
commit
9693bc6b8a
2
pom.xml
2
pom.xml
@ -13,7 +13,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<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>
|
<mineconfig.version>2.0.1</mineconfig.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public class PluginConfig extends ConfigurationRoot {
|
|||||||
.serializeValue(GUIItemConfiguration::serialize)
|
.serializeValue(GUIItemConfiguration::serialize)
|
||||||
.parseValue((v, d) -> GUIItemReader.readFrom(v))
|
.parseValue((v, d) -> GUIItemReader.readFrom(v))
|
||||||
.defaults(new GUIItemConfiguration(
|
.defaults(new GUIItemConfiguration(
|
||||||
Material.BARRIER, 0, "&c&l返回",
|
Material.BARRIER, 1, 0, "&c&l返回",
|
||||||
Collections.singletonList("&f点击即可返回上一菜单"),
|
Collections.singletonList("&f点击即可返回上一菜单"),
|
||||||
Collections.singletonList(GUIActionConfiguration.of(GUIActionType.CHAT, "/menu")),
|
Collections.singletonList(GUIActionConfiguration.of(GUIActionType.CHAT, "/menu")),
|
||||||
Collections.singletonList(49)
|
Collections.singletonList(49)
|
||||||
|
@ -18,6 +18,7 @@ public class GUIItemReader {
|
|||||||
String material = Optional.ofNullable(section.getString("type")).orElse("STONE");
|
String material = Optional.ofNullable(section.getString("type")).orElse("STONE");
|
||||||
Material type = Optional.ofNullable(Material.matchMaterial(material)).orElse(Material.STONE);
|
Material type = Optional.ofNullable(Material.matchMaterial(material)).orElse(Material.STONE);
|
||||||
int data = section.getInt("data", 0);
|
int data = section.getInt("data", 0);
|
||||||
|
int amount = section.getInt("amount", 1);
|
||||||
String name = section.getString("name");
|
String name = section.getString("name");
|
||||||
List<String> lore = section.getStringList("lore");
|
List<String> lore = section.getStringList("lore");
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ public class GUIItemReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new GUIItemConfiguration(
|
return new GUIItemConfiguration(
|
||||||
type, data, name, lore, actions,
|
type, amount, data, name, lore, actions,
|
||||||
slots.size() > 0 ? slots : Collections.singletonList(slot)
|
slots.size() > 0 ? slots : Collections.singletonList(slot)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user