Add DURABILITY as alias of DATA-VALUE

This commit is contained in:
filoghost 2018-10-30 18:59:54 +01:00
parent c41689fee2
commit 675711b2b3

View File

@ -34,10 +34,11 @@ public class IconSerializer {
private static class Nodes { private static class Nodes {
public static final public static final String
String ID = "ID", ID = "ID",
DATA_VALUE = "DATA-VALUE",
AMOUNT = "AMOUNT", AMOUNT = "AMOUNT",
DATA_VALUE = "DATA-VALUE",
DURABILITY = "DURABILITY",
NAME = "NAME", NAME = "NAME",
LORE = "LORE", LORE = "LORE",
ENCHANT = "ENCHANTMENT", ENCHANT = "ENCHANTMENT",
@ -98,7 +99,9 @@ public class IconSerializer {
} }
} }
if (section.isSet(Nodes.DATA_VALUE)) { if (section.isSet(Nodes.DURABILITY)) {
icon.setDataValue((short) section.getInt(Nodes.DURABILITY));
} else if (section.isSet(Nodes.DATA_VALUE)) { // Alias
icon.setDataValue((short) section.getInt(Nodes.DATA_VALUE)); icon.setDataValue((short) section.getInt(Nodes.DATA_VALUE));
} }