mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fixed bug with Hylian Luck when there are no treasures enabled.
This commit is contained in:
parent
b048cc1e55
commit
2888fdff9e
@ -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"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user