1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

fix: add missing judge in getRandomEnchantment

This commit is contained in:
StarWishsama 2021-01-24 11:01:42 +08:00
parent 9e49071161
commit 8302c0c932

View File

@ -75,7 +75,7 @@ public class MagicianTalisman extends Talisman {
// @formatter:off // @formatter:off
List<TalismanEnchantment> enabled = enchantments.stream() List<TalismanEnchantment> enabled = enchantments.stream()
.filter(e -> item.getType() == Material.BOOK || e.getEnchantment().canEnchantItem(item)) .filter(e -> (isAllowEnchantBook().getValue() && item.getType() == Material.BOOK) || e.getEnchantment().canEnchantItem(item))
.filter(e -> hasConflicts(existingEnchantments, e)) .filter(e -> hasConflicts(existingEnchantments, e))
.filter(TalismanEnchantment::getValue) .filter(TalismanEnchantment::getValue)
.collect(Collectors.toList()); .collect(Collectors.toList());