Class CycleGUIButton<E extends CycleEnum>
java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.item.GUIItem
de.placeblock.betterinventories.content.item.GUIButton
de.placeblock.betterinventories.content.item.impl.cyclebutton.CycleGUIButton<E>
- Type Parameters:
E- The Enum
- All Implemented Interfaces:
Sizeable
GUIButton which cycles through values of an Enum
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCycleGUIButton.Builder<E extends CycleEnum>Builder for creatingCycleGUIButtonNested classes/interfaces inherited from class de.placeblock.betterinventories.content.item.GUIButton
GUIButton.AbstractBuilder<B extends GUIButton.AbstractBuilder<B,P>, P extends GUIButton> -
Field Summary
Fields inherited from class de.placeblock.betterinventories.content.item.GUIItem
BUTTON_SIZE, itemStackFields inherited from class de.placeblock.betterinventories.content.GUISection
maxSize, minSize -
Constructor Summary
ConstructorsConstructorDescriptionCycleGUIButton(GUI gui, int cooldown, org.bukkit.Sound sound, E[] values, E startValue, CycleConsumer<E> onCycle) Creates a new CycleGUIButton. -
Method Summary
Modifier and TypeMethodDescriptionvoidCycles the Valuesprotected org.bukkit.inventory.ItemStackReturns the Item to be displayed for an Enum-value Can be overridden for modifying Enum-Item-conversionvoidIs called when the player clicks on the Button no matter how.protected voidIs called when cycling through the Enum-valuesMethods inherited from class de.placeblock.betterinventories.content.item.GUIButton
applyCooldown, click, hasPermission, onItemClick, onLeftClick, onRightClick, onShiftClick, onShiftLeftClick, onShiftRightClick, setCooldownMethods inherited from class de.placeblock.betterinventories.content.item.GUIItem
onItemAdd, onItemAmount, onItemRemove, onItemRemoveTroughInventoryClose, render, searchMethods 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
-
Constructor Details
-
CycleGUIButton
public CycleGUIButton(GUI gui, int cooldown, org.bukkit.Sound sound, E[] values, E startValue, CycleConsumer<E> onCycle) Creates a new CycleGUIButton. The permission is passed in the various enum values.- Parameters:
gui- The GUIvalues- The Enum valuesstartValue- The Start-valuecooldown- The cooldown of the Button. Applied to the material, not the Button alone.sound- The sound that is played when pressing that buttononCycle- Called when a player cycles the values
-
-
Method Details
-
getItem
Returns the Item to be displayed for an Enum-value Can be overridden for modifying Enum-Item-conversion- Parameters:
value- The Enum-value- Returns:
- The according ItemStack
-
onClick
Description copied from class:GUIButtonIs called when the player clicks on the Button no matter how. -
cycle
Cycles the Values- Parameters:
data- The clickData if the click event
-
onCycle
Is called when cycling through the Enum-values- Parameters:
data- The ClickDatanewValue- The new Enum-value
-