mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46:46 +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;
|
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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user