Advertisement
TechMage66

setBlockBoundsBasedOnState

May 27th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. @Override
  2. public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
  3. {
  4.     if (worldIn.getBlockState(pos).getValue(DOUBLE))
  5.     {
  6.         EnumFacing facing = worldIn.getBlockState(pos).getValue(FACING);
  7.  
  8.         switch (facing)
  9.         {
  10.             case NORTH:
  11.                 this.setBlockBounds(0.05F, 0F, 0F, 0.95F, 0.95F, 0.95F);
  12.                 break;
  13.             case EAST:
  14.                 this.setBlockBounds(0.05F, 0F, 0.05F, 1F, 0.95F, 0.95F);
  15.                 break;
  16.             case SOUTH:
  17.                 this.setBlockBounds(0.05F, 0F, 0.05F, 0.95F, 0.95F, 1F);
  18.                 break;
  19.             case WEST:
  20.                 this.setBlockBounds(0F, 0F, 0.05F, 0.95F, 0.95F, 0.95F);
  21.                 break;
  22.         }
  23.     }
  24.  
  25.     this.setBlockBounds(0.05F, 0F, 0.05F, 0.95F, 0.95F, 0.95F);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement