mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
If the treasure is an enchanted book, enchant it.
Added a bit of logic to check and see if the drop is an enchanted book, and if it is, force at least one enchantment to be applied. As a warning, I'm not a programmer, so I could have incorrectly used the continue statement here. This requires more experienced eyes and some testing, I'm sure.
This commit is contained in:
parent
307d483323
commit
ec20d69feb
@ -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;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
fishingEnchantments = TreasureConfig.getInstance().fishingEnchantments.get(rarity);
|
fishingEnchantments = TreasureConfig.getInstance().fishingEnchantments.get(rarity);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user