Class GUIItem
java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.item.GUIItem
- All Implemented Interfaces:
Sizeable
- Direct Known Subclasses:
GUIButton,LoadingGUIItem
A
GUISection with a size of 1x1 containing an ItemStack-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGUIItem.AbstractBuilder<B extends GUIItem.AbstractBuilder<B,P>, P extends GUIItem> Abstract Builder for creating various GUIItemsstatic classBuilder for creatingGUIItem -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Vector2dThe Size of every GUIItemprotected org.bukkit.inventory.ItemStackThe ItemStack to be renderedFields inherited from class de.placeblock.betterinventories.content.GUISection
maxSize, minSize -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCalled when an item is added to an empty slotbooleanonItemAmount(Vector2d position, int amount) Called when the amount of an item in a slot changesvoidonItemClick(ClickData data) Called when a user clicks on an item.org.bukkit.inventory.ItemStackonItemRemove(Vector2d position) Called when an item is removed from an empty slotList<org.bukkit.inventory.ItemStack>render()Renders the GUIItem on a listvoidsearch(SearchData searchData) Searches the GUISection recursively.Methods inherited from class de.placeblock.betterinventories.content.GUISection
getEmptyContentList, getHeight, getSlots, getWidth, setSize, slotToVector, vectorToSlotMethods 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
-
BUTTON_SIZE
The Size of every GUIItem -
itemStack
protected org.bukkit.inventory.ItemStack itemStackThe ItemStack to be rendered
-
-
Constructor Details
-
GUIItem
Creates a new GUIItem- Parameters:
gui- The GUIitemStack- The ItemStack.ItemBuildermay help to create it.
-
-
Method Details
-
render
Renders the GUIItem on a list- Specified by:
renderin classGUISection- Returns:
- The List
-
search
Searches the GUISection recursively. The SearchData is filled recursively.- Specified by:
searchin classGUISection- Parameters:
searchData- The searchData that contains all needed information
-
onItemClick
Description copied from class:GUISectionCalled when a user clicks on an item. Usually after this method one of the add/remove/amount methods is called.- Specified by:
onItemClickin classGUISection- Parameters:
data- The clickdata
-
onItemAdd
Description copied from class:GUISectionCalled when an item is added to an empty slot- Specified by:
onItemAddin classGUISection- Parameters:
position- The relative position of the slotitemStack- The itemstack that was added- Returns:
- Whether this action should be cancelled.
-
onItemRemove
Description copied from class:GUISectionCalled when an item is removed from an empty slot- Specified by:
onItemRemovein classGUISection- Parameters:
position- The relative position of the slot- Returns:
- The removed Item, if any
-
onItemAmount
Description copied from class:GUISectionCalled when the amount of an item in a slot changes- Specified by:
onItemAmountin classGUISection- Parameters:
position- The relative position of the slotamount- The new amount of the item- Returns:
- Whether this action should be cancelled.
-