Added initial support for hard cap
This commit is contained in:
@@ -130,6 +130,11 @@ public class AnvilMerge {
|
||||
if(left.getItemMeta() instanceof EnchantmentStorageMeta) canEnchantItem = true;
|
||||
|
||||
if(canEnchantItem && !doesConflict.get()) {
|
||||
if(ConfigManager.getConfig().getBool("anvil.hard-cap.enabled")) {
|
||||
if(outEnchants.size() > ConfigManager.getConfig().getInt("anvil.hard-cap.cap")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
outEnchants.put(enchantment, integer);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -14,6 +14,10 @@ anvil:
|
||||
enabled: true # Use exponent
|
||||
exponent: 0.95 # Exponent. Beware that slight changes to this value may cause huge changes in cost.
|
||||
|
||||
hard-cap: # Completely limit the amount of enchantments that can be placed on an item
|
||||
enabled: false # Enable a hard cap
|
||||
cap: 10 # Most enchantments allowed on an item
|
||||
|
||||
lore:
|
||||
use-numerals: true
|
||||
use-numbers-above-threshold: 10 #After level 10, enchantments will display as Name Number, eg: Sharpness 25 instead of Sharpness XXV
|
||||
|
||||
Reference in New Issue
Block a user