Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. @Override
  2. public IBlockState getStateFromMeta(int meta)
  3. {
  4. final int facing = (int) (meta / 10.0D);
  5. final int variant = (int) (meta / 10.0D - facing);
  6.  
  7. final EnumType type = EnumType.byMetadata(variant);
  8. final EnumFacing enumFacing = EnumFacing.getHorizontal(facing);
  9.  
  10. return this.getDefaultState().withProperty(VARIANT, type).withProperty(FACING, enumFacing);
  11. }
  12.  
  13. @Override
  14. public int getMetaFromState(@NotNull final IBlockState state)
  15. {
  16. return state.getValue(VARIANT).getMetadata() + (state.getValue(FACING).getHorizontalIndex() * 10);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement