Skip to content

Commit

Permalink
fix and testcode for #108
Browse files Browse the repository at this point in the history
  • Loading branch information
maggi373 committed Oct 19, 2023
1 parent 36c88bb commit 14c280c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/main/java/mekanism/common/block/BlockBounding.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,19 @@ protected boolean canSilkHarvest() {
@Override
@Deprecated
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos) {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock) world.getTileEntity(pos);
if (tileEntity != null) {
tileEntity.onNeighborChange(state.getBlock());
if (world.getTileEntity(pos) instanceof TileEntityBoundingBlock) {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock) world.getTileEntity(pos);
if (tileEntity != null) {
tileEntity.onNeighborChange(state.getBlock());
}
BlockPos mainPos = getMainBlockPos(world, pos);
if (mainPos != null) {
IBlockState state1 = world.getBlockState(mainPos);
state1.getBlock().neighborChanged(state1, world, mainPos, neighborBlock, neighborPos);
}
}
BlockPos mainPos = getMainBlockPos(world, pos);
if (mainPos != null) {
IBlockState state1 = world.getBlockState(mainPos);
state1.getBlock().neighborChanged(state1, world, mainPos, neighborBlock, neighborPos);
else {
System.out.print("\nCant cast exception\n");
}
}

Expand Down

0 comments on commit 14c280c

Please sign in to comment.