Class TexturedInventoryWrapper

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

public class TexturedInventoryWrapper extends Object
Class representing a custom textured inventory.
  • Constructor Details

    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, int titleOffset, int textureOffset, FontImageWrapper... textures)
      Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      size - a multiple of 9 as the size of inventory to create
      title - the title of the inventory, to be displayed when it is viewed.
      titleOffset - offset to shift the title back or forward. Default value is 16
      textureOffset - offset to shift the FontImageWrapper back or forward. Default value is -16
      textures - array of FontImageWrapper to be used as textures for this inventory
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, String title, int titleOffset, int textureOffset, FontImageWrapper... textures)
      Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      type - the type of inventory to create.
      title - the title of the inventory, to be displayed when it is viewed.
      titleOffset - offset to shift the title back or forward. Default value is 16
      textureOffset - offset to shift the FontImageWrapper back or forward. Default value is -16
      textures - array of FontImageWrapper to be used as textures for this inventory
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, int size, int textureOffset, FontImageWrapper... textures)
      Create a custom textured inventory without any title shown.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      size - a multiple of 9 as the size of inventory to create
      textureOffset - offset to shift the FontImageWrapper back or forward. Default value is -16
      textures - array of FontImageWrapper to be used as textures for this inventory
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, int textureOffset, FontImageWrapper... textures)
      Create a custom textured inventory without any title shown.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      type - the type of inventory to create.
      textureOffset - offset to shift the FontImageWrapper back or forward. Default value is -16
      textures - array of FontImageWrapper to be used as textures for this inventory
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, String title, FontImageWrapper texture, int titleOffset, int textureOffset)
      Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      type - the type of inventory to create.
      title - the title of the inventory, to be displayed when it is viewed.
      texture - FontImageWrapper to be used as texture for this inventory
      titleOffset - offset to shift the title back or forward. Default value is 16
      textureOffset - offset to shift the FontImageWrapper back or forward. Default value is -16
    • TexturedInventoryWrapper

      public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, FontImageWrapper texture, int titleOffset, int textureOffset)
      Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      size - a multiple of 9 as the size of inventory to create
      title - the title of the inventory, to be displayed when it is viewed.
      texture - FontImageWrapper to be used as texture for this inventory
      titleOffset - int offset to shift the title back or forward. Default value is 16
      textureOffset - int offset to shift the FontImageWrapper back or forward. Default value is -16
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, String title, FontImageWrapper texture)
      Deprecated.
      This is deprecated. You should specify titleOffset and textureOffset based on your needs. Don't rely on the default values since they are misleading. titleOffset: Default value is 16 textureOffset: Default value is -16 Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      type - the type of inventory to create.
      title - the title of the inventory, to be displayed when it is viewed.
      texture - FontImageWrapper to be used as texture for this inventory
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, String title, FontImageWrapper texture, int titleOffset)
      Deprecated.
      This is deprecated. You should specify titleOffset and textureOffset based on your needs. Don't rely on the default values since they are misleading. titleOffset: Default value is 16 textureOffset: Default value is -16 Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      type - the type of inventory to create.
      title - the title of the inventory, to be displayed when it is viewed.
      texture - FontImageWrapper to be used as texture for this inventory
      titleOffset - int offset to shift the title back or forward. Default value is 16
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, FontImageWrapper texture)
      Deprecated.
      This is deprecated. You should specify titleOffset and textureOffset based on your needs. Don't rely on the default values since they are misleading. titleOffset: Default value is 16 textureOffset: Default value is -16 Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      size - a multiple of 9 as the size of inventory to create
      title - the title of the inventory, to be displayed when it is viewed.
      texture - FontImageWrapper to be used as texture for this inventory
    • TexturedInventoryWrapper

      @Deprecated public TexturedInventoryWrapper(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, FontImageWrapper texture, int titleOffset)
      Deprecated.
      This is deprecated. You should specify titleOffset and textureOffset based on your needs. Don't rely on the default values since they are misleading. titleOffset: Default value is 16 textureOffset: Default value is -16 Create a custom textured inventory.
      Parameters:
      owner - the holder of the inventory, or null to indicate no holder
      size - a multiple of 9 as the size of inventory to create
      title - the title of the inventory, to be displayed when it is viewed.
      texture - FontImageWrapper to be used as texture for this inventory
      titleOffset - int offset to shift the title back or forward. Default value is 16
  • Method Details

    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture, String title)
      Static utility method to change texture of an inventory at runtime. This can be used with any inventory, also Bukkit ones.
      Parameters:
      player - Player who's viewing the inventory.
      texture - FontImageWrapper to be used as texture for this inventory
      title - the title of the inventory, to be displayed when it is viewed.
    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture)
      Static utility method to change texture of an inventory at runtime. This can be used with any inventory, also Bukkit ones.
      Parameters:
      player - Player who's viewing the inventory.
      texture - FontImageWrapper to be used as texture for this inventory
    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture, int titleOffset)
      Static utility method to change texture of an inventory at runtime. This can be used with any inventory, also Bukkit ones.
      Parameters:
      player - Player who's viewing the inventory.
      texture - FontImageWrapper to be used as texture for this inventory
      titleOffset - int offset to shift the title back or forward. Default value is 16
    • setPlayerInventoryTexture

      public static void setPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture, String title, int titleOffset, int textureOffset)
      Static utility method to change texture of an inventory at runtime. This can be used with any inventory, also Bukkit ones.
      Parameters:
      player - Player who's viewing the inventory.
      texture - FontImageWrapper to be used as texture for this inventory
      titleOffset - int offset to shift the title back or forward. Default value is 16
      textureOffset - int offset to shift the FontImageWrapper back or forward. Default value is -16
    • getInternal

      @Deprecated public org.bukkit.inventory.Inventory getInternal()
      Deprecated.
      Get the Bukkit inventory. Warning: custom texture won't be applied correctly if the ItemsAdder configuration attribute `use_custom_font_file` is set to `true`, that's why you have to use the method showInventory(Player).
      Returns:
      the Bukkit inventory.
    • showInventory

      public void showInventory(org.bukkit.entity.Player player)
      Show this custom inventory to a player. This the only method you should use to show the inventory to players.
      Parameters:
      player - Player to show the inventory to.