From 4f3ccdb8944892fd48fec2981e70ce70c356f917 Mon Sep 17 00:00:00 2001 From: "Jared Blackburn (JaredBGreat)" Date: Tue, 18 Dec 2018 14:49:41 -0500 Subject: [PATCH] Tweaked loot fixes --- .../dldungeons/pieces/chests/LootCategory.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/java/jaredbgreat/dldungeons/pieces/chests/LootCategory.java b/java/jaredbgreat/dldungeons/pieces/chests/LootCategory.java index 17147e5..b823203 100644 --- a/java/jaredbgreat/dldungeons/pieces/chests/LootCategory.java +++ b/java/jaredbgreat/dldungeons/pieces/chests/LootCategory.java @@ -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)) { @@ -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; }