Skip to content

Basic spells from Hexal#1183

Open
Robotgiggle wants to merge 17 commits into
1.21from
hexal-spells
Open

Basic spells from Hexal#1183
Robotgiggle wants to merge 17 commits into
1.21from
hexal-spells

Conversation

@Robotgiggle

@Robotgiggle Robotgiggle commented Jun 30, 2026

Copy link
Copy Markdown
Member

Brings Smelt, Freeze, Falling Block, Particles, and Factorial Purification from Hexal into the base mod. This was discussed a while ago, during the 1.20 port, but it never really went anywhere. Now that we're porting again, and Hexal itself has been absorbed into the FallingColors organization, I think we should go ahead and do this.

There are two main motivations for this:

  • These spells don't really fit with any of the main mechanics Hexal adds (wisps, links, and motes)
  • There have been complaints that the base mod doesn't have enough useful spells, which this helps resolve

@IridescentVoid IridescentVoid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through the code and left a few comments. Haven't tested functionality in-game yet.

Comment thread Common/src/main/java/at/petrak/hexcasting/api/utils/HexUtils.kt Outdated
}
}

fun canSilkTouch(level: ServerLevel, pos: BlockPos, state: BlockState, harvestTier: Tier, owner: Entity?): Boolean {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way for us to do this more neatly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to trim a little bit out, but not very much. I don't think there's any way around this general implementation concept, unless we do what Ars does and just use a blacklist tag instead - but then any mod that wants to be immune has to manually add their stuff to that tag, rather than having it automatically detected.

The reason it's so involved in the first place is that we need to account for the various instances where a block will not drop itself, even with silk touch, unless you also have the right tool and/or the right mining tier.


private data class ItemSpell(val itemEntity: ItemEntity) : RenderedSpell {
override fun cast(env: CastingEnvironment) {
val result = smeltResult(itemEntity.item.item, env) ?: return // cursed .item.item to map from ItemEntity to ItemLike to ItemStack

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to do the recipe lookup in execute and mishap if the item is non-smeltable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

2 participants