Blood Magic

Blood Magic

94M Downloads

Soft Coating doesn't fully work as silk touch

MuteTiefling opened this issue · 3 comments

commented

Issue Description:

Soft Coating doesn't truly apply silk touch, so things like Apotheosis that are checking for it, don't trigger. Meaning a Soft Coating tool can't harvest a spawner even though Apotheosis allows it normally.

What happens:

Spawner Breaks

What you expected to happen:

Spawner is harvested

Steps to reproduce:

  1. Apply Soft Coating
  2. Break Spawner
  3. Be sad
    ...

Affected Versions (Do not use "latest"):

  • BloodMagic: BloodMagic-1.16.4-3.1.10-31
  • Minecraft: 1.16.5
  • Forge: 36.2.34
  • Apotheosis: Apotheosis-1.16.5-4.8.99F

Relevant issue in our tracker: EnigmaticaModpacks/Enigmatica6#4992
Relevant check in Apotheosis: EnigmaticaModpacks/Enigmatica6#4992 (comment)

commented

Hmm, interesting. I'll look more into what checks are happening that would be bypassed, between both your mod and mine. In order to apply Silk Touch to blocks that are harvested using the "Soft Coating", I implement a LootModifier. It checks if the harvesting tool has the anointment, and if it does it creates a copy of the harvesting tool's ItemStack and applies Silk Touch to it. It then regenerates the loot table of the block and returns the new loot table.

The relevant code in Blood Magic is here:

public List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context)

commented

I am not a specialist in mods, but maybe this is what happening:
Spawner in world don't have Loot Table, because it's empty. Apotheosis adding check to spawner itself, if someone breaking it with item with Silk Touch then spawning 'new' kind of spawner block.

So maybe there is a way to little rework Coating, to applying on tool 'vanilla' temporary status as Silk Touch enchant has?

I totally didn't check a code, but only thinking on loud. Because I lost one spawner when discovered this bug ;D

commented

This might be very difficult to emulate accurately in 1.18-. In 1.19 forge added a new system for providing fake enchantments to items, so it should be easily resolvable then.