Package org.geysermc.geyser.inventory
Class PlayerInventory
java.lang.Object
org.geysermc.geyser.inventory.Inventory
org.geysermc.geyser.inventory.PlayerInventory
-
Field Summary
Fields inherited from class org.geysermc.geyser.inventory.Inventory
containerType, holderId, holderPosition, items, javaId, size, title -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaneitherHandMatchesItem(@NonNull Item item) @NonNull GeyserItemStackintStores the held item slot, starting at index 0.getItemInHand(@NonNull org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand) intgetOffsetForHotbar(@org.jetbrains.annotations.Range(from=0L, to=8L) int slot) booleanChecks if the player is holding the specified item in either handvoidsetCursor(@NonNull GeyserItemStack newCursor, GeyserSession session) voidsetHeldItemSlot(int heldItemSlot) Stores the held item slot, starting at index 0.voidsetItemInHand(@NonNull GeyserItemStack item) Methods inherited from class org.geysermc.geyser.inventory.Inventory
getBedrockId, getContainerType, getHolderId, getHolderPosition, getItem, getJavaId, getNextStateId, getSize, getStateId, getTitle, incrementStateId, isDisplayed, isPending, resetNextStateId, setDisplayed, setHolderId, setHolderPosition, setItem, setPending, setStateId, shouldConfirmContainerClose, toString, updateItemNetId
-
Constructor Details
-
PlayerInventory
public PlayerInventory()
-
-
Method Details
-
getOffsetForHotbar
public int getOffsetForHotbar(@org.jetbrains.annotations.Range(from=0L, to=8L) int slot) - Specified by:
getOffsetForHotbarin classInventory
-
setCursor
-
isHolding
Checks if the player is holding the specified item in either hand- Parameters:
item- The item to look for- Returns:
- If the player is holding the item in either hand
-
getItemInHand
public GeyserItemStack getItemInHand(@NonNull org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand) -
getItemInHand
-
eitherHandMatchesItem
-
setItemInHand
-
getOffhand
-
getHeldItemSlot
public int getHeldItemSlot()Stores the held item slot, starting at index 0. Add 36 in order to get the network item slot. -
setHeldItemSlot
public void setHeldItemSlot(int heldItemSlot) Stores the held item slot, starting at index 0. Add 36 in order to get the network item slot. -
getCursor
-