Class AnvilInventoryTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator<AnvilContainer>
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator<AnvilContainer>
org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator<AnvilContainer>
org.geysermc.geyser.translator.inventory.AnvilInventoryTranslator
-
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.@Nullable org.cloudburstmc.protocol.bedrock.data.inventory.ContainerTypecloseContainerType(AnvilContainer container) createInventory(GeyserSession session, String name, int windowId, org.geysermc.mcprotocollib.protocol.data.game.inventory.ContainerType containerType) Creates a new inventory.intjavaSlotToBedrock(int slot) Converts a Java slot to the corresponding Bedrock slot.javaSlotToBedrockContainer(int slot, AnvilContainer container) Converts a Java slot to the corresponding Bedrock container and slotprotected booleanshouldHandleRequestFirst(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.action.ItemStackRequestAction action, AnvilContainer container) Should be overrided if this request matches a certain criteria and shouldn't be treated normally.protected org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.response.ItemStackResponsetranslateSpecialRequest(GeyserSession session, AnvilContainer container, org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequest request) IfInventoryTranslator.shouldHandleRequestFirst(ItemStackRequestAction, Inventory)returns true, this will be calledvoidupdateProperty(GeyserSession session, AnvilContainer 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.BaseInventoryTranslator
getSlotTypeMethods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, dumpStackRequestDetails, getGridSize, inventoryTranslator, isCursor, makeContainerEntries, rejectRequest, rejectRequest, shouldRejectItemPlace, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests
-
Constructor Details
-
AnvilInventoryTranslator
public AnvilInventoryTranslator()
-
-
Method Details
-
shouldHandleRequestFirst
protected boolean shouldHandleRequestFirst(org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.action.ItemStackRequestAction action, AnvilContainer container) 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<AnvilContainer>
-
translateSpecialRequest
protected org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.response.ItemStackResponse translateSpecialRequest(GeyserSession session, AnvilContainer container, 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<AnvilContainer>
-
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<AnvilContainer>
-
javaSlotToBedrockContainer
Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock container and slot- Overrides:
javaSlotToBedrockContainerin classBaseInventoryTranslator<AnvilContainer>
-
javaSlotToBedrock
public int javaSlotToBedrock(int slot) Description copied from class:InventoryTranslatorConverts a Java slot to the corresponding Bedrock slot.- Overrides:
javaSlotToBedrockin classBaseInventoryTranslator<AnvilContainer>
-
createInventory
public AnvilContainer 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<AnvilContainer>
-
updateProperty
Description copied from class:InventoryTranslatorUpdates a property in the inventory.- Overrides:
updatePropertyin classBaseInventoryTranslator<AnvilContainer>
-
closeContainerType
public @Nullable org.cloudburstmc.protocol.bedrock.data.inventory.ContainerType closeContainerType(AnvilContainer container) - Specified by:
closeContainerTypein classAbstractBlockInventoryTranslator<AnvilContainer>
-