From f85de5357b19896a7683c7c066881999253e5700 Mon Sep 17 00:00:00 2001 From: KnightMiner Date: Thu, 2 Feb 2023 21:44:00 -0500 Subject: [PATCH] Fiix some missing checks for the tool having durability for durabillity related stuff --- .../recipes/tools/modifiers/ability/unbreakable.json | 2 +- .../recipes/tools/modifiers/salvage/ability/unbreakable.json | 2 +- .../recipes/tools/modifiers/salvage/upgrade/diamond.json | 2 +- .../recipes/tools/modifiers/salvage/upgrade/emerald.json | 2 +- .../recipes/tools/modifiers/salvage/upgrade/netherite.json | 2 +- .../tconstruct/recipes/tools/modifiers/upgrade/diamond.json | 2 +- .../tconstruct/recipes/tools/modifiers/upgrade/emerald.json | 2 +- .../tconstruct/recipes/tools/modifiers/upgrade/netherite.json | 2 +- .../tconstruct/library/tools/helper/TooltipUtil.java | 2 +- .../tconstruct/tools/data/ModifierRecipeProvider.java | 4 ++++ 10 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/ability/unbreakable.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/ability/unbreakable.json index 1777a2cc9f4..58a7359d0b3 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/ability/unbreakable.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/ability/unbreakable.json @@ -18,7 +18,7 @@ } ], "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "abilities": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/ability/unbreakable.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/ability/unbreakable.json index 44cb7c261aa..ba3e9acbca7 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/ability/unbreakable.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/ability/unbreakable.json @@ -1,7 +1,7 @@ { "type": "tconstruct:modifier_salvage", "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "abilities": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/diamond.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/diamond.json index 42d2c171d8c..4dbd9212c08 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/diamond.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/diamond.json @@ -1,7 +1,7 @@ { "type": "tconstruct:modifier_salvage", "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "upgrades": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/emerald.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/emerald.json index 2c1c74adf0e..34666ca57de 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/emerald.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/emerald.json @@ -1,7 +1,7 @@ { "type": "tconstruct:modifier_salvage", "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "upgrades": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/netherite.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/netherite.json index 05c239be049..0bf35b4dfd6 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/netherite.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/netherite.json @@ -1,7 +1,7 @@ { "type": "tconstruct:modifier_salvage", "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "upgrades": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/diamond.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/diamond.json index c1bedcbb65a..19e7e68c00b 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/diamond.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/diamond.json @@ -6,7 +6,7 @@ } ], "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "upgrades": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/emerald.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/emerald.json index ecccf426a7d..4427ae59e8f 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/emerald.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/emerald.json @@ -6,7 +6,7 @@ } ], "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "upgrades": 1 diff --git a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/netherite.json b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/netherite.json index e48f5f3990a..693ece55f96 100644 --- a/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/netherite.json +++ b/src/generated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/netherite.json @@ -6,7 +6,7 @@ } ], "tools": { - "tag": "tconstruct:modifiable" + "tag": "tconstruct:modifiable/durability" }, "slots": { "upgrades": 1 diff --git a/src/main/java/slimeknights/tconstruct/library/tools/helper/TooltipUtil.java b/src/main/java/slimeknights/tconstruct/library/tools/helper/TooltipUtil.java index 1105a8ab31c..e7ae1374515 100644 --- a/src/main/java/slimeknights/tconstruct/library/tools/helper/TooltipUtil.java +++ b/src/main/java/slimeknights/tconstruct/library/tools/helper/TooltipUtil.java @@ -345,7 +345,7 @@ public static void addModifierNames(ItemStack stack, IToolStackView tool, List 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 diff --git a/src/main/java/slimeknights/tconstruct/tools/data/ModifierRecipeProvider.java b/src/main/java/slimeknights/tconstruct/tools/data/ModifierRecipeProvider.java index 00e517c7c96..844060d1733 100644 --- a/src/main/java/slimeknights/tconstruct/tools/data/ModifierRecipeProvider.java +++ b/src/main/java/slimeknights/tconstruct/tools/data/ModifierRecipeProvider.java @@ -202,12 +202,14 @@ private void addModifierRecipes(Consumer 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) @@ -224,6 +226,7 @@ private void addModifierRecipes(Consumer 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) @@ -1281,6 +1284,7 @@ private void addModifierRecipes(Consumer consumer) { // unbreakable ModifierRecipeBuilder.modifier(TinkerModifiers.unbreakable) + .setTools(TinkerTags.Items.DURABILITY) .addInput(Items.SHULKER_SHELL) .addInput(Items.DRAGON_BREATH) .addInput(Items.SHULKER_SHELL)