Advertisement
Guest User

Untitled

a guest
Feb 19th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. public class BlockHarvestableFireberryBush extends BlockTemplate
  2. {
  3.     public BlockHarvestableFireberryBush(String itemName)
  4.     {
  5.         super(itemName, Material.leaves);
  6.         setCreativeTab(Pyromancy.tabPyromancy);
  7.         setStepSound(soundTypeGrass);
  8.         setBlockBounds(0.1F, 0.0F, 0.1F, 0.9F, 1.0F, 0.9F);
  9.     }
  10.  
  11.     @SideOnly(Side.CLIENT)
  12.     public EnumWorldBlockLayer getBlockLayer()
  13.     {
  14.         return EnumWorldBlockLayer.CUTOUT_MIPPED;
  15.     }
  16.  
  17.     @Override
  18.     public boolean isOpaqueCube()
  19.     {
  20.         return false;
  21.     }
  22.  
  23.     @Override
  24.     public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
  25.     {
  26.         world.playSoundEffect(hitX, hitY, hitZ, "random.pop", 0.4F, player.getRNG().nextFloat() + 0.8F);
  27.         player.inventory.addItemStackToInventory(new ItemStack(ItemRegistry.fireBerry, 3));
  28.         world.setBlockState(pos, BlockRegistry.fireberryBush.getDefaultState());
  29.         return true;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement