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
ConstructorsConstructorDescriptionBlockInventoryHolder(String javaBlockIdentifier, com.nukkitx.protocol.bedrock.data.inventory.ContainerType containerType, String... validBlocks) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckInteractionPosition(GeyserSession session)Will be overwritten in the beacon inventory translator to remove the check, since virtual inventories can't exist.voidcloseInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)protected booleanisValidBlock(String[] javaBlockString)voidopenInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)voidprepareInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)protected voidsetCustomName(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:
prepareInventoryin 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:
openInventoryin classInventoryHolder
-
closeInventory
public void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory)- Specified by:
closeInventoryin classInventoryHolder
-