mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-11 23:00:36 +01:00
Fixed /randomenchant
This commit is contained in:
parent
161e0302c9
commit
1ef8c7d0e5
@ -57,7 +57,20 @@ public class CommandRandomenchant extends AbstractCommand {
|
|||||||
if (ecoEnchant.canEnchantItem(itemStack)) {
|
if (ecoEnchant.canEnchantItem(itemStack)) {
|
||||||
if (!ecoEnchant.conflictsWithAny(onItem)) {
|
if (!ecoEnchant.conflictsWithAny(onItem)) {
|
||||||
if (!onItem.stream().anyMatch(enchantment -> enchantment.conflictsWith(ecoEnchant))) {
|
if (!onItem.stream().anyMatch(enchantment -> enchantment.conflictsWith(ecoEnchant))) {
|
||||||
enchant = ecoEnchant;
|
if (!onItem.contains(ecoEnchant)) {
|
||||||
|
boolean conflicts = false;
|
||||||
|
for (Enchantment enchantment : onItem) {
|
||||||
|
if (EcoEnchants.getFromEnchantment(enchantment) != null) {
|
||||||
|
EcoEnchant ecoEnchantOnItem = EcoEnchants.getFromEnchantment(enchantment);
|
||||||
|
if (ecoEnchantOnItem.getType().equals(ecoEnchant.getType()) && ecoEnchantOnItem.getType().isSingular()) {
|
||||||
|
conflicts = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!conflicts) {
|
||||||
|
enchant = ecoEnchant;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user