Skip to content

Commit

Permalink
fixed armor not having the proper tags
Browse files Browse the repository at this point in the history
closes #369
  • Loading branch information
Ellpeck committed Nov 20, 2024
1 parent 0d2f6f5 commit ad22ce7
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_chest",
"naturesaura:infused_iron_chest",
"naturesaura:sky_chest"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_shoes",
"naturesaura:infused_iron_shoes",
"naturesaura:sky_shoes"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_helmet",
"naturesaura:infused_iron_helmet",
"naturesaura:sky_helmet"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_pants",
"naturesaura:infused_iron_pants",
"naturesaura:sky_pants"
]
}
11 changes: 11 additions & 0 deletions src/main/java/de/ellpeck/naturesaura/data/ItemTagProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ protected void addTags(HolderLookup.Provider provider) {
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);
}
});

Expand All @@ -62,4 +72,5 @@ public IntrinsicHolderTagsProvider.IntrinsicTagAppender<Item> tag(TagKey<Item> t
// super is protected, but CuriosCompat needs this
return super.tag(tag);
}

}

0 comments on commit ad22ce7

Please sign in to comment.