public final class BasicInventoryContents extends Object implements InventoryContents
InventoryContents.| Constructor and Description |
|---|
BasicInventoryContents(@NotNull Page page,
@NotNull org.bukkit.entity.Player player)
ctor.
|
BasicInventoryContents(@NotNull Page page,
@NotNull org.bukkit.entity.Player player,
@NotNull Icon[][] contents)
ctpr.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull Icon[][] |
all()
returns a 2D array of
Icon containing
all the items of the inventory. |
<T> T |
getProperty(@NotNull String name)
gets the value of the property with the given name.
|
<T> T |
getPropertyOrDefault(@NotNull String name,
T def)
gets the value of the property with the given name,
or a default value if the property isn't set.
|
boolean |
isEditable(@NotNull SlotPos slot)
returns if a given slot is editable or not.
|
@NotNull Optional<SlotIterator> |
iterator(@NotNull String id)
gets a previously registered iterator named with the given id.
|
@NotNull SlotIterator |
newIterator(@NotNull String id,
SlotIterator.Type type,
int startRow,
int startColumn)
creates and registers an iterator using a given id.
|
@NotNull Page |
page()
obtains the page of the
this. |
@NotNull Pagination |
pagination()
gets the pagination system linked to
this. |
@NotNull org.bukkit.entity.Player |
player()
obtains the player of the contents.
|
@NotNull InventoryContents |
set(int row,
int column,
@Nullable Icon item)
same as
InventoryContents.set(int, Icon),
but with a row and a column instead of the index. |
@NotNull InventoryContents |
setEditable(@NotNull SlotPos slot,
boolean editable)
makes a slot editable, which enables the player to
put items in and take items out of the inventory in the
specified slot.
|
@NotNull InventoryContents |
setProperty(@NotNull String name,
@NotNull Object value)
sets the value of the property with the given name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, applyRect, applyRect, fill, fillBorders, fillColumn, fillEmpties, fillPattern, fillPattern, fillPattern, fillPattern, fillPatternRepeating, fillPatternRepeating, fillPatternRepeating, fillPatternRepeating, fillRect, fillRect, fillRect, fillRow, fillSquare, fillSquare, fillSquare, findItem, findItem, firstEmpty, get, get, get, getBottomInventory, getTopInventory, newIterator, newIterator, newIterator, notifyUpdate, notifyUpdateForAll, notifyUpdateForAllById, openNext, openPrevious, removeAll, removeAll, removeAmount, removeAmount, removeFirst, removeFirst, reopen, set, set, setEditable, slotspublic BasicInventoryContents(@NotNull
@NotNull Page page,
@NotNull
@NotNull org.bukkit.entity.Player player,
@NotNull
@NotNull Icon[][] contents)
page - the page.player - the player.contents - the contents.public BasicInventoryContents(@NotNull
@NotNull Page page,
@NotNull
@NotNull org.bukkit.entity.Player player)
page - the page.player - the player@NotNull public @NotNull Page page()
InventoryContentsthis.page in interface InventoryContents@NotNull public @NotNull Pagination pagination()
InventoryContentsthis.pagination in interface InventoryContents@NotNull public @NotNull Icon[][] all()
InventoryContentsIcon containing
all the items of the inventory.
the Icons can be null when there is no
item in the corresponding slot.
all in interface InventoryContents@NotNull public @NotNull org.bukkit.entity.Player player()
InventoryContentsplayer in interface InventoryContents@NotNull public @NotNull Optional<SlotIterator> iterator(@NotNull @NotNull String id)
InventoryContents
if no iterator is found, this will return Optional.empty().
iterator in interface InventoryContentsid - the id of the iterator.@Nullable
public <T> T getProperty(@NotNull
@NotNull String name)
InventoryContentsgetProperty in interface InventoryContentsT - the type of the value.name - the property's name.@NotNull
public <T> T getPropertyOrDefault(@NotNull
@NotNull String name,
@NotNull
T def)
InventoryContentsgetPropertyOrDefault in interface InventoryContentsT - the type of the value.name - the property's name.def - the default value.@NotNull public @NotNull SlotIterator newIterator(@NotNull @NotNull String id, @NotNull SlotIterator.Type type, int startRow, int startColumn)
InventoryContents
you can retrieve the iterator at any time using
the InventoryContents.iterator(String) method.
newIterator in interface InventoryContentsid - the id of the iterator.type - the type of the iterator.startRow - the starting row of the iterator.startColumn - the starting column of the iterator.@NotNull public @NotNull InventoryContents set(int row, int column, @Nullable @Nullable Icon item)
InventoryContentsInventoryContents.set(int, Icon),
but with a row and a column instead of the index.set in interface InventoryContentsrow - the row to set.column - the column to set.item - the item to set.this, for chained calls.@NotNull public @NotNull InventoryContents setProperty(@NotNull @NotNull String name, @NotNull @NotNull Object value)
InventoryContentsthis will replace the existing value for the property, if there is one.
setProperty in interface InventoryContentsname - the property's name.value - the new property's value.this, for chained calls.@NotNull public @NotNull InventoryContents setEditable(@NotNull @NotNull SlotPos slot, boolean editable)
InventoryContentssetEditable in interface InventoryContentsslot - the slot to set editable.editable - true to make a slot editable, false
to make it 'static' again.this, for chained calls.public boolean isEditable(@NotNull
@NotNull SlotPos slot)
InventoryContentsisEditable in interface InventoryContentsslot - The slot to check.true if the editable.Copyright © 2021. All rights reserved.