Fixed Carrots and Potatoes not dropping
This commit is contained in:
parent
bb305e9470
commit
1253b6cc9f
1 changed files with 14 additions and 7 deletions
|
@ -3,6 +3,7 @@ package alisolarflare.components.fruit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
|
@ -18,20 +19,26 @@ public class GrassBreakListener implements Listener {
|
||||||
Location location = event.getBlock().getLocation();
|
Location location = event.getBlock().getLocation();
|
||||||
World world = event.getBlock().getWorld();
|
World world = event.getBlock().getWorld();
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (Math.random() > 0.05){
|
||||||
|
switch(world.getBiome(location.getBlockX(), location.getBlockZ())){
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
switch((int) (Math.random()* 100)){
|
switch((int) (Math.random()* 100)){
|
||||||
case 1: // 2% chance
|
case 1: // 1% chance
|
||||||
world.dropItem(location, new ItemStack(Material.CARROT));
|
world.dropItem(location, new ItemStack(Material.CARROT_ITEM));
|
||||||
break;
|
break;
|
||||||
case 2: // 2% chance
|
case 2: // 1% chance
|
||||||
world.dropItem(location, new ItemStack(Material.BEETROOT_SEEDS));
|
world.dropItem(location, new ItemStack(Material.BEETROOT_SEEDS));
|
||||||
break;
|
break;
|
||||||
case 3: // 2% chance
|
case 3: // 1% chance
|
||||||
world.dropItem(location, new ItemStack(Material.POTATO));
|
world.dropItem(location, new ItemStack(Material.POTATO_ITEM));
|
||||||
break;
|
break;
|
||||||
case 4: // 2% chance
|
case 4: // 1% chance
|
||||||
world.dropItem(location, new ItemStack(Material.FEATHER));
|
world.dropItem(location, new ItemStack(Material.FEATHER));
|
||||||
break;
|
break;
|
||||||
case 5: // 2% chance
|
case 5: // 1% chance
|
||||||
world.dropItem(location, new ItemStack(Material.YELLOW_FLOWER));
|
world.dropItem(location, new ItemStack(Material.YELLOW_FLOWER));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue