mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 08:09:39 +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;
|
int specificChance = 1;
|
||||||
|
|
||||||
for (Enchantment possibleEnchantment : possibleEnchantments) {
|
for (Enchantment possibleEnchantment : possibleEnchantments) {
|
||||||
boolean conflicts = false;
|
if (!treasureDrop.getItemMeta().hasConflictingEnchant(possibleEnchantment) && Misc.getRandom().nextInt(specificChance) == 0) {
|
||||||
|
|
||||||
for (Enchantment currentEnchantment : treasureDrop.getEnchantments().keySet()) {
|
|
||||||
conflicts = currentEnchantment.conflictsWith(possibleEnchantment);
|
|
||||||
|
|
||||||
if (conflicts) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!conflicts && Misc.getRandom().nextInt(specificChance) == 0) {
|
|
||||||
treasureDrop.addEnchantment(possibleEnchantment, Misc.getRandom().nextInt(possibleEnchantment.getMaxLevel()) + 1);
|
treasureDrop.addEnchantment(possibleEnchantment, Misc.getRandom().nextInt(possibleEnchantment.getMaxLevel()) + 1);
|
||||||
|
|
||||||
specificChance++;
|
specificChance++;
|
||||||
|
Loading…
Reference in New Issue
Block a user