Skip to content

Commit

Permalink
Tweaked loot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackJar72 committed Dec 18, 2018
1 parent 14dd1e8 commit 4f3ccdb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions java/jaredbgreat/dldungeons/pieces/chests/LootCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ public static ItemStack getLoot(LootType type, int level, Random random) {
if(level < 0) level = 0;
switch(type) {
case GEAR:
if(level > 6) level = 6;
if(random.nextBoolean()) {
return getEnchantedGear(level, random);
} else {
return gear.levels[level].getLoot(random).getStack(random);
return gear.levels[Math.min(6, level)].getLoot(random).getStack(random);
}
case HEAL:
if(level > 6) level = 6;
return heal.levels[level].getLoot(random).getStack(random);
return heal.levels[Math.min(6, level)].getLoot(random).getStack(random);
case LOOT:
if(level > 6) {
if(level > random.nextInt(100)) {
Expand Down Expand Up @@ -152,7 +150,7 @@ private static ItemStack getEnchantedGear(int lootLevel, Random random) {
out = item.getStack(random);
out = EnchantmentHelper.addRandomEnchantment(random, out, enchPart, true);
} else {
out = gear.levels[lootLevel].getLoot(random).getStack(random);
out = gear.levels[Math.min(6, lootLevel)].getLoot(random).getStack(random);
}
return out;
}
Expand Down

0 comments on commit 4f3ccdb

Please sign in to comment.