Skip to content

Commit

Permalink
Some additional solid checks (#713)
Browse files Browse the repository at this point in the history
Check if not replaceable/no collision for solidness too
  • Loading branch information
Raycoms committed Dec 8, 2024
1 parent c130078 commit e3b3336
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/ldtteam/structurize/util/BlockUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static void checkOrInit()
ForgeRegistries.BLOCKS.getValues()
.stream()
.filter(BlockUtils::canBlockSurviveWithoutSupport)
.filter(block -> !block.defaultBlockState().isAir() && !(block instanceof LiquidBlock) && !block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS))
.filter(block -> !block.defaultBlockState().canBeReplaced() && block.hasCollision && !block.defaultBlockState().isAir() && !(block instanceof LiquidBlock) && !block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS))
.forEach(trueSolidBlocks::add);
}
}
Expand Down Expand Up @@ -836,6 +836,11 @@ public static boolean isWeakSolidBlock(final BlockState blockState)
return leaves.isRandomlyTicking(blockState);
}

if (blockState.canBeReplaced() || !blockState.getBlock().hasCollision)
{
return false;
}

final Block block = blockState.getBlock();
return block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS) && canBlockSurviveWithoutSupport(block);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ public net.minecraft.world.level.levelgen.SurfaceRules$SurfaceRule

# keybinds
public net.minecraft.client.KeyMapping f_90818_ # clickCount

public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60884_ # hasCollision

0 comments on commit e3b3336

Please sign in to comment.