Class CrafterInventoryTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator<Type>
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator<Type>
org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator<CrafterContainer>
org.geysermc.geyser.translator.inventory.CrafterInventoryTranslator
Translates the Crafter. Most important thing to know about this class is that
the result slot comes after the 3x3 grid AND the inventory. This means that the total size of the Crafter (10)
cannot be used to calculate the inventory slot indices. The Translator and the Updater must then
override any methods that use the size for such calculations
-
Nested Class Summary
Nested classes/interfaces inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
InventoryTranslator.CraftState -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields 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.org.cloudburstmc.protocol.bedrock.data.inventory.ContainerTypecloseContainerType(CrafterContainer container) 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 javaSlot, CrafterContainer container) Converts a Java slot to the corresponding Bedrock container and slotvoidupdateProperty(GeyserSession session, CrafterContainer container, int key, int value) Updates a property in the inventory.Methods inherited from class org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator
canReuseInventory, closeInventory, openInventory, prepareInventory, requiresOpeningDelay, updateInventory, updateSlotMethods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, dumpStackRequestDetails, getGridSize, inventoryTranslator, isCursor, makeContainerEntries, rejectRequest, rejectRequest, shouldHandleRequestFirst, shouldRejectItemPlace, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests, translateSpecialRequest
-
Field Details
-
JAVA_RESULT_SLOT
public static final int JAVA_RESULT_SLOT- See Also:
-
BEDROCK_RESULT_SLOT
public static final int BEDROCK_RESULT_SLOT- See Also:
-
GRID_SIZE
public static final int GRID_SIZE- See Also:
-
-
Constructor Details
-
CrafterInventoryTranslator
public CrafterInventoryTranslator()
-
-
Method Details
-
updateProperty
Description copied from class:InventoryTranslatorUpdates a property in the inventory.- Overrides:
updatePropertyin classBaseInventoryTranslator<CrafterContainer>
-
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.- Overrides:
bedrockSlotToJavain classBaseInventoryTranslator<CrafterContainer>
-
javaSlotToBedrock
public int javaSlotToBedrock(int slot) Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock slot.- Overrides:
javaSlotToBedrockin classBaseInventoryTranslator<CrafterContainer>
-
javaSlotToBedrockContainer
Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock container and slot- Overrides:
javaSlotToBedrockContainerin classBaseInventoryTranslator<CrafterContainer>
-
getSlotType
Description copied from class:InventoryTranslatorReturns the slot type for a Java slot id- Overrides:
getSlotTypein classBaseInventoryTranslator<CrafterContainer>
-
createInventory
public CrafterContainer createInventory(GeyserSession session, String name, int windowId, org.geysermc.mcprotocollib.protocol.data.game.inventory.ContainerType containerType) Description copied from class:InventoryTranslatorCreates a new inventory.- Overrides:
createInventoryin classBaseInventoryTranslator<CrafterContainer>
-
closeContainerType
public org.cloudburstmc.protocol.bedrock.data.inventory.ContainerType closeContainerType(CrafterContainer container) - Specified by:
closeContainerTypein classAbstractBlockInventoryTranslator<CrafterContainer>
-