Advertisement
Guest User

Untitled

a guest
May 19th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1.  
  2. public class NewSlab extends Block
  3. {
  4.  
  5. public NewSlab(Material materialIn) {
  6. super(materialIn);
  7. }
  8. public static final PropertyEnum<BlockSlab.EnumBlockHalf> HALF = PropertyEnum.<BlockSlab.EnumBlockHalf>create("half", BlockSlab.EnumBlockHalf.class);
  9. protected static final AxisAlignedBB AABB_BOTTOM_HALF = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D);
  10. protected static final AxisAlignedBB AABB_TOP_HALF = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D);
  11. public boolean isDouble()
  12. {
  13. return false;
  14. }
  15. public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
  16. {
  17. return this.isDouble() ? FULL_BLOCK_AABB : (state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP ? AABB_TOP_HALF : AABB_BOTTOM_HALF);
  18. }
  19. public boolean isFullyOpaque(IBlockState state)
  20. {
  21. return ((BlockSlab)state.getBlock()).isDouble() || state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP;
  22. }
  23. {
  24. this.setHarvestLevel("pickaxe", 1);
  25. this.setHardness(1.5F);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement