Advertisement
Guest User

Untitled

a guest
Feb 19th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. public class BlockHarvestableFireberryBush extends Block
  2. {
  3.     public BlockHarvestableFireberryBush(String itemName)
  4.     {
  5.         super(Material.leaves);
  6.         setBlockName(Reference.MODID + "_" + itemName);
  7.         setCreativeTab(Pyromancy.tabPyromancy);
  8.         setStepSound(soundTypeGrass);
  9.         setBlockTextureName(Reference.MODID + ":" + itemName);
  10.         setBlockBounds(0.1F, 0.0F, 0.1F, 0.9F, 1.0F, 0.9F);
  11.     }
  12.  
  13.     @Override
  14.     public boolean isOpaqueCube()
  15.     {
  16.         return false;
  17.     }
  18.  
  19.     @Override
  20.     public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
  21.     {
  22.         world.playSoundEffect(x, y, z, "random.pop", 0.4F, player.getRNG().nextFloat() + 0.8F);
  23.         player.inventory.addItemStackToInventory(new ItemStack(Pyromancy.fireBerry, 3));
  24.         world.setBlock(x,y,z, Pyromancy.fireberryBush);
  25.         return true;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement