TheWinABagel / Zenith

An unofficial fabric port of Apotheosis
https://www.curseforge.com/minecraft/mc-mods/zenith
MIT License
16 stars 19 forks source link

[Bug] Anvil losts enchantments when damaged #108

Closed Phoupraw closed 8 months ago

Phoupraw commented 8 months ago

Steps to reproduce

  1. Enchanted an avnil.
  2. Place it.
  3. Use it until it's damaged.
  4. Found its enchantment lost.

Potential Solution

//AnvilBlockMixin
@Override
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
    if (!newState.is(BlockTags.ANVIL)) {
        super.onRemove(state, world, pos, newState, moved);
    }
}
TheWinABagel commented 8 months ago

Fixed with 1.0.5