FishingManager: force enchant on enchanted book

Added a small conditional to ensure that enchanted books get an enchantment.
This commit is contained in:
hoorigan 2017-10-31 16:45:08 -04:00 committed by GitHub
parent 307d483323
commit 6d5ab0edda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,6 +572,11 @@ public class FishingManager extends SkillManager {
double dropRate = TreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity); double dropRate = TreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
if (diceRoll <= dropRate) { if (diceRoll <= dropRate) {
// Make sure enchanted books always get some kind of enchantment. --hoorigan
if (treasureDrop.getType() == Material.ENCHANTED_BOOK) {
diceRoll = dropRate + 1;
continue;
}
fishingEnchantments = TreasureConfig.getInstance().fishingEnchantments.get(rarity); fishingEnchantments = TreasureConfig.getInstance().fishingEnchantments.get(rarity);
break; break;
} }