Advertisement
HalestormXV

Untitled

Sep 1st, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1.     @Override
  2.     public IBlockState getStateFromMeta(int meta)
  3.     {
  4.         boolean blockIsActive = (meta & 7) > 2;
  5.  
  6.         EnumFacing facing = EnumFacing.getFront(meta);
  7.         if(facing.getAxis() == EnumFacing.Axis.Y)
  8.             facing = EnumFacing.NORTH;
  9.  
  10.         return this.getDefaultState().withProperty(FACING, facing).withProperty(BURNING, blockIsActive);
  11.     }
  12.  
  13.     @Override
  14.     public int getMetaFromState(IBlockState state)
  15.     {
  16.         int blockIsActive = (state.getValue(BURNING) ? 1 : 0) << 1;
  17.         int facingDirection = ((EnumFacing)state.getValue(FACING)).getIndex();
  18.         return blockIsActive | facingDirection;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement