mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Use new hasConflictingEnchant method.
This commit is contained in:
parent
ce08405c00
commit
d4c8cc28a1
@ -263,17 +263,7 @@ public class FishingManager extends SkillManager {
|
||||
int specificChance = 1;
|
||||
|
||||
for (Enchantment possibleEnchantment : possibleEnchantments) {
|
||||
boolean conflicts = false;
|
||||
|
||||
for (Enchantment currentEnchantment : treasureDrop.getEnchantments().keySet()) {
|
||||
conflicts = currentEnchantment.conflictsWith(possibleEnchantment);
|
||||
|
||||
if (conflicts) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!conflicts && Misc.getRandom().nextInt(specificChance) == 0) {
|
||||
if (!treasureDrop.getItemMeta().hasConflictingEnchant(possibleEnchantment) && Misc.getRandom().nextInt(specificChance) == 0) {
|
||||
treasureDrop.addEnchantment(possibleEnchantment, Misc.getRandom().nextInt(possibleEnchantment.getMaxLevel()) + 1);
|
||||
|
||||
specificChance++;
|
||||
|
Loading…
Reference in New Issue
Block a user