Class ChestInventoryTranslator<Type extends Container>
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator<Type>
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator<Type>
org.geysermc.geyser.translator.inventory.chest.ChestInventoryTranslator<Type>
- Direct Known Subclasses:
DoubleChestInventoryTranslator,SingleChestInventoryTranslator
public abstract class ChestInventoryTranslator<Type extends Container>
extends BaseInventoryTranslator<Type>
-
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
PLAYER_INVENTORY_OFFSET, PLAYER_INVENTORY_SIZE, PLAYER_INVENTORY_TRANSLATOR, size -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavaSlotToBedrockContainer(int javaSlot, Type inventory) Converts a Java slot to the corresponding Bedrock container and slotbooleanrequiresOpeningDelay(GeyserSession session, Type container) protected booleanshouldRejectItemPlace(GeyserSession session, Type container, org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType bedrockSourceContainer, int javaSourceSlot, org.cloudburstmc.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.protected org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotTypeOverridden by the SingleChestInventoryTranslator in case barrels are used.voidupdateInventory(GeyserSession session, Type container) Updates the inventory by re-sending items for all slots of the inventory.voidupdateSlot(GeyserSession session, Type container, int slot) Updates a specific slot by re-sending the item.Methods inherited from class org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
bedrockSlotToJava, createInventory, getSlotType, javaSlotToBedrock, updatePropertyMethods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, canReuseInventory, checkNetId, closeInventory, dumpStackRequestDetails, getGridSize, inventoryTranslator, isCursor, makeContainerEntries, openInventory, prepareInventory, rejectRequest, rejectRequest, shouldHandleRequestFirst, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests, translateSpecialRequest
-
Constructor Details
-
ChestInventoryTranslator
public ChestInventoryTranslator(int size, int paddedSize)
-
-
Method Details
-
shouldRejectItemPlace
protected boolean shouldRejectItemPlace(GeyserSession session, Type container, org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType bedrockSourceContainer, int javaSourceSlot, org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot) Description copied from class:InventoryTranslatorShould 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:
shouldRejectItemPlacein classInventoryTranslator<Type extends Container>- Returns:
- true if this transfer should be rejected
-
requiresOpeningDelay
- Overrides:
requiresOpeningDelayin classInventoryTranslator<Type extends Container>
-
updateInventory
Description copied from class:InventoryTranslatorUpdates the inventory by re-sending items for all slots of the inventory.- Specified by:
updateInventoryin classInventoryTranslator<Type extends Container>
-
updateSlot
Description copied from class:InventoryTranslatorUpdates a specific slot by re-sending the item.- Specified by:
updateSlotin classInventoryTranslator<Type extends Container>
-
javaSlotToBedrockContainer
Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock container and slot- Overrides:
javaSlotToBedrockContainerin classBaseInventoryTranslator<Type extends Container>
-
slotType
Overridden by the SingleChestInventoryTranslator in case barrels are used. Bedrock uses the ContainerSlotType.BARREL for those.
-