Class BaseInventoryTranslator<Type extends Container>
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator<Type>
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator<Type>
- Direct Known Subclasses:
AbstractBlockInventoryTranslator,AbstractMountInventoryTranslator,ChestInventoryTranslator,MerchantInventoryTranslator
public abstract class BaseInventoryTranslator<Type extends Container>
extends InventoryTranslator<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 TypeMethodDescriptionintbedrockSlotToJava(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequestSlotData slotInfoData) Converts the Bedrock slot to the corresponding Java slot.createInventory(GeyserSession session, String name, int windowId, org.geysermc.mcprotocollib.protocol.data.game.inventory.ContainerType containerType) Creates a new inventory.getSlotType(int javaSlot) Returns the slot type for a Java slot idintjavaSlotToBedrock(int slot) Converts a Java slot to the corresponding Bedrock slot.javaSlotToBedrockContainer(int slot, Type inventory) Converts a Java slot to the corresponding Bedrock container and slotvoidupdateProperty(GeyserSession session, Type container, int key, int value) Updates a property in the inventory.Methods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, canReuseInventory, checkNetId, closeInventory, dumpStackRequestDetails, getGridSize, inventoryTranslator, isCursor, makeContainerEntries, openInventory, prepareInventory, rejectRequest, rejectRequest, requiresOpeningDelay, shouldHandleRequestFirst, shouldRejectItemPlace, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests, translateSpecialRequest, updateInventory, updateSlot
-
Constructor Details
-
BaseInventoryTranslator
public BaseInventoryTranslator(int size)
-
-
Method Details
-
updateProperty
Description copied from class:InventoryTranslatorUpdates a property in the inventory.- Specified by:
updatePropertyin classInventoryTranslator<Type extends Container>
-
bedrockSlotToJava
public int bedrockSlotToJava(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequestSlotData slotInfoData) Description copied from class:InventoryTranslatorConverts the Bedrock slot to the corresponding Java slot.- Specified by:
bedrockSlotToJavain classInventoryTranslator<Type extends Container>
-
javaSlotToBedrock
public int javaSlotToBedrock(int slot) Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock slot.- Specified by:
javaSlotToBedrockin classInventoryTranslator<Type extends Container>
-
javaSlotToBedrockContainer
Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock container and slot- Specified by:
javaSlotToBedrockContainerin classInventoryTranslator<Type extends Container>
-
getSlotType
Description copied from class:InventoryTranslatorReturns the slot type for a Java slot id- Specified by:
getSlotTypein classInventoryTranslator<Type extends Container>
-
createInventory
public Type createInventory(GeyserSession session, String name, int windowId, org.geysermc.mcprotocollib.protocol.data.game.inventory.ContainerType containerType) Description copied from class:InventoryTranslatorCreates a new inventory.- Specified by:
createInventoryin classInventoryTranslator<Type extends Container>
-