Class GUIItem
java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.item.GUIItem
- All Implemented Interfaces:
Sizeable
- Direct Known Subclasses:
GUIButton
-
Nested Class Summary
Nested classes/interfaces inherited from class de.placeblock.betterinventories.content.GUISection
GUISection.SearchData -
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.booleanonItemRemove(Vector2d position) Called when an item is removed from an empty slotList<org.bukkit.inventory.ItemStack>render()Renders the GUIItem on a listsearch(int slot, boolean onlyPanes) Returns the GUISection at a specific slot.Returns the GUISection at a specific position.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
Returns the GUISection at a specific slot. For GUIItems it will always return the GUIItem itself.- Overrides:
searchin classGUISection- Parameters:
slot- The slotonlyPanes- Whether to return only panes even if there is an item at the clicked slot- Returns:
- The GUISection
-
search
Returns the GUISection at a specific position. For GUIItems it will always return the GUIItem itself.- Specified by:
searchin classGUISection- Parameters:
position- The positiononlyPanes- Whether to return only panes even if there is an item at the clicked slot- Returns:
- The GUISection
-
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 is allowed.
-
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:
- Whether this action is allowed.
-
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 is allowed.
-