Add AnvilView#bypassEnchantmentLevelRestriction
Anvils, by default, limit applied enchantment levels to their respective maximum level. The added API enables plugins to disable this behaviour, allowing enchantments that are overleveled to be applied via the anvil.
This commit is contained in:
@@ -50,6 +50,18 @@ public class CraftAnvilView extends CraftInventoryView<AnvilMenu, AnvilInventory
|
||||
this.container.maximumRepairCost = cost;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean bypassesEnchantmentLevelRestriction() {
|
||||
return this.container.bypassEnchantmentLevelRestriction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bypassEnchantmentLevelRestriction(final boolean bypassEnchantmentLevelRestriction) {
|
||||
this.container.bypassEnchantmentLevelRestriction = bypassEnchantmentLevelRestriction;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
public void updateFromLegacy(CraftInventoryAnvil legacy) {
|
||||
if (legacy.isRepairCostSet()) {
|
||||
this.setRepairCost(legacy.getRepairCost());
|
||||
|
||||
Reference in New Issue
Block a user