Package org.geysermc.geyser.inventory
Class Inventory
java.lang.Object
org.geysermc.geyser.inventory.Inventory
- Direct Known Subclasses:
Container
,PlayerInventory
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.github.steveice10.mc.protocol.data.game.inventory.ContainerType
Used for smooth transitions between two windows of the same type.protected long
protected com.nukkitx.math.vector.Vector3i
The location of the inventory block.protected int
protected GeyserItemStack[]
protected int
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.github.steveice10.mc.protocol.data.game.inventory.ContainerType
Used for smooth transitions between two windows of the same type.long
com.nukkitx.math.vector.Vector3i
The location of the inventory block.int
getId()
getItem(int slot)
int
getSize()
int
If this is out of sync with the server, the server will resync items.getTitle()
boolean
void
setHolderId(long holderId)
void
setHolderPosition(com.nukkitx.math.vector.Vector3i holderPosition)
The location of the inventory block.void
setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSession session)
void
setPending(boolean pending)
void
setStateId(int stateId)
If this is out of sync with the server, the server will resync items.void
toString()
protected static void
updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSession session)
-
Field Details
-
id
protected final int id -
size
protected final int size -
containerType
protected final com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerTypeUsed for smooth transitions between two windows of the same type. -
title
-
items
-
holderPosition
protected com.nukkitx.math.vector.Vector3i holderPositionThe location of the inventory block. Will either be a fake block above the player's head, or the actual block location -
holderId
protected long holderId
-
-
Constructor Details
-
Inventory
protected Inventory(int id, int size, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType) -
Inventory
protected Inventory(String title, int id, int size, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType)
-
-
Method Details
-
getItem
-
setItem
-
updateItemNetId
protected static void updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSession session) -
toString
-
getId
public int getId() -
getStateId
public int getStateId()If this is out of sync with the server, the server will resync items. Since Java Edition 1.17.1. -
setStateId
public void setStateId(int stateId)If this is out of sync with the server, the server will resync items. Since Java Edition 1.17.1. -
getSize
public int getSize() -
getContainerType
public com.github.steveice10.mc.protocol.data.game.inventory.ContainerType getContainerType()Used for smooth transitions between two windows of the same type. -
getTitle
-
setTitle
-
getHolderPosition
public com.nukkitx.math.vector.Vector3i getHolderPosition()The location of the inventory block. Will either be a fake block above the player's head, or the actual block location -
setHolderPosition
public void setHolderPosition(com.nukkitx.math.vector.Vector3i holderPosition)The location of the inventory block. Will either be a fake block above the player's head, or the actual block location -
getHolderId
public long getHolderId() -
setHolderId
public void setHolderId(long holderId) -
isPending
public boolean isPending() -
setPending
public void setPending(boolean pending)
-