Class BlockInventoryHolder
java.lang.Object
org.geysermc.geyser.inventory.holder.InventoryHolder
org.geysermc.geyser.inventory.holder.BlockInventoryHolder
Manages the fake block we implement for each inventory, should we need to.
This class will attempt to use a real block first, if possible.
-
Constructor Summary
ConstructorDescriptionBlockInventoryHolder(String javaBlockIdentifier, com.nukkitx.protocol.bedrock.data.inventory.ContainerType containerType, String... validBlocks)
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkInteractionPosition(GeyserSession session)
Will be overwritten in the beacon inventory translator to remove the check, since virtual inventories can't exist.void
closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)
protected boolean
isValidBlock(String[] javaBlockString)
void
openInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)
void
prepareInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)
protected void
setCustomName(GeyserSession session, com.nukkitx.math.vector.Vector3i position, Inventory inventory, int javaBlockState)
-
Constructor Details
-
BlockInventoryHolder
-
-
Method Details
-
prepareInventory
public void prepareInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)- Specified by:
prepareInventory
in classInventoryHolder
-
checkInteractionPosition
Will be overwritten in the beacon inventory translator to remove the check, since virtual inventories can't exist.- Returns:
- if the player's last interaction position and current position match. Used to ensure that we don't select a block to hold the inventory that's wildly out of range.
-
isValidBlock
- Returns:
- true if this Java block ID can be used for player inventory.
-
setCustomName
protected void setCustomName(GeyserSession session, com.nukkitx.math.vector.Vector3i position, Inventory inventory, int javaBlockState) -
openInventory
public void openInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)- Specified by:
openInventory
in classInventoryHolder
-
closeInventory
public void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)- Specified by:
closeInventory
in classInventoryHolder
-