Fixed bug with Hylian Luck when there are no treasures enabled.

This commit is contained in:
GJ 2013-02-03 13:31:13 -05:00
parent b048cc1e55
commit 2888fdff9e

View File

@ -373,13 +373,13 @@ public class Herbalism {
return; return;
} }
int dropNumber = Misc.getRandom().nextInt(treasures.size()); if (treasures.isEmpty()) {
ItemStack item = treasures.get(dropNumber).getDrop(); return;
Location location = block.getLocation(); }
event.setCancelled(true); event.setCancelled(true);
event.getBlock().setType(Material.AIR); event.getBlock().setType(Material.AIR);
Misc.dropItem(location, item); Misc.dropItem(block.getLocation(), treasures.get(Misc.getRandom().nextInt(treasures.size())).getDrop());
player.sendMessage(LocaleLoader.getString("Herbalism.HylianLuck")); player.sendMessage(LocaleLoader.getString("Herbalism.HylianLuck"));
} }
} }