Class SlotPainter
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.render.SlotPainter
Writes item stacks into container slots, applying placeholders to display name and lore
at paint time on a clone of the given item (mirrors the 2.x
InventoryEditorImpl
placeholder behavior); the caller's item is never mutated.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StringapplyText(@NotNull org.bukkit.entity.Player player, @NotNull String text, boolean applyPlaceholders) Applies placeholders to a single text fragment (e.g.voidpaint(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.Inventory inventory, int slot, @Nullable org.bukkit.inventory.ItemStack item, boolean applyPlaceholders) Paints the slot: a null item clears it; otherwise a clone of the item is written, with placeholders applied to its display name and lore when requested.
-
Constructor Details
-
SlotPainter
- Parameters:
placeholderApplier- the applier resolving placeholder tokens per player
-
-
Method Details
-
paint
public void paint(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.Inventory inventory, int slot, @Nullable @Nullable org.bukkit.inventory.ItemStack item, boolean applyPlaceholders) Paints the slot: a null item clears it; otherwise a clone of the item is written, with placeholders applied to its display name and lore when requested.- Parameters:
player- the viewer whose context resolves player-scoped placeholdersinventory- the container to write intoslot- the raw slot to paintitem- the item to paint, or null to clear the slotapplyPlaceholders- whether placeholders should be applied to the item's meta
-
applyText
@NotNull public @NotNull String applyText(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String text, boolean applyPlaceholders) Applies placeholders to a single text fragment (e.g. a container title) when requested; the input is returned unchanged when placeholder application is disabled or the applier yieldsnull.- Parameters:
player- the viewer whose context resolves player-scoped placeholderstext- the text to processapplyPlaceholders- whether placeholders should be applied- Returns:
- the processed text, never
null
-