Skip to content

Commit

Permalink
Add a tag for armor that can accept the golden modifier
Browse files Browse the repository at this point in the history
Will make life easier for addons that add custom armor
  • Loading branch information
KnightMiner committed May 17, 2024
1 parent a6fb00a commit 1d09f95
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@
"defense": 1
},
"tools": {
"type": "forge:difference",
"base": {
"tag": "tconstruct:modifiable/armor/worn"
},
"subtracted": [
{
"item": "tconstruct:plate_boots"
},
{
"item": "tconstruct:plate_leggings"
},
{
"item": "tconstruct:plate_chestplate"
},
{
"item": "tconstruct:plate_helmet"
}
]
"tag": "tconstruct:modifiable/armor/golden"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"values": [
"tconstruct:travelers_boots",
"tconstruct:travelers_leggings",
"tconstruct:travelers_chestplate",
"tconstruct:travelers_helmet",
"tconstruct:slime_boots",
"tconstruct:slime_leggings",
"tconstruct:slime_chestplate",
"tconstruct:slime_helmet"
]
}
3 changes: 3 additions & 0 deletions src/main/java/slimeknights/tconstruct/common/TinkerTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ private static void init() {}
public static final TagKey<Item> HELD_ARMOR = tag("modifiable/armor/held");
/** Modifiable items that have innate shielding behavior */
public static final TagKey<Item> SHIELDS = tag("modifiable/shields");
/** Armor that supports being made golden */
public static final TagKey<Item> GOLDEN_ARMOR = tag("modifiable/armor/golden");

// armor book tags
/** Full list of armor shown in the encyclopedia, can add to directly to show only in the encyclopedia */
public static final TagKey<Item> BOOK_ARMOR = tag("modifiable/book_armor");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import static slimeknights.tconstruct.common.TinkerTags.Items.EMBELLISHMENT_WOOD;
import static slimeknights.tconstruct.common.TinkerTags.Items.FANTASTIC_ARMOR;
import static slimeknights.tconstruct.common.TinkerTags.Items.GADGETRY_ARMOR;
import static slimeknights.tconstruct.common.TinkerTags.Items.GOLDEN_ARMOR;
import static slimeknights.tconstruct.common.TinkerTags.Items.HARVEST;
import static slimeknights.tconstruct.common.TinkerTags.Items.HARVEST_PRIMARY;
import static slimeknights.tconstruct.common.TinkerTags.Items.HELD;
Expand Down Expand Up @@ -257,9 +258,9 @@ private void addTools() {
addToolTags(TinkerTools.enderStaff, DURABILITY, STAFFS, SPECIAL_TOOLS, HELD_ARMOR, INTERACTABLE_DUAL, AOE, DYEABLE, EMBELLISHMENT_WOOD);

// armor
addArmorTags(TinkerTools.travelersGear, DURABILITY, DYEABLE, ItemTags.FREEZE_IMMUNE_WEARABLES);
addArmorTags(TinkerTools.travelersGear, DURABILITY, GOLDEN_ARMOR, DYEABLE, ItemTags.FREEZE_IMMUNE_WEARABLES);
addArmorTags(TinkerTools.plateArmor, DURABILITY, MULTIPART_TOOL);
addArmorTags(TinkerTools.slimesuit, DURABILITY, EMBELLISHMENT_SLIME);
addArmorTags(TinkerTools.slimesuit, DURABILITY, GOLDEN_ARMOR, EMBELLISHMENT_SLIME);
addToolTags(TinkerTools.slimesuit.get(ArmorSlotType.HELMET), MULTIPART_TOOL);

// shields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.setMaxLevel(1).checkTraitLevel()
.setTools(TinkerTags.Items.WORN_ARMOR) // allow salvage on all worn armor
.saveSalvage(consumer, prefix(TinkerModifiers.golden, defenseSalvage))
.setTools(DifferenceIngredient.of(Ingredient.of(TinkerTags.Items.WORN_ARMOR), Ingredient.of(TinkerTools.plateArmor.values().toArray(new ItemLike[0])))) // piglins ignore held items
.setTools(TinkerTags.Items.GOLDEN_ARMOR)
.save(consumer, prefix(TinkerModifiers.golden, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(ModifierIds.turtleShell)
.setInput(Items.SCUTE, 1, 5)
Expand Down

0 comments on commit 1d09f95

Please sign in to comment.