fixed armor not having the proper tags

closes #369
This commit is contained in:
Ell 2024-11-20 21:59:25 +01:00
parent 0d2f6f5389
commit ad22ce7342
5 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_chest",
"naturesaura:infused_iron_chest",
"naturesaura:sky_chest"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_shoes",
"naturesaura:infused_iron_shoes",
"naturesaura:sky_shoes"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_helmet",
"naturesaura:infused_iron_helmet",
"naturesaura:sky_helmet"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_pants",
"naturesaura:infused_iron_pants",
"naturesaura:sky_pants"
]
}

View file

@ -51,6 +51,16 @@ public class ItemTagProvider extends ItemTagsProvider {
this.tag(ItemTags.SWORDS).add(i);
} else if (i instanceof ItemShovel) {
this.tag(ItemTags.SHOVELS).add(i);
} else if (i instanceof ItemArmor a) {
var tag = switch (a.getType()) {
case HELMET -> ItemTags.HEAD_ARMOR;
case CHESTPLATE -> ItemTags.CHEST_ARMOR;
case LEGGINGS -> ItemTags.LEG_ARMOR;
case BOOTS -> ItemTags.FOOT_ARMOR;
default -> null;
};
if (tag != null)
this.tag(tag).add(i);
}
});
@ -62,4 +72,5 @@ public class ItemTagProvider extends ItemTagsProvider {
// super is protected, but CuriosCompat needs this
return super.tag(tag);
}
}