Java Code Examples for org.bukkit.Material#MELON_BLOCK

The following examples show how to use org.bukkit.Material#MELON_BLOCK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Miner.java    From AnnihilationPro with MIT License 6 votes vote down vote up
@AnnihilationEvent
public void onResourceBreak(ResourceBreakEvent event)
{
	if(event.getPlayer().getKit().equals(this))
	{
		if(event.getResource().Type != Material.LOG && event.getResource().Type != Material.MELON_BLOCK && event.getResource().Type != Material.GRAVEL)
		{
			ItemStack[] products = event.getProducts();
			if(products != null)
			{
				for(int x = 0; x < products.length; x++)
				{
					boolean y = rand.nextBoolean();
					if(y)
						products[x].setAmount(products[x].getAmount()*2);
				}
			}
			event.setProducts(products);	
		}
	}
}