Advertisement
SirPuli

Untitled

Jun 1st, 2020
1,219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | None | 0 0
  1. public static boolean doDecay(ServerWorld worldIn, BlockPos pos, Block block, int distance){
  2.         BlockState[] blockStates = new BlockState[] {
  3.                 worldIn.getBlockState(pos.down().north()),
  4.                 worldIn.getBlockState(pos.down().east()),
  5.                 worldIn.getBlockState(pos.down().south()),
  6.                 worldIn.getBlockState(pos.down().west()),
  7.                 worldIn.getBlockState(pos.up().north()),
  8.                 worldIn.getBlockState(pos.up().east()),
  9.                 worldIn.getBlockState(pos.up().south()),
  10.                 worldIn.getBlockState(pos.up().west()),
  11.  
  12.                 worldIn.getBlockState(pos.down().north().east()),
  13.                 worldIn.getBlockState(pos.down().north().west()),
  14.                 worldIn.getBlockState(pos.down().south().east()),
  15.                 worldIn.getBlockState(pos.down().south().west()),
  16.                 worldIn.getBlockState(pos.up().north().east()),
  17.                 worldIn.getBlockState(pos.up().north().west()),
  18.                 worldIn.getBlockState(pos.up().south().east()),
  19.                 worldIn.getBlockState(pos.up().south().west()),
  20.  
  21.                 worldIn.getBlockState(pos.north().east()),
  22.                 worldIn.getBlockState(pos.north().west()),
  23.                 worldIn.getBlockState(pos.south().east()),
  24.                 worldIn.getBlockState(pos.south().west())
  25.         };
  26.         for (BlockState blockState : blockStates){
  27.             if (blockState.getBlock() == block && !blockState.get(BlockStateProperties.PERSISTENT) && blockState.get(BlockStateProperties.DISTANCE_1_7) == distance - 1)
  28.                 return true;
  29.         }
  30.         return false;
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement