Package org.geysermc.geyser.inventory
Class Inventory
java.lang.Object
org.geysermc.geyser.inventory.Inventory
- Direct Known Subclasses:
Container,PlayerInventory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.github.steveice10.mc.protocol.data.game.inventory.ContainerTypeUsed for smooth transitions between two windows of the same type.protected longprotected com.nukkitx.math.vector.Vector3iThe location of the inventory block.protected GeyserItemStack[]protected intprotected intprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcom.github.steveice10.mc.protocol.data.game.inventory.ContainerTypeUsed for smooth transitions between two windows of the same type.longcom.nukkitx.math.vector.Vector3iThe location of the inventory block.getItem(int slot)intintSeeClickPlan.execute(boolean); used as a hackabstract intgetOffsetForHotbar(@org.jetbrains.annotations.Range(from=0L, to=8L) int slot)intgetSize()intThe Java inventory state ID from the server.getTitle()voidincrementStateId(int count)SeeClickPlan.execute(boolean)for more details.booleanvoidvoidsetHolderId(long holderId)voidsetHolderPosition(com.nukkitx.math.vector.Vector3i holderPosition)The location of the inventory block.voidsetItem(int slot, GeyserItemStack newItem, GeyserSession session)voidsetPending(boolean pending)voidsetStateId(int stateId)The Java inventory state ID from the server.toString()protected voidupdateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSession session)
-
Field Details
-
javaId
protected final int javaId -
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 javaId, int size, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType)
-
-
Method Details
-
getBedrockId
public int getBedrockId() -
getItem
-
getOffsetForHotbar
public abstract int getOffsetForHotbar(@org.jetbrains.annotations.Range(from=0L, to=8L) int slot) -
setItem
-
updateItemNetId
protected void updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSession session) -
incrementStateId
public void incrementStateId(int count)SeeClickPlan.execute(boolean)for more details. -
resetNextStateId
public void resetNextStateId() -
toString
-
getJavaId
public int getJavaId() -
getStateId
public int getStateId()The Java inventory state ID from the server. As of Java Edition 1.18.1 this value has one instance per player. If this is out of sync with the server when a packet containing it is handled, the server will resync items. This field has existed since Java Edition 1.17.1. -
setStateId
public void setStateId(int stateId)The Java inventory state ID from the server. As of Java Edition 1.18.1 this value has one instance per player. If this is out of sync with the server when a packet containing it is handled, the server will resync items. This field has existed since Java Edition 1.17.1. -
getNextStateId
public int getNextStateId()SeeClickPlan.execute(boolean); used as a hack -
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
-
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)
-