1
mirror of https://github.com/CarmJos/ScriptItems synced 2024-09-19 13:25:50 +00:00

修改Item的读取方式

This commit is contained in:
Carm Jos 2022-03-13 13:33:37 +08:00
parent 0ca5b23a7a
commit abcee4212e

View File

@ -48,8 +48,9 @@ public class ItemStackConfig {
public static @Nullable ItemStackConfig read(@Nullable ConfigurationSection section) {
if (section == null) return null;
return new ItemStackConfig(
Optional.ofNullable(section.getString("material")).map(Material::matchMaterial).orElse(null),
section.getString("displayName"), section.getStringList("lore")
Optional.ofNullable(section.getString("type")).map(Material::matchMaterial).orElse(null),
section.getString("name"),
section.getStringList("lore")
);
}