| Modifier and Type | Field and Description |
|---|---|
protected Map<ClickType,Set<Consumer<InventoryClickEvent>>> |
handlers |
| Constructor and Description |
|---|
SimpleSlot(Gui gui,
int id) |
| Modifier and Type | Method and Description |
|---|---|
Slot |
applyFromItem(Item item)
Applies an item model to this slot.
|
Slot |
bind(ClickType type,
Consumer<InventoryClickEvent> handler) |
Slot |
bind(ClickType type,
Runnable handler) |
Slot |
bind(Consumer<InventoryClickEvent> handler,
ClickType... types) |
Slot |
bind(Runnable handler,
ClickType... types) |
<T extends Consumer<InventoryClickEvent>> |
bindAllConsumers(Iterable<Map.Entry<ClickType,T>> handlers) |
<T extends Runnable> |
bindAllRunnables(Iterable<Map.Entry<ClickType,T>> handlers) |
Slot |
clear()
Clears all attributes of the slot.
|
Slot |
clearBindings()
Clears all bindings on this slot.
|
Slot |
clearBindings(ClickType type)
Clears all bindings on this slot for a given click type.
|
Slot |
clearItem()
Clears the item in this slot
|
int |
getId()
Gets the id of this slot
|
ItemStack |
getItem()
Gets the item in this slot
|
Gui |
gui()
Gets the GUI this slot references
|
void |
handle(InventoryClickEvent event) |
boolean |
hasItem()
Gets if this slot has an item
|
Slot |
setItem(ItemStack item)
Sets the item in this slot
|
protected final Map<ClickType,Set<Consumer<InventoryClickEvent>>> handlers
public void handle(@Nonnull InventoryClickEvent event)
public int getId()
public Slot applyFromItem(Item item)
applyFromItem in interface Slotitem - the itempublic boolean hasItem()
public Slot clear()
@Nonnull public Slot clearBindings()
clearBindings in interface Slot@Nonnull public Slot clearBindings(ClickType type)
clearBindings in interface Slot@Nonnull public Slot bind(@Nonnull ClickType type, @Nonnull Consumer<InventoryClickEvent> handler)
@Nonnull public Slot bind(@Nonnull Consumer<InventoryClickEvent> handler, @Nonnull ClickType... types)
@Nonnull public <T extends Runnable> Slot bindAllRunnables(@Nonnull Iterable<Map.Entry<ClickType,T>> handlers)
bindAllRunnables in interface Slot@Nonnull public <T extends Consumer<InventoryClickEvent>> Slot bindAllConsumers(@Nonnull Iterable<Map.Entry<ClickType,T>> handlers)
bindAllConsumers in interface SlotCopyright © 2020. All rights reserved.