Builder Mining Snow Block does not Update Dirt/Gras Block below it.
ppvolto opened this issue ยท 2 comments
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
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.