From a260bdf5d0f0eef9da7d4fde7d2cdc139348f1ea Mon Sep 17 00:00:00 2001 From: beholderface <13290805+beholderface@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:14:06 -0400 Subject: [PATCH 1/4] make Erase Item free for most items and much cheaper for non-free items --- Common/src/main/java/at/petrak/hexcasting/api/mod/HexTags.java | 2 ++ .../petrak/hexcasting/common/casting/actions/spells/OpErase.kt | 3 ++- .../at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/api/mod/HexTags.java b/Common/src/main/java/at/petrak/hexcasting/api/mod/HexTags.java index 8b4aa27d7e..552e121fab 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/mod/HexTags.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/mod/HexTags.java @@ -20,6 +20,8 @@ public static final class Items { public static final TagKey GRANTS_ROOT_ADVANCEMENT = create("grants_root_advancement"); public static final TagKey SEAL_MATERIALS = create("seal_materials"); + public static final TagKey COSTLY_TO_ERASE = create("costly_to_erase"); + public static final TagKey IMPETI = create("impeti"); public static final TagKey DIRECTRICES = create("directrices"); public static final TagKey MINDFLAYED_CIRCLE_COMPONENTS = create("brainswept_circle_components"); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpErase.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpErase.kt index 938a57eab9..5aa51c5cb7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpErase.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpErase.kt @@ -6,6 +6,7 @@ import at.petrak.hexcasting.api.casting.eval.CastingEnvironment import at.petrak.hexcasting.api.casting.iota.Iota import at.petrak.hexcasting.api.casting.mishaps.MishapBadOffhandItem import at.petrak.hexcasting.api.misc.MediaConstants +import at.petrak.hexcasting.api.mod.HexTags import at.petrak.hexcasting.xplat.IXplatAbstractions import net.minecraft.world.item.ItemStack @@ -35,7 +36,7 @@ object OpErase : SpellAction { return SpellAction.Result( Spell(handStack), - MediaConstants.DUST_UNIT * handStack.getCount(), + if (handStack.`is`(HexTags.Items.COSTLY_TO_ERASE)) MediaConstants.DUST_UNIT / 8 else 0, listOf(), ) } diff --git a/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java b/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java index 2f97a1209e..0599d43585 100644 --- a/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java +++ b/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java @@ -50,6 +50,9 @@ protected void addTags(HolderLookup.Provider provider) { add(tag(HexTags.Items.SEAL_MATERIALS), Items.HONEYCOMB); + add(tag(HexTags.Items.COSTLY_TO_ERASE), + HexItems.CYPHER.get(), HexItems.TRINKET.get(), HexItems.ARTIFACT.get()); + add(tag(HexTags.Items.PANS), ResourceLocation.fromNamespaceAndPath("farmersdelight", "skillet")); From 8eb51c2d6922245c57370dad9fa5ac02ce001eb1 Mon Sep 17 00:00:00 2001 From: beholderface <13290805+beholderface@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:28:35 -0400 Subject: [PATCH 2/4] update changelog and lang --- CHANGELOG.md | 1 + .../main/resources/assets/hexcasting/lang/en_us.flatten.json5 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee53b95720..631af22d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Changed - The media cost of Impulse now scales linearly rather than quadratically ([#1145](https://github.com/FallingColors/HexMod/pull/1145)) @Robotgiggle +- Erase Item is now free for most items ([#tbd](tbd)) @beholderface ### Fixed diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 index ee3691bbf1..2714d5cfcf 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 @@ -2147,7 +2147,7 @@ "recharge.1": "Recharge a _media-containing item in my other hand. Costs about one $(l:items/amethyst)$(item)Amethyst Shard/$ per item.", "recharge.2": "This spell is cast in a similar method to the crafting spells; an entity representing a dropped stack of $(l:items/amethyst)$(item)Amethyst/$ is provided, and recharges the _media battery of the item in my other hand.$(br2)This spell $(italic)cannot/$ recharge the item farther than its original battery size.", - "erase.1": "Clears _Hex-containing or iota-containing items in my other hand. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$ per item.", + "erase.1": "Clears _Hex-containing or iota-containing items in my other hand. Costs about one-eighth of an $(l:items/amethyst)$(item)Amethyst Dust/$ for casting items, and is free for other items.", "erase.2": "The spell will also void all the _media stored inside the item, releasing it back to Nature and returning the item to a perfectly clean slate. This way, I can re-use $(l:items/hexcasting)$(item)Trinkets/$ I have put an erroneous spell into, for example.$(br2)This also works to clear a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$ page, unsealing them in the process.", }, From 72a621d867a6bd09dec874381dd391f215e43e01 Mon Sep 17 00:00:00 2001 From: beholderface <13290805+beholderface@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:33:42 -0400 Subject: [PATCH 3/4] un-tbd --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 631af22d3c..1c6847ca84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Changed - The media cost of Impulse now scales linearly rather than quadratically ([#1145](https://github.com/FallingColors/HexMod/pull/1145)) @Robotgiggle -- Erase Item is now free for most items ([#tbd](tbd)) @beholderface +- Erase Item is now free for most items ([#1359](https://github.com/FallingColors/HexMod/pull/1359)) @beholderface ### Fixed From fcb68749b15a92706f83dc1c42f3594346846f2e Mon Sep 17 00:00:00 2001 From: Robotgiggle <88736742+Robotgiggle@users.noreply.github.com> Date: Mon, 2 Nov 2026 00:15:53 -0500 Subject: [PATCH 4/4] Run the datagen --- .../data/hexcasting/tags/item/costly_to_erase.json | 7 +++++++ .../resources/assets/hexcasting/lang/en_us.flatten.json5 | 2 +- .../data/hexcasting/tags/item/costly_to_erase.json | 7 +++++++ .../data/hexcasting/tags/item/costly_to_erase.json | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Common/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json create mode 100644 Fabric/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json create mode 100644 Neoforge/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json diff --git a/Common/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json b/Common/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json new file mode 100644 index 0000000000..b18f491a95 --- /dev/null +++ b/Common/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json @@ -0,0 +1,7 @@ +{ + "values": [ + "hexcasting:cypher", + "hexcasting:trinket", + "hexcasting:artifact" + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 index 2714d5cfcf..71d233f864 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 @@ -2147,7 +2147,7 @@ "recharge.1": "Recharge a _media-containing item in my other hand. Costs about one $(l:items/amethyst)$(item)Amethyst Shard/$ per item.", "recharge.2": "This spell is cast in a similar method to the crafting spells; an entity representing a dropped stack of $(l:items/amethyst)$(item)Amethyst/$ is provided, and recharges the _media battery of the item in my other hand.$(br2)This spell $(italic)cannot/$ recharge the item farther than its original battery size.", - "erase.1": "Clears _Hex-containing or iota-containing items in my other hand. Costs about one-eighth of an $(l:items/amethyst)$(item)Amethyst Dust/$ for casting items, and is free for other items.", + "erase.1": "Clears _Hex-containing or iota-containing items in my other hand. Costs about one-eighth of an $(l:items/amethyst)$(item)Amethyst Dust/$ for casting items, and is free for everything else.", "erase.2": "The spell will also void all the _media stored inside the item, releasing it back to Nature and returning the item to a perfectly clean slate. This way, I can re-use $(l:items/hexcasting)$(item)Trinkets/$ I have put an erroneous spell into, for example.$(br2)This also works to clear a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$ page, unsealing them in the process.", }, diff --git a/Fabric/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json b/Fabric/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json new file mode 100644 index 0000000000..b18f491a95 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json @@ -0,0 +1,7 @@ +{ + "values": [ + "hexcasting:cypher", + "hexcasting:trinket", + "hexcasting:artifact" + ] +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json b/Neoforge/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json new file mode 100644 index 0000000000..b18f491a95 --- /dev/null +++ b/Neoforge/src/generated/resources/data/hexcasting/tags/item/costly_to_erase.json @@ -0,0 +1,7 @@ +{ + "values": [ + "hexcasting:cypher", + "hexcasting:trinket", + "hexcasting:artifact" + ] +} \ No newline at end of file