Class TexturedInventoryWrapper

java.lang.Object
dev.lone.itemsadder.api.FontImages.TexturedInventoryWrapper

public class TexturedInventoryWrapper extends Object
Helper for creating inventories with font-image based textures in the title.
  • Constructor Details

    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, int size, String title, int titleOffset, int textureOffset, FontImageWrapper... textures)
      Creates a textured inventory with one or more textures.
      Parameters:
      owner - the inventory owner, or null.
      size - the inventory size.
      title - the visible title text, or null.
      titleOffset - the title pixel offset.
      textureOffset - the texture pixel offset.
      textures - the textures to render in the title.
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, @NotNull @NotNull InventoryType type, String title, int titleOffset, int textureOffset, FontImageWrapper... textures)
      Creates a textured inventory of a Bukkit inventory type with one or more textures.
      Parameters:
      owner - the inventory owner, or null.
      type - the inventory type.
      title - the visible title text, or null.
      titleOffset - the title pixel offset.
      textureOffset - the texture pixel offset.
      textures - the textures to render in the title.
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, int size, int textureOffset, FontImageWrapper... textures)
      Creates a textured inventory with one or more textures and no title text.
      Parameters:
      owner - the inventory owner, or null.
      size - the inventory size.
      textureOffset - the texture pixel offset.
      textures - the textures to render in the title.
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, @NotNull @NotNull InventoryType type, int textureOffset, FontImageWrapper... textures)
      Creates a typed textured inventory with one or more textures and no title text.
      Parameters:
      owner - the inventory owner, or null.
      type - the inventory type.
      textureOffset - the texture pixel offset.
      textures - the textures to render in the title.
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, @NotNull @NotNull InventoryType type, String title, FontImageWrapper texture, int titleOffset, int textureOffset)
      Creates a textured inventory with a single texture.
      Parameters:
      owner - the inventory owner, or null.
      type - the inventory type.
      title - the visible title text, or null.
      texture - the texture to render in the title.
      titleOffset - the title pixel offset.
      textureOffset - the texture pixel offset.
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, int size, String title, FontImageWrapper texture, int titleOffset, int textureOffset)
      Creates a textured inventory with a single texture.
      Parameters:
      owner - the inventory owner, or null.
      size - the inventory size.
      title - the visible title text, or null.
      texture - the texture to render in the title.
      titleOffset - the title pixel offset.
      textureOffset - the texture pixel offset.
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, int size, FontImageWrapper texture, int textureOffset)
      Creates a textured inventory with a single texture and no title text.
      Parameters:
      owner - the inventory owner, or null.
      size - the inventory size.
      texture - the texture to render in the title.
      textureOffset - the texture pixel offset.
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, @NotNull @NotNull InventoryType type, String title, FontImageWrapper texture)
      Deprecated.
      use constructors that explicitly accept title and texture offsets.
      Creates a typed textured inventory with default offsets.
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, @NotNull @NotNull InventoryType type, String title, FontImageWrapper texture, int titleOffset)
      Deprecated.
      use constructors that explicitly accept title and texture offsets.
      Creates a typed textured inventory with default texture offset.
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, int size, String title, FontImageWrapper texture)
      Deprecated.
      use constructors that explicitly accept title and texture offsets.
      Creates a textured inventory with default offsets.
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable InventoryHolder owner, int size, String title, FontImageWrapper texture, int titleOffset)
      Deprecated.
      use constructors that explicitly accept title and texture offsets.
      Creates a textured inventory with default texture offset.
  • Method Details

    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(Player player, FontImageWrapper texture, String title)
      Changes the texture of the inventory currently open for a player.
      Parameters:
      player - the player.
      texture - the texture to render in the title.
      title - the visible title text, or null to keep the current title.
    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(Player player, FontImageWrapper texture)
      Changes the texture of the inventory currently open for a player.
      Parameters:
      player - the player.
      texture - the texture to render in the title.
    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(Player player, FontImageWrapper texture, int titleOffset)
      Changes the texture of the inventory currently open for a player.
      Parameters:
      player - the player.
      texture - the texture to render in the title.
      titleOffset - the title pixel offset.
    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(Player player, FontImageWrapper texture, String title, int titleOffset, int textureOffset)
      Changes the texture of the inventory currently open for a player.
      Parameters:
      player - the player.
      texture - the texture to render in the title.
      title - the visible title text, or null to keep the current title.
      titleOffset - the title pixel offset.
      textureOffset - the texture pixel offset.
    • getInternal

      @Deprecated public Inventory getInternal()
      Deprecated.
      this exposes the internal inventory directly.
      Gets the internal Bukkit inventory.
      Returns:
      the internal inventory.
    • showInventory

      public void showInventory(Player player)
      Opens this textured inventory for a player.
      Parameters:
      player - the player.