Adds a new enchantmentBlocklist option
The enchantmentBlocklist allows specifying a list of enchantments blacksmiths should be blocked from adding to items. Especially curse of binding and curse of vanishing are problematic as the effect is quite bad. Mending is possibly undesirable as it's supposed to be quite rare.
This commit is contained in:
@ -145,6 +145,13 @@ public class ReforgeSession implements Runnable {
|
||||
usableEnchantments.add(enchantment);
|
||||
}
|
||||
}
|
||||
//Remove any enchantments in the block list
|
||||
usableEnchantments.removeAll(blacksmithTrait.getSettings().getEnchantmentBlocklist());
|
||||
|
||||
//In case all usable enchantments have been blocked, abort
|
||||
if (usableEnchantments.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Choose a random enchantment
|
||||
Enchantment randomEnchantment = usableEnchantments.get(random.nextInt(usableEnchantments.size()));
|
||||
|
Reference in New Issue
Block a user