Class AbstractBlockInventoryTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.InventoryTranslator
org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator
- Direct Known Subclasses:
AbstractFurnaceInventoryTranslator
,AnvilInventoryTranslator
,BeaconInventoryTranslator
,BrewingInventoryTranslator
,CartographyInventoryTranslator
,CraftingInventoryTranslator
,EnchantingInventoryTranslator
,Generic3X3InventoryTranslator
,GrindstoneInventoryTranslator
,HopperInventoryTranslator
,LoomInventoryTranslator
,ShulkerInventoryTranslator
,SmithingInventoryTranslator
,StonecutterInventoryTranslator
Provided as a base for any inventory that requires a block for opening it
-
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
ConstructorDescriptionAbstractBlockInventoryTranslator(int size, String javaBlockIdentifier, com.nukkitx.protocol.bedrock.data.inventory.ContainerType containerType, InventoryUpdater updater, String... additionalValidBlocks)
AbstractBlockInventoryTranslator(int size, InventoryHolder holder, InventoryUpdater updater)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
closeInventory(GeyserSession session, Inventory inventory)
void
openInventory(GeyserSession session, Inventory inventory)
void
prepareInventory(GeyserSession session, Inventory inventory)
void
updateInventory(GeyserSession session, Inventory inventory)
void
updateSlot(GeyserSession session, Inventory inventory, int slot)
Methods inherited from class org.geysermc.geyser.translator.inventory.BaseInventoryTranslator
bedrockSlotToJava, createInventory, getSlotType, javaSlotToBedrock, javaSlotToBedrockContainer, updateProperty
Methods inherited from class org.geysermc.geyser.translator.inventory.InventoryTranslator
acceptRequest, checkNetId, dumpStackRequestDetails, isCursor, makeContainerEntries, makeItemEntry, rejectRequest, rejectRequest, shouldHandleRequestFirst, shouldRejectItemPlace, translateAutoCraftingRequest, translateCraftingRequest, translateCreativeRequest, translateRequest, translateRequests, translateSpecialRequest
-
Constructor Details
-
AbstractBlockInventoryTranslator
public AbstractBlockInventoryTranslator(int size, String javaBlockIdentifier, com.nukkitx.protocol.bedrock.data.inventory.ContainerType containerType, InventoryUpdater updater, String... additionalValidBlocks)- Parameters:
size
- the amount of slots that the inventory adds alongside the base inventory slotsjavaBlockIdentifier
- a Java block identifier that is used as a temporary blockcontainerType
- the container type of this inventoryupdater
- updateradditionalValidBlocks
- any other block identifiers that can safely use this inventory without a fake block
-
AbstractBlockInventoryTranslator
public AbstractBlockInventoryTranslator(int size, InventoryHolder holder, InventoryUpdater updater)- Parameters:
size
- the amount of slots that the inventory adds alongside the base inventory slotsholder
- the custom block holderupdater
- updater
-
-
Method Details
-
prepareInventory
- Specified by:
prepareInventory
in classInventoryTranslator
-
openInventory
- Specified by:
openInventory
in classInventoryTranslator
-
closeInventory
- Specified by:
closeInventory
in classInventoryTranslator
-
updateInventory
- Specified by:
updateInventory
in classInventoryTranslator
-
updateSlot
- Specified by:
updateSlot
in classInventoryTranslator
-