Skip to content

Commit

Permalink
Fixes issue with no chest items in config.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Mar 12, 2020
1 parent a083a45 commit 4a81a22
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ private void setChest(Block b, Random random, World world) {
slt.reset();
switch (b.getWorld().getEnvironment()) {
case NETHER:
for (int i = 0; i < addon.getSettings().getChestFillNether() && i < 27; i ++) {
for (int i = 0; chestItemsNether.size() > 0 && i < addon.getSettings().getChestFillNether() && i < 27; i ++) {
ItemStack item = new ItemStack(this.chestItemsNether.get(random.nextInt(chestItemsNether.size())));
inv.setItem(slt.next(), item);
}
break;
case THE_END:
for (int i = 0; i < addon.getSettings().getChestFillEnd() && i < 27; i ++) {
for (int i = 0; chestItemsEnd.size() > 0 && i < addon.getSettings().getChestFillEnd() && i < 27; i ++) {
ItemStack item = new ItemStack(this.chestItemsEnd.get(random.nextInt(chestItemsEnd.size())));
inv.setItem(slt.next(), item);
}
break;
default:
for (int i = 0; i < addon.getSettings().getChestFill() && i < 27; i ++) {
for (int i = 0; chestItemsWorld.size() > 0 && i < addon.getSettings().getChestFill() && i < 27; i ++) {
ItemStack item = new ItemStack(this.chestItemsWorld.get(random.nextInt(chestItemsWorld.size())));
inv.setItem(slt.next(), item);
}
Expand Down

0 comments on commit 4a81a22

Please sign in to comment.