Class GUISection
java.lang.Object
de.placeblock.betterinventories.content.GUISection
- All Implemented Interfaces:
Sizeable
A GUISection is the most basic element that can be put inside GUIs.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGUISection(GUI gui, Vector2d size, Vector2d minSize, Vector2d maxSize) Creates a new GUISection -
Method Summary
Modifier and TypeMethodDescription<T> List<T>getEmptyContentList(Class<T> clazz) Returns a List with the amount of slots in this Section filled with null values.intgetSectionAt(int slot) Returns the GUISection at a specific slot.abstract GUISectiongetSectionAt(Vector2d position) Returns the GUISection at a specific position.intgetSlots()intgetWidth()abstract List<org.bukkit.inventory.ItemStack>render()Renders the Section on a listvoidSets the sizeslotToVector(int slot) Converts a slot to a vector based on the width of this SectionintvectorToSlot(Vector2d position) Converts a position to a slot based on the width of this SectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.placeblock.betterinventories.Sizeable
clampSize, getMaxSize, getMinSize, getSize
-
Field Details
-
minSize
The minimum size of the Section -
maxSize
The maximum size of the Section
-
-
Constructor Details
-
GUISection
Creates a new GUISection- Parameters:
gui- The GUIsize- The size of the SectionminSize- The minimum size of the SectionmaxSize- The maximum size of the Section
-
-
Method Details
-
setSize
Sets the size- Parameters:
vector2d- The new size
-
render
Renders the Section on a list- Returns:
- The List
-
getSectionAt
Returns the GUISection at a specific slot.- Parameters:
slot- The slot- Returns:
- The GUISection at the slot or null
-
getSectionAt
Returns the GUISection at a specific position.- Parameters:
position- The position- Returns:
- The GUISection at the slot or null
-
slotToVector
Converts a slot to a vector based on the width of this Section- Parameters:
slot- The slot to be converted- Returns:
- The calculated vector or null if the size of this Section is 0
-
getEmptyContentList
Returns a List with the amount of slots in this Section filled with null values.- Type Parameters:
T- The type of the List- Parameters:
clazz- The class of the type of the List- Returns:
- The List filled with null values
-
vectorToSlot
Converts a position to a slot based on the width of this Section- Parameters:
position- The position to be converted- Returns:
- The calculated slot
-
getSlots
public int getSlots()- Returns:
- The slots of this Section
-
getHeight
public int getHeight()- Returns:
- The height of this Section
-
getWidth
public int getWidth()- Returns:
- The width of this Section
-