As we disable capabilities when a side config has them disabled we need to notify the neighbor of an update when a side's config changes. (#5426)

This commit is contained in:
Richard Freimer authored and GitHub committed 2019-04-22 14:20:40 -04:00
1 parent 14bd97e435
commit 03cc33f501
2 files changed
+31 -21

No files matched your search

@@ -479,6 +479,20 @@ public final class MekanismUtils {
state.neighborChanged(world, coord.getPos(), world.getBlockState(fromPos).getBlock(), fromPos);
}
/**
* Calls BOTH neighbour changed functions because nobody can decide on which one to implement.
*
* @param world world the change exists in
* @param neighborSide The side the neighbor to notify is on
* @param fromPos pos of our block that updated
*/
public static void notifyNeighborOfChange(World world, EnumFacing neighborSide, BlockPos fromPos) {
BlockPos neighbor = fromPos.offset(neighborSide);
IBlockState state = world.getBlockState(neighbor);
state.getBlock().onNeighborChange(world, neighbor, fromPos);
state.neighborChanged(world, neighbor, world.getBlockState(fromPos).getBlock(), fromPos);
}
/**
* Places a fake bounding block at the defined location.
*