java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.render.SlotPainter

@Internal public final class SlotPainter extends Object
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
    Constructor
    Description
    SlotPainter(@NotNull PlaceholderApplier placeholderApplier)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    applyText(@NotNull org.bukkit.entity.Player player, @NotNull String text, boolean applyPlaceholders)
    Applies placeholders to a single text fragment (e.g.
    void
    paint(@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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SlotPainter

      public SlotPainter(@NotNull @NotNull PlaceholderApplier placeholderApplier)
      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 placeholders
      inventory - the container to write into
      slot - the raw slot to paint
      item - the item to paint, or null to clear the slot
      applyPlaceholders - 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 yields null.
      Parameters:
      player - the viewer whose context resolves player-scoped placeholders
      text - the text to process
      applyPlaceholders - whether placeholders should be applied
      Returns:
      the processed text, never null