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 GeyserItemStackMap<org.geysermc.mcprotocollib.protocol.data.game.entity.EquipmentSlot,GeyserItemStack> intStores 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) booleanWhether we should be sending aServerboundContainerClosePacketwhen closing the inventory.Methods inherited from class org.geysermc.geyser.inventory.Inventory
getBedrockId, getContainerType, getHolderId, getHolderPosition, getItem, getJavaId, getNextStateId, getSize, getStateId, getTitle, incrementStateId, isDisplayed, resetNextStateId, setBedrockId, setDisplayed, setHolderId, setHolderPosition, setItem, setStateId, toString, updateItemNetId
-
Constructor Details
-
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
-
getEquipment
public Map<org.geysermc.mcprotocollib.protocol.data.game.entity.EquipmentSlot,GeyserItemStack> getEquipment() -
eitherHandMatchesItem
-
setItemInHand
-
shouldConfirmContainerClose
public boolean shouldConfirmContainerClose()Description copied from class:InventoryWhether we should be sending aServerboundContainerClosePacketwhen closing the inventory.- Overrides:
shouldConfirmContainerClosein classInventory
-
getOffhand
-
getHeldItemSlot
public int getHeldItemSlot()Stores the held item slot, starting at index 0. Add 36 in order to get the network item slot. -
getCursor
-
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.
-