Merge pull request #3330 from hoorigan/ench-book-fixes

Enchanted book fixes
This commit is contained in:
t00thpick1 2018-04-28 20:04:06 -04:00 committed by GitHub
commit 2b159adefd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -586,6 +586,11 @@ public class FishingManager extends SkillManager {
double dropRate = TreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
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);
break;
}

View File

@ -503,6 +503,7 @@ public final class ItemUtils {
*/
public static boolean isEnchantable(ItemStack item) {
switch (item.getType()) {
case ENCHANTED_BOOK:
case SHEARS:
case FISHING_ROD:
case CARROT_STICK: