Use new hasConflictingEnchant method.

This commit is contained in:
GJ 2013-04-04 22:26:48 -04:00
parent ce08405c00
commit d4c8cc28a1

View File

@ -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++;