Skip to content

Commit c5175b2

Browse files
committed
Fix wall blocks being replaceable, e.g. by tree growing
Fixes #350
1 parent 018a6a2 commit c5175b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/dave/compactmachines3/block/BlockProtected.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos
5050
return super.canEntityDestroy(state, world, pos, entity);
5151
}
5252

53+
@Override
54+
public boolean isReplaceable(IBlockAccess world, BlockPos pos) {
55+
if(isBlockProtected(world.getBlockState(pos), world, pos)) {
56+
return false;
57+
}
58+
59+
return super.isReplaceable(world, pos);
60+
}
61+
5362
@Override
5463
public boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos) {
5564
if(isBlockProtected(state, world, pos)) {

0 commit comments

Comments
 (0)