Skip to content

Commit

Permalink
Fiix some missing checks for the tool having durability for durabilli…
Browse files Browse the repository at this point in the history
…ty related stuff
  • Loading branch information
KnightMiner committed Feb 3, 2023
1 parent c59da4d commit f85de53
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"abilities": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"abilities": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"tools": {
"tag": "tconstruct:modifiable"
"tag": "tconstruct:modifiable/durability"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public static void addModifierNames(ItemStack stack, IToolStackView tool, List<C
*/
public static void getDefaultInfo(ItemStack stack, IToolStackView tool, List<Component> tooltips) {
// shows as broken when broken, hold shift for proper durability
if (tool.getItem().canBeDepleted() && !tool.isUnbreakable()) {
if (tool.getItem().canBeDepleted() && !tool.isUnbreakable() && tool.hasTag(TinkerTags.Items.DURABILITY)) {
tooltips.add(TooltipBuilder.formatDurability(tool.getCurrentDurability(), tool.getStats().getInt(ToolStats.DURABILITY), true));
}
// modifier tooltip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.save(consumer, prefix(TinkerModifiers.overforced, upgradeFolder));
// gems are special, I'd like them to be useful on all types of tools
ModifierRecipeBuilder.modifier(ModifierIds.emerald)
.setTools(TinkerTags.Items.DURABILITY)
.addInput(Tags.Items.GEMS_EMERALD)
.setMaxLevel(1)
.setSlots(SlotType.UPGRADE, 1)
.saveSalvage(consumer, prefix(ModifierIds.emerald, upgradeSalvage))
.save(consumer, prefix(ModifierIds.emerald, upgradeFolder));
ModifierRecipeBuilder.modifier(ModifierIds.diamond)
.setTools(TinkerTags.Items.DURABILITY)
.addInput(Tags.Items.GEMS_DIAMOND)
.setMaxLevel(1)
.setSlots(SlotType.UPGRADE, 1)
Expand All @@ -224,6 +226,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.saveSalvage(consumer, prefix(TinkerModifiers.soulbound, upgradeSalvage))
.save(consumer, prefix(TinkerModifiers.soulbound, upgradeFolder));
ModifierRecipeBuilder.modifier(ModifierIds.netherite)
.setTools(TinkerTags.Items.DURABILITY)
.addInput(Tags.Items.INGOTS_NETHERITE)
.setMaxLevel(1)
.setSlots(SlotType.UPGRADE, 1)
Expand Down Expand Up @@ -1281,6 +1284,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {

// unbreakable
ModifierRecipeBuilder.modifier(TinkerModifiers.unbreakable)
.setTools(TinkerTags.Items.DURABILITY)
.addInput(Items.SHULKER_SHELL)
.addInput(Items.DRAGON_BREATH)
.addInput(Items.SHULKER_SHELL)
Expand Down

0 comments on commit f85de53

Please sign in to comment.