mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 20:21:41 +01:00
Add ItemType#getItemRarity
This commit is contained in:
parent
7b21e8c8d9
commit
4ef8b976c9
@ -262,4 +262,12 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han
|
|||||||
return this.item.getDescriptionId();
|
return this.item.getDescriptionId();
|
||||||
}
|
}
|
||||||
// Paper end - add Translatable
|
// Paper end - add Translatable
|
||||||
|
|
||||||
|
// Paper start - expand ItemRarity API
|
||||||
|
@Override
|
||||||
|
public org.bukkit.inventory.ItemRarity getItemRarity() {
|
||||||
|
final net.minecraft.world.item.Rarity rarity = this.item.components().get(DataComponents.RARITY);
|
||||||
|
return rarity == null ? null : org.bukkit.inventory.ItemRarity.valueOf(rarity.name());
|
||||||
|
}
|
||||||
|
// Paper end - expand ItemRarity API
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user