Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1.     // For Slime Blocks
  2.     private boolean addBranchingBlocks(BlockPos pos)
  3.     {
  4.         for (EnumFacing enumfacing : EnumFacing.values()) {
  5.             if (enumfacing.getAxis() != this.moveDirection.getAxis() && !this.addBlockLine(pos.offset(enumfacing), enumfacing)) return false;
  6.         }
  7.         return true;
  8.     }
  9.    
  10.     // For Half Slime Blocks
  11.     private boolean addHalfBranchingBlocks(BlockPos pos)
  12.     {
  13.         EnumFacing facing = ModulePistons.HALF_SLIME.getDirectionFacing(world, pos);
  14.         for (EnumFacing enumfacing : EnumFacing.values())
  15.         {
  16.             if (enumfacing.getAxis() != this.moveDirection.getAxis() && enumfacing != facing.getOpposite())
  17.             {
  18.                 if (enumfacing == facing) {
  19.                     if (!this.addBlockLine(pos.offset(enumfacing), enumfacing)) return false;
  20.                 }
  21.                 else
  22.                 {
  23.                     IBlockState test_state = this.world.getBlockState(pos.offset(enumfacing));
  24.                     Block test = test_state.getBlock();
  25.                     if (test == Blocks.SLIME_BLOCK && !this.addBlockLine(pos.offset(enumfacing), enumfacing)) return false;
  26.                     if (test == ModulePistons.HALF_SLIME && ModulePistons.HALF_SLIME.getDirectionFacing(test_state) != enumfacing) {
  27.                         if (!this.addBlockLine(pos.offset(enumfacing), facing)) return false;
  28.                     }
  29.                 }
  30.             }
  31.         }
  32.         return true;
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement