Improve Item Rarity API

This commit is contained in:
Jake Potrebic
2021-03-12 17:09:40 -08:00
parent 07c1829d7f
commit 83c4827433
5 changed files with 87 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
package io.papermc.paper.inventory;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextColor;
import org.jetbrains.annotations.NotNull;
/**
* @deprecated use {@link org.bukkit.inventory.ItemRarity} with {@link org.bukkit.inventory.meta.ItemMeta#getRarity()}
*/
@Deprecated(forRemoval = true, since = "1.20.5")
public enum ItemRarity {
COMMON(NamedTextColor.WHITE),
UNCOMMON(NamedTextColor.YELLOW),
RARE(NamedTextColor.AQUA),
EPIC(NamedTextColor.LIGHT_PURPLE);
TextColor color;
ItemRarity(TextColor color) {
this.color = color;
}
/**
* Gets the color formatting associated with the rarity.
* @return
*/
@NotNull
public TextColor getColor() {
return color;
}
}