Advertisement
Guest User

Untitled

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