Class Pixel
java.lang.Object
io.github.somesourcecode.someguiapi.scene.Pixel
An instance of Pixel contains all the information needed to render a single item in a GUI.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionPixel()Constructs a new empty pixel.Pixel(org.bukkit.Material material) Constructs a new pixel with the specified material.Pixel(org.bukkit.Material material, int index) Constructs a new pixel with the specified material and title.Pixel(org.bukkit.Material material, int index, net.kyori.adventure.text.Component title) Constructs a new pixel with the specified material and title.Constructs a new pixel with the specified material, index, title, and lore.Pixel(org.bukkit.Material material, int index, net.kyori.adventure.text.Component title, Lore lore, boolean glow) Constructs a new pixel with the specified material, index, title, lore, and glow.Pixel(org.bukkit.Material material, net.kyori.adventure.text.Component title) Constructs a new pixel with the specified material and title.Constructs a new pixel with the specified material, title, and lore.Pixel(org.bukkit.Material material, net.kyori.adventure.text.Component title, Lore lore, boolean glow) Constructs a new pixel with the specified material, title, lore, and glow. -
Method Summary
Modifier and TypeMethodDescriptionstatic Pixelblank(org.bukkit.Material material) Creates a pixel with the specified material and empty title and lore.static Pixelempty()Creates an empty pixel.intgetIndex()Returns the index of this pixel.getLore()Returns the lore of this pixel.org.bukkit.MaterialReturns the material of this pixel.net.kyori.adventure.text.ComponentgetTitle()Returns the title of this pixel.booleanisEmpty()Returns whether this pixel is empty.booleanisGlow()Returns whether this pixel should glow.static Pixelof(org.bukkit.Material material) Creates a pixel with the specified material.org.bukkit.inventory.ItemStackrenderItemStack(RenderContext renderContext) Renders this pixel as an ItemStack.setGlow(boolean glow) Sets whether this pixel should glow.setIndex(int index) Sets the index of this pixel.Sets the lore of this pixel.setMaterial(org.bukkit.Material material) Sets the material of this pixel.setTitle(net.kyori.adventure.text.Component title) Sets the title of this pixel.
-
Constructor Details
-
Pixel
public Pixel()Constructs a new empty pixel.- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material) Constructs a new pixel with the specified material.- Parameters:
material- the material- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material, int index) Constructs a new pixel with the specified material and title.- Parameters:
material- the materialindex- the index- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material, int index, net.kyori.adventure.text.Component title) Constructs a new pixel with the specified material and title.- Parameters:
material- the materialindex- the indextitle- the title- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material, int index, net.kyori.adventure.text.Component title, Lore lore) Constructs a new pixel with the specified material, index, title, and lore.- Parameters:
material- the materialindex- the indextitle- the titlelore- the lore- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material, int index, net.kyori.adventure.text.Component title, Lore lore, boolean glow) Constructs a new pixel with the specified material, index, title, lore, and glow.- Parameters:
material- the materialindex- the indextitle- the titlelore- the loreglow- whether the pixel should glow- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material, net.kyori.adventure.text.Component title) Constructs a new pixel with the specified material and title.- Parameters:
material- the materialtitle- the title- Since:
- 2.0.0
-
Pixel
Constructs a new pixel with the specified material, title, and lore.- Parameters:
material- the materialtitle- the titlelore- the lore- Since:
- 2.0.0
-
Pixel
public Pixel(org.bukkit.Material material, net.kyori.adventure.text.Component title, Lore lore, boolean glow) Constructs a new pixel with the specified material, title, lore, and glow.- Parameters:
material- the materialtitle- the titlelore- the loreglow- whether the pixel should glow- Since:
- 2.0.0
-
-
Method Details
-
empty
Creates an empty pixel. Empty pixels will be rendered as air.- Returns:
- the empty pixel
- Since:
- 2.0.0
-
blank
Creates a pixel with the specified material and empty title and lore.- Parameters:
material- the material- Returns:
- the blank pixel
- Since:
- 2.0.0
-
of
Creates a pixel with the specified material.- Parameters:
material- the material- Returns:
- the pixel
- Since:
- 2.0.0
-
getMaterial
public org.bukkit.Material getMaterial()Returns the material of this pixel.- Returns:
- the material
- Since:
- 2.0.0
-
setMaterial
Sets the material of this pixel.- Parameters:
material- the material- Returns:
- the pixel for method chaining
- Since:
- 2.0.0
-
getTitle
public net.kyori.adventure.text.Component getTitle()Returns the title of this pixel.- Returns:
- the title
- Since:
- 2.0.0
-
setTitle
Sets the title of this pixel.- Parameters:
title- the title- Returns:
- the pixel for method chaining
- Since:
- 2.0.0
-
getLore
Returns the lore of this pixel.- Returns:
- the lore
- Since:
- 2.0.0
-
setLore
Sets the lore of this pixel.- Parameters:
lore- the lore- Returns:
- the pixel for method chaining
- Since:
- 2.0.0
-
getIndex
public int getIndex()Returns the index of this pixel.- Returns:
- the index
- Since:
- 2.0.0
-
setIndex
Sets the index of this pixel.- Parameters:
index- the index- Returns:
- the pixel for method chaining
- Since:
- 2.0.0
-
isGlow
public boolean isGlow()Returns whether this pixel should glow.- Returns:
- whether this pixel should glow
- Since:
- 2.0.0
-
setGlow
Sets whether this pixel should glow.- Parameters:
glow- whether this pixel should glow- Returns:
- the pixel for method chaining
- Since:
- 2.0.0
-
isEmpty
public boolean isEmpty()Returns whether this pixel is empty. A pixel is considered empty if its material is null or air or if its index is less than or equal to 0.- Returns:
- whether this pixel is empty
- Since:
- 2.0.0
-
renderItemStack
Renders this pixel as an ItemStack.- Parameters:
renderContext- the render context- Returns:
- the rendered ItemStack
- Since:
- 2.0.0
-