MineColonies

MineColonies

53M Downloads

Builder Mining Snow Block does not Update Dirt/Gras Block below it.

ppvolto opened this issue ยท 2 comments

commented

Prerequisites

  • I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
  • I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
  • I made sure that this issue is not a duplicate of any existing issue.

Context

  • Minecraft Version: 1.16.5-forge-36.0.46
  • MineColonies Version: >= 0.14.97-ALPHA
  • Structurize Version: 0.13.136-ALPHA
  • Related Mods and their Versions: None

Expected behavior

Builder "Mines" a Snow Block on top of a Snowy Dirt/Grass Block and changes the snowy=true to snowy=false

Actual behavior

Builder "Mines" a Snow Block on top of a Snowy Dirt/Grass Block don't changes the snowy state to false

grafik

Notes

Resolved with a Test rewrite of
Rewriting the triggerMinedBlock Funtion for the EntityAIStructireBuilder and AbstractEntityAIInteract to:

AbstractEntityAIInteract

protected void triggerMinedBlock(@NotNull final BlockPos blockToMine, @NotNull final BlockState blockState)
{
      
}

AbstractEntityAIInteract

@Override
protected void triggerMinedBlock(@NotNull final BlockPos blockToMine, @NotNull final BlockState curBlockState)
{
    super.triggerMinedBlock(blockToMine, curBlockState);
    if (curBlockState.getBlock() instanceof SnowBlock) {
        BlockPos snowyBlockPos = blockToMine.down();
        BlockState snowyState = world.getBlockState(blockToMine.down());
        if (snowyState.hasProperty(SnowyDirtBlock.SNOWY)) {
            world.setBlockState(snowyBlockPos, snowyState.with(SnowyDirtBlock.SNOWY, Boolean.valueOf(false)), 2);
        }
    }
}

Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.
commented

If you resolved it, a PR would be welcome :D

commented

I am not a Good Coder and what edge cases there are for that Part of the Code that's why i have added a "working" snipped for the Devs ๐Ÿ˜„