Basic spells from Hexal#1183
Conversation
IridescentVoid
left a comment
There was a problem hiding this comment.
Looked through the code and left a few comments. Haven't tested functionality in-game yet.
| } | ||
| } | ||
|
|
||
| fun canSilkTouch(level: ServerLevel, pos: BlockPos, state: BlockState, harvestTier: Tier, owner: Entity?): Boolean { |
There was a problem hiding this comment.
Is there no way for us to do this more neatly?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Would it be better to do the recipe lookup in execute and mishap if the item is non-smeltable?
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: