Class ChestInventoryTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
org.geysermc.geyser.translator.inventory.chest.ChestInventoryTranslator
- Direct Known Subclasses:
DoubleChestInventoryTranslator
,SingleChestInventoryTranslator
-
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 TypeMethodDescriptionjavaSlotToBedrockContainer(int javaSlot)
boolean
shouldRejectItemPlace(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType bedrockSourceContainer, int javaSourceSlot, com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot)
Should be overwritten in cases where specific inventories should reject an item being in a specific spot.void
updateInventory(GeyserSession session, Inventory inventory)
void
updateSlot(GeyserSession session, Inventory inventory, int slot)
Methods inherited from class org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
bedrockSlotToJava, createInventory, getSlotType, javaSlotToBedrock, updateProperty
Methods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, closeInventory, dumpStackRequestDetails, isCursor, makeContainerEntries, makeItemEntry, openInventory, prepareInventory, rejectRequest, rejectRequest, shouldHandleRequestFirst, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests, translateSpecialRequest
-
Constructor Details
-
ChestInventoryTranslator
public ChestInventoryTranslator(int size, int paddedSize)
-
-
Method Details
-
shouldRejectItemPlace
public boolean shouldRejectItemPlace(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType bedrockSourceContainer, int javaSourceSlot, com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot)Description copied from class:InventoryTranslator
Should be overwritten in cases where specific inventories should reject an item being in a specific spot. For examples, looms use this to reject items that are dyes in Bedrock but not in Java. The source/destination slot will be -1 if the cursor is the slot- Overrides:
shouldRejectItemPlace
in classInventoryTranslator
- Returns:
- true if this transfer should be rejected
-
updateInventory
- Specified by:
updateInventory
in classInventoryTranslator
-
updateSlot
- Specified by:
updateSlot
in classInventoryTranslator
-
javaSlotToBedrockContainer
- Overrides:
javaSlotToBedrockContainer
in classBaseInventoryTranslator
-