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
INVENTORY_TRANSLATORS, PLAYER_INVENTORY_OFFSET, PLAYER_INVENTORY_SIZE, PLAYER_INVENTORY_TRANSLATOR, size
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
bedrockSlotToJava(com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData slotInfoData)
getSlotType(int javaSlot)
int
javaSlotToBedrock(int slot)
javaSlotToBedrockContainer(int slot)
boolean
shouldHandleRequestFirst(com.nukkitx.protocol.bedrock.data.inventory.stackrequestactions.StackRequestActionData action, Inventory inventory)
Should be overrided if this request matches a certain criteria and shouldn't be treated normally.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.com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.Response
translateSpecialRequest(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ItemStackRequest request)
IfInventoryTranslator.shouldHandleRequestFirst(StackRequestActionData, Inventory)
returns true, this will be calledMethods inherited from class org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator
closeInventory, openInventory, prepareInventory, updateInventory, updateSlot
Methods inherited from class org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
createInventory, updateProperty
Methods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, dumpStackRequestDetails, isCursor, makeContainerEntries, makeItemEntry, rejectRequest, rejectRequest, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests
-
Constructor Details
-
LoomInventoryTranslator
public LoomInventoryTranslator()
-
-
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
-
shouldHandleRequestFirst
public boolean shouldHandleRequestFirst(com.nukkitx.protocol.bedrock.data.inventory.stackrequestactions.StackRequestActionData action, Inventory inventory)Description copied from class:InventoryTranslator
Should be overrided if this request matches a certain criteria and shouldn't be treated normally. E.G. anvil renaming or enchanting- Overrides:
shouldHandleRequestFirst
in classInventoryTranslator
-
translateSpecialRequest
public com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession session, Inventory inventory, com.nukkitx.protocol.bedrock.data.inventory.ItemStackRequest request)Description copied from class:InventoryTranslator
IfInventoryTranslator.shouldHandleRequestFirst(StackRequestActionData, Inventory)
returns true, this will be called- Overrides:
translateSpecialRequest
in classInventoryTranslator
-
bedrockSlotToJava
public int bedrockSlotToJava(com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData slotInfoData)- Overrides:
bedrockSlotToJava
in classBaseInventoryTranslator
-
javaSlotToBedrockContainer
- Overrides:
javaSlotToBedrockContainer
in classBaseInventoryTranslator
-
javaSlotToBedrock
public int javaSlotToBedrock(int slot)- Overrides:
javaSlotToBedrock
in classBaseInventoryTranslator
-
getSlotType
- Overrides:
getSlotType
in classBaseInventoryTranslator
-