Class LoomInventoryTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator
org.geysermc.geyser.translator.inventory.LoomInventoryTranslator
-
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) getSlotType(int javaSlot) intjavaSlotToBedrock(int slot) javaSlotToBedrockContainer(int slot) protected booleanshouldHandleRequestFirst(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.action.ItemStackRequestAction action, Inventory inventory) Should be overrided if this request matches a certain criteria and shouldn't be treated normally.protected booleanshouldRejectItemPlace(GeyserSession session, Inventory inventory, 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.org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.response.ItemStackResponsetranslateSpecialRequest(GeyserSession session, Inventory inventory, org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequest request) IfInventoryTranslator.shouldHandleRequestFirst(ItemStackRequestAction, Inventory)returns true, this will be calledMethods inherited from class org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator
closeInventory, openInventory, prepareInventory, updateInventory, updateSlotMethods inherited from class org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
createInventory, updatePropertyMethods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, dumpStackRequestDetails, getGridSize, inventoryTranslator, isCursor, makeContainerEntries, rejectRequest, rejectRequest, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests
-
Constructor Details
-
LoomInventoryTranslator
public LoomInventoryTranslator()
-
-
Method Details
-
shouldRejectItemPlace
protected boolean shouldRejectItemPlace(GeyserSession session, Inventory inventory, 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- Returns:
- true if this transfer should be rejected
-
shouldHandleRequestFirst
protected boolean shouldHandleRequestFirst(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.action.ItemStackRequestAction action, Inventory inventory) Description copied from class:InventoryTranslatorShould be overrided if this request matches a certain criteria and shouldn't be treated normally. E.G. anvil renaming or enchanting- Overrides:
shouldHandleRequestFirstin classInventoryTranslator
-
translateSpecialRequest
public org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.response.ItemStackResponse translateSpecialRequest(GeyserSession session, Inventory inventory, org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequest request) Description copied from class:InventoryTranslatorIfInventoryTranslator.shouldHandleRequestFirst(ItemStackRequestAction, Inventory)returns true, this will be called- Overrides:
translateSpecialRequestin classInventoryTranslator
-
bedrockSlotToJava
public int bedrockSlotToJava(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequestSlotData slotInfoData) - Overrides:
bedrockSlotToJavain classBaseInventoryTranslator
-
javaSlotToBedrockContainer
- Overrides:
javaSlotToBedrockContainerin classBaseInventoryTranslator
-
javaSlotToBedrock
public int javaSlotToBedrock(int slot) - Overrides:
javaSlotToBedrockin classBaseInventoryTranslator
-
getSlotType
- Overrides:
getSlotTypein classBaseInventoryTranslator
-