API reference / @jsprismarine/prismarine / inventory/workstationWindow
inventory/workstationWindow
Interfaces
WorkstationLayout
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:19
The player's slots of a workstation window: where they start, where the hotbar starts, and their end.
Properties
end
readonlyend:number
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:27
One past the last hotbar slot.
firstHotbar
readonlyfirstHotbar:number
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:25
The first hotbar slot.
firstOwn
readonlyfirstOwn:number
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:23
The first of the player's main inventory slots.
ownFromEnd
readonlyownFromEnd:QuickMoveRange
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:29
Every player slot, which a shift-clicked result fills from the hotbar's end.
result
readonlyresult:number
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:21
The window slot of the result, which follows the inputs.
WorkstationRules
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:74
The rules a workstation's window adds to the shared layout.
Methods
capacity()
capacity(
slot,item):number
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:76
How many of item an input slot holds at most: 0 for a slot that does not take it.
Parameters
slot
number
item
Returns
number
quickMove()
quickMove(
index,item): readonlyQuickMoveRange[]
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:78
Where a shift-click moves the stack in an input slot or a player slot.
Parameters
index
number
item
Returns
readonly QuickMoveRange[]
Variables
CARTOGRAPHY_LAYOUT
constCARTOGRAPHY_LAYOUT:WorkstationLayout
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:50
The cartography table's window: the map and the paper, empty map or glass pane before the result.
SMITHING_LAYOUT
constSMITHING_LAYOUT:WorkstationLayout
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:47
The smithing table's window: the template, the base and the addition before the result.
STONECUTTER_LAYOUT
constSTONECUTTER_LAYOUT:WorkstationLayout
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:44
The stonecutter's window: the input before the result.
WORKSTATION_LAYOUTS
constWORKSTATION_LAYOUTS:Partial<Record<WindowTypes,WorkstationLayout>>
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:53
The layout of each workstation screen laid out this way, by the screen.
Functions
betweenOwnSlots()
betweenOwnSlots(
layout,index): readonlyQuickMoveRange[]
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:68
Where a shift-click moves a stack of the player's own when the workstation takes it nowhere: from the main inventory to the hotbar, and from the hotbar to the main inventory.
Parameters
layout
The window's layout.
index
number
The window slot clicked, one of the player's.
Returns
readonly QuickMoveRange[]
inputsGrid()
inputsGrid(
open):WindowGrid
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:127
The open window's input slots as a grid a window reads and writes.
Parameters
open
The open workstation.
inputs
(Item | null)[]
Its input slots.
Returns
WindowGrid
slotRange()
slotRange(
start,end,reverse?):QuickMoveRange
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:60
A range of window slots a shift-click fills in order.
Parameters
start
number
end
number
reverse?
boolean = false
Returns
QuickMoveRange
workstationLayout()
workstationLayout(
inputs):WorkstationLayout
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:36
The layout of a workstation window with inputs input slots.
Parameters
inputs
number
How many input slots come before the result.
Returns
workstationWindow()
workstationWindow(
layout,inventory,inputs,rules):ClickWindow<InventorySlot>
Defined in: packages/prismarine/src/inventory/workstationWindow.ts:88
A workstation's screen as a window a click is carried out in.
Parameters
layout
The window's layout, from workstationLayout.
inventory
Pick<HumanInventory, "container">
The player's inventory.
inputs
WindowGrid
The workstation's input slots, as the open window keeps them.
rules
What each input slot takes and where a shift-click moves a stack.
Returns
ClickWindow<InventorySlot>