Fixed #537 crash from maps updating too soon

This commit is contained in:
LemADEC 2023-07-30 16:04:29 +02:00
parent 2adb8c2c50
commit 474c756442

View file

@ -98,7 +98,8 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR
public MapColor getMapColor(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) { public MapColor getMapColor(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) {
final IExtendedBlockState blockStateExtended = (IExtendedBlockState) getExtendedState(blockState, blockAccess, blockPos); final IExtendedBlockState blockStateExtended = (IExtendedBlockState) getExtendedState(blockState, blockAccess, blockPos);
final IBlockState blockStateCamouflage = blockStateExtended.getValue(BlockProperties.CAMOUFLAGE); final IBlockState blockStateCamouflage = blockStateExtended.getValue(BlockProperties.CAMOUFLAGE);
if (blockStateCamouflage != Blocks.AIR) { if ( blockStateCamouflage != null
&& blockStateCamouflage.getBlock() != Blocks.AIR ) {
try { try {
return blockStateCamouflage.getMapColor(blockAccess, blockPos); return blockStateCamouflage.getMapColor(blockAccess, blockPos);
} catch (final Exception exception) { } catch (final Exception exception) {