Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.     public static final PropertyBool TOP = PropertyBool.create("top");
  2.  
  3.     public BlockLivingLamp()
  4.     {
  5.         setDefaultState(blockState.getBaseState().withProperty(TOP, true));
  6.     }
  7.  
  8.     @Override
  9.     protected BlockStateContainer createBlockState()
  10.     {
  11.         return new BlockStateContainer(this, TOP);
  12.     }
  13.  
  14.     @Override
  15.     public int getMetaFromState(IBlockState state)
  16.     {
  17.         return state.getValue(TOP) ? 0 : 1;
  18.     }
  19.  
  20.     @Override
  21.     public IBlockState getStateFromMeta(int meta)
  22.     {
  23.         return getDefaultState().withProperty(TOP, meta == 0);
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement