Class TexturedInventoryWrapper
java.lang.Object
dev.lone.itemsadder.api.FontImages.TexturedInventoryWrapper
Class representing a custom textured inventory.
-
Constructor Summary
ConstructorsConstructorDescriptionTexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, int size, int textureOffset, FontImageWrapper... textures) Create a custom textured inventory without any title shown.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, int titleOffset, int textureOffset, FontImageWrapper... textures) Create a custom textured inventory.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, FontImageWrapper texture) Deprecated.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, FontImageWrapper texture, int titleOffset) Deprecated.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, int size, String title, FontImageWrapper texture, int titleOffset, int textureOffset) Create a custom textured inventory.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, int textureOffset, FontImageWrapper... textures) Create a custom textured inventory without any title shown.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, String title, int titleOffset, int textureOffset, FontImageWrapper... textures) Create a custom textured inventory.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, String title, FontImageWrapper texture) Deprecated.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, String title, FontImageWrapper texture, int titleOffset) Deprecated.TexturedInventoryWrapper(@Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, String title, FontImageWrapper texture, int titleOffset, int textureOffset) Create a custom textured inventory. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.InventoryDeprecated.static voidsetPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture) Static utility method to change texture of an inventory at runtime.static voidsetPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture, int titleOffset) Static utility method to change texture of an inventory at runtime.static voidsetPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture, String title) Static utility method to change texture of an inventory at runtime.static voidsetPlayerInventoryTexture(org.bukkit.entity.Player player, FontImageWrapper texture, String title, int titleOffset, int textureOffset) Static utility method to change texture of an inventory at runtime.voidshowInventory(org.bukkit.entity.Player player) Show this custom inventory to a player.
-
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 holdersize- a multiple of 9 as the size of inventory to createtitle- the title of the inventory, to be displayed when it is viewed.titleOffset- offset to shift the title back or forward. Default value is16textureOffset- offset to shift theFontImageWrapperback or forward. Default value is-16textures- array ofFontImageWrapperto 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 holdertype- 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 is16textureOffset- offset to shift theFontImageWrapperback or forward. Default value is-16textures- array ofFontImageWrapperto 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 holdersize- a multiple of 9 as the size of inventory to createtextureOffset- offset to shift theFontImageWrapperback or forward. Default value is-16textures- array ofFontImageWrapperto 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 holdertype- the type of inventory to create.textureOffset- offset to shift theFontImageWrapperback or forward. Default value is-16textures- array ofFontImageWrapperto 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 holdertype- the type of inventory to create.title- the title of the inventory, to be displayed when it is viewed.texture-FontImageWrapperto be used as texture for this inventorytitleOffset- offset to shift the title back or forward. Default value is16textureOffset- offset to shift theFontImageWrapperback 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 holdersize- a multiple of 9 as the size of inventory to createtitle- the title of the inventory, to be displayed when it is viewed.texture-FontImageWrapperto be used as texture for this inventorytitleOffset- int offset to shift the title back or forward. Default value is16textureOffset- int offset to shift theFontImageWrapperback 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 is16textureOffset: Default value is-16Create a custom textured inventory.- Parameters:
owner- the holder of the inventory, or null to indicate no holdertype- the type of inventory to create.title- the title of the inventory, to be displayed when it is viewed.texture-FontImageWrapperto 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 is16textureOffset: Default value is-16Create a custom textured inventory.- Parameters:
owner- the holder of the inventory, or null to indicate no holdertype- the type of inventory to create.title- the title of the inventory, to be displayed when it is viewed.texture-FontImageWrapperto be used as texture for this inventorytitleOffset- int offset to shift the title back or forward. Default value is16
-
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 is16textureOffset: Default value is-16Create a custom textured inventory.- Parameters:
owner- the holder of the inventory, or null to indicate no holdersize- a multiple of 9 as the size of inventory to createtitle- the title of the inventory, to be displayed when it is viewed.texture-FontImageWrapperto 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 is16textureOffset: Default value is-16Create a custom textured inventory.- Parameters:
owner- the holder of the inventory, or null to indicate no holdersize- a multiple of 9 as the size of inventory to createtitle- the title of the inventory, to be displayed when it is viewed.texture-FontImageWrapperto be used as texture for this inventorytitleOffset- int offset to shift the title back or forward. Default value is16
-
-
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-FontImageWrapperto be used as texture for this inventorytitle- 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-FontImageWrapperto 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-FontImageWrapperto be used as texture for this inventorytitleOffset- int offset to shift the title back or forward. Default value is16
-
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-FontImageWrapperto be used as texture for this inventorytitleOffset- int offset to shift the title back or forward. Default value is16textureOffset- int offset to shift theFontImageWrapperback or forward. Default value is-16
-
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 methodshowInventory(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.
-