Add new vanilla custom item properties to JSON reader, needs testing

This commit is contained in:
Eclipse 2024-05-11 10:35:06 +00:00
parent 22f5ad12a8
commit 0a7a06a044
No known key found for this signature in database
GPG key ID: 441A0B7FDD01D03A

View file

@ -225,6 +225,50 @@ public class MappingsReader_v1 extends MappingsReader {
customItemData.tags(tagsSet);
}
if (node.has("stack_size")) {
customItemData.stackSize(node.get("stack_size").asInt());
}
if (node.has("max_damage")) {
customItemData.maxDamage(node.get("max_damage").asInt());
}
if (node.has("attack_damage")) {
customItemData.maxDamage(node.get("attack_damage").asInt());
}
if (node.has("tool_type")) {
customItemData.toolType(node.get("tool_type").asText());
}
if (node.has("tool_tier")) {
customItemData.toolTier(node.get("tool_tier").asText());
}
if (node.has("armor_type")) {
customItemData.armorType(node.get("armor_type").asText());
}
if (node.has("protection_value")) {
customItemData.protectionValue(node.get("protection_value").asInt());
}
if (node.has("hat")) {
customItemData.hat(node.get("hat").asBoolean());
}
if (node.has("foil")) {
customItemData.foil(node.get("foil").asBoolean());
}
if (node.has("edible")) {
customItemData.edible(node.get("edible").asBoolean());
}
if (node.has("can_always_eat")) {
customItemData.canAlwaysEat(node.get("can_always_eat").asBoolean());
}
return customItemData.build();
}