diff --git a/src/generated/resources/data/minecraft/tags/item/chest_armor.json b/src/generated/resources/data/minecraft/tags/item/chest_armor.json new file mode 100644 index 00000000..dc0d749e --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/item/chest_armor.json @@ -0,0 +1,7 @@ +{ + "values": [ + "naturesaura:depth_chest", + "naturesaura:infused_iron_chest", + "naturesaura:sky_chest" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/item/foot_armor.json b/src/generated/resources/data/minecraft/tags/item/foot_armor.json new file mode 100644 index 00000000..f0004e7f --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/item/foot_armor.json @@ -0,0 +1,7 @@ +{ + "values": [ + "naturesaura:depth_shoes", + "naturesaura:infused_iron_shoes", + "naturesaura:sky_shoes" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/item/head_armor.json b/src/generated/resources/data/minecraft/tags/item/head_armor.json new file mode 100644 index 00000000..91ce668b --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/item/head_armor.json @@ -0,0 +1,7 @@ +{ + "values": [ + "naturesaura:depth_helmet", + "naturesaura:infused_iron_helmet", + "naturesaura:sky_helmet" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/item/leg_armor.json b/src/generated/resources/data/minecraft/tags/item/leg_armor.json new file mode 100644 index 00000000..26dbc046 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/item/leg_armor.json @@ -0,0 +1,7 @@ +{ + "values": [ + "naturesaura:depth_pants", + "naturesaura:infused_iron_pants", + "naturesaura:sky_pants" + ] +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/data/ItemTagProvider.java b/src/main/java/de/ellpeck/naturesaura/data/ItemTagProvider.java index 301959ae..ea30fc6f 100644 --- a/src/main/java/de/ellpeck/naturesaura/data/ItemTagProvider.java +++ b/src/main/java/de/ellpeck/naturesaura/data/ItemTagProvider.java @@ -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); } }); @@ -62,4 +72,5 @@ public IntrinsicHolderTagsProvider.IntrinsicTagAppender tag(TagKey t // super is protected, but CuriosCompat needs this return super.tag(tag); } + }