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;
}
int dropNumber = Misc.getRandom().nextInt(treasures.size());
ItemStack item = treasures.get(dropNumber).getDrop();
Location location = block.getLocation();
if (treasures.isEmpty()) {
return;
}
event.setCancelled(true);
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"));
}
}