Class PaperItemRenderer
java.lang.Object
com.ultikits.ultitools.item.impl.PaperItemRenderer
- All Implemented Interfaces:
ItemRenderer
The framework's
ItemRenderer on Paper data components. Stateless and thread-safe;
requires a running server (or MockBukkit) for the item registry.
Air is rejected by ItemSpec at build time, not by membership in the item registry.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPaperItemRenderer(Messages messages, LocaleResolver localeResolver) Creates a renderer using the framework's text and locale services. -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> voidapplyAssignment(org.bukkit.inventory.ItemStack stack, DataPatch.Assign<T> patch) private static voidapplyGlint(org.bukkit.inventory.ItemStack stack, ItemSpec spec) private voidprivate static <P,C> void applyMarker(org.bukkit.inventory.ItemStack stack, ItemMarker<P, C> marker) private static voidapplyModel(org.bukkit.inventory.ItemStack stack, ItemSpec spec) private voidprivate static voidapplyPatches(org.bukkit.inventory.ItemStack stack, ItemSpec spec) private static voidapplyTooltip(org.bukkit.inventory.ItemStack stack, ItemSpec spec) private static org.bukkit.inventory.ItemStackcreateStack(ItemSpec spec) org.bukkit.inventory.ItemStackCreates a new independent stack for the locale: typed attributes first, then patches in order, then persistent-data markers.org.bukkit.inventory.ItemStackRenders usinglocaleResolver.resolve(viewer).
-
Field Details
-
messages
-
localeResolver
-
-
Constructor Details
-
PaperItemRenderer
Creates a renderer using the framework's text and locale services.- Parameters:
messages- the service that renders text in any module namespacelocaleResolver- the service that resolves a viewer's locale
-
-
Method Details
-
render
Description copied from interface:ItemRendererCreates a new independent stack for the locale: typed attributes first, then patches in order, then persistent-data markers. Text uses the framework's Messages lookup order. Air is rejected at build time.TOOLTIP_DISPLAYis written only whenItemSpec.tooltipHidden()is true orItemSpec.hiddenInTooltip()is nonempty.- Specified by:
renderin interfaceItemRenderer
-
render
public org.bukkit.inventory.ItemStack render(ItemSpec spec, net.kyori.adventure.audience.Audience viewer) Description copied from interface:ItemRendererRenders usinglocaleResolver.resolve(viewer).- Specified by:
renderin interfaceItemRenderer
-
createStack
-
applyName
-
applyLore
-
applyModel
-
applyGlint
-
applyTooltip
-
applyPatches
-
applyAssignment
private static <T> void applyAssignment(org.bukkit.inventory.ItemStack stack, DataPatch.Assign<T> patch) -
applyMarker
-