Skip to content

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 ​

readonly end: number

Defined in: packages/prismarine/src/inventory/workstationWindow.ts:27

One past the last hotbar slot.

firstHotbar ​

readonly firstHotbar: number

Defined in: packages/prismarine/src/inventory/workstationWindow.ts:25

The first hotbar slot.

firstOwn ​

readonly firstOwn: number

Defined in: packages/prismarine/src/inventory/workstationWindow.ts:23

The first of the player's main inventory slots.

ownFromEnd ​

readonly ownFromEnd: 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 ​

readonly result: 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 ​

Item

Returns ​

number

quickMove() ​

quickMove(index, item): readonly QuickMoveRange[]

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 ​

Item

Returns ​

readonly QuickMoveRange[]

Variables ​

CARTOGRAPHY_LAYOUT ​

const CARTOGRAPHY_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 ​

const SMITHING_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 ​

const STONECUTTER_LAYOUT: WorkstationLayout

Defined in: packages/prismarine/src/inventory/workstationWindow.ts:44

The stonecutter's window: the input before the result.


WORKSTATION_LAYOUTS ​

const WORKSTATION_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): readonly QuickMoveRange[]

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 ​

WorkstationLayout

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 ​

WorkstationLayout


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 ​

WorkstationLayout

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 ​

WorkstationRules

What each input slot takes and where a shift-click moves a stack.

Returns ​

ClickWindow<InventorySlot>