Adventure
Co-authored-by: zml <zml@stellardrift.ca> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
This commit is contained in:
@@ -310,6 +310,19 @@ public abstract class Enchantment implements Keyed, Translatable {
|
||||
* @return True if the enchantment may be applied, otherwise False
|
||||
*/
|
||||
public abstract boolean canEnchantItem(@NotNull ItemStack item);
|
||||
// Paper start
|
||||
/**
|
||||
* Get the name of the enchantment with its applied level.
|
||||
* <p>
|
||||
* If the given {@code level} is either less than the {@link #getStartLevel()} or greater than the {@link #getMaxLevel()},
|
||||
* the level may not be shown in the numeral format one may otherwise expect.
|
||||
* </p>
|
||||
*
|
||||
* @param level the level of the enchantment to show
|
||||
* @return the name of the enchantment with {@code level} applied
|
||||
*/
|
||||
public abstract net.kyori.adventure.text.@NotNull Component displayName(int level);
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
* Gets the Enchantment at the specified key
|
||||
|
||||
@@ -20,4 +20,11 @@ public abstract class EnchantmentWrapper extends Enchantment {
|
||||
public Enchantment getEnchantment() {
|
||||
return this;
|
||||
}
|
||||
// Paper start
|
||||
@NotNull
|
||||
@Override
|
||||
public net.kyori.adventure.text.Component displayName(int level) {
|
||||
return getEnchantment().displayName(level);
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user