Class PlayerInventoryTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator
org.geysermc.geyser.translator.inventory.PlayerInventoryTranslator
-
Nested Class Summary
Nested classes/interfaces inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
InventoryTranslator.CraftState
-
Field Summary
Fields inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
INVENTORY_TRANSLATORS, PLAYER_INVENTORY_OFFSET, PLAYER_INVENTORY_SIZE, PLAYER_INVENTORY_TRANSLATOR, size
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
bedrockSlotToJava(com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData slotInfoData)
void
closeInventory(GeyserSession session, Inventory inventory)
createInventory(String name, int windowId, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType, PlayerInventory playerInventory)
getSlotType(int javaSlot)
int
javaSlotToBedrock(int slot)
javaSlotToBedrockContainer(int slot)
void
openInventory(GeyserSession session, Inventory inventory)
void
prepareInventory(GeyserSession session, Inventory inventory)
com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.Response
translateCreativeRequest(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ItemStackRequest request)
Handled inPlayerInventoryTranslator
com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.Response
translateRequest(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ItemStackRequest request)
static void
updateCraftingGrid(GeyserSession session, Inventory inventory)
Update the crafting grid for the player to hide/show the barriers in the creative inventoryvoid
updateInventory(GeyserSession session, Inventory inventory)
void
updateProperty(GeyserSession session, Inventory inventory, int key, int value)
void
updateSlot(GeyserSession session, Inventory inventory, int slot)
Methods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, dumpStackRequestDetails, isCursor, makeContainerEntries, makeItemEntry, rejectRequest, rejectRequest, shouldHandleRequestFirst, shouldRejectItemPlace, translateAutoCraftingRequest, translateCraftingRequest, translateRequests, translateSpecialRequest
-
Constructor Details
-
PlayerInventoryTranslator
public PlayerInventoryTranslator()
-
-
Method Details
-
updateInventory
- Specified by:
updateInventory
in classInventoryTranslator
-
updateCraftingGrid
Update the crafting grid for the player to hide/show the barriers in the creative inventory- Parameters:
session
- Connection of the playerinventory
- Inventory of the player
-
updateSlot
- Specified by:
updateSlot
in classInventoryTranslator
-
bedrockSlotToJava
public int bedrockSlotToJava(com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData slotInfoData)- Specified by:
bedrockSlotToJava
in classInventoryTranslator
-
javaSlotToBedrock
public int javaSlotToBedrock(int slot)- Specified by:
javaSlotToBedrock
in classInventoryTranslator
-
javaSlotToBedrockContainer
- Specified by:
javaSlotToBedrockContainer
in classInventoryTranslator
-
getSlotType
- Specified by:
getSlotType
in classInventoryTranslator
-
translateRequest
public com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.Response translateRequest(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ItemStackRequest request)- Overrides:
translateRequest
in classInventoryTranslator
-
translateCreativeRequest
public com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.Response translateCreativeRequest(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ItemStackRequest request)Description copied from class:InventoryTranslator
Handled inPlayerInventoryTranslator
- Overrides:
translateCreativeRequest
in classInventoryTranslator
-
createInventory
public Inventory createInventory(String name, int windowId, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType, PlayerInventory playerInventory)- Specified by:
createInventory
in classInventoryTranslator
-
prepareInventory
- Specified by:
prepareInventory
in classInventoryTranslator
-
openInventory
- Specified by:
openInventory
in classInventoryTranslator
-
closeInventory
- Specified by:
closeInventory
in classInventoryTranslator
-
updateProperty
- Specified by:
updateProperty
in classInventoryTranslator
-