Formspec: create Formspec:listNodeMetaLocation
This commit is contained in:
@@ -203,6 +203,24 @@ function Formspec:list(inventoryLocation, listName, x, y, w, h, startingItemInde
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---A wrapper around `Formspec:list` that allows access to the inventory of a node,
|
||||||
|
---specified by the coordinates of its position in the world.
|
||||||
|
---@param nodePos MapPosition
|
||||||
|
---@param listName string
|
||||||
|
---@param x number
|
||||||
|
---@param y number
|
||||||
|
---@param w number Are in inventory slots, not in coordinates.
|
||||||
|
---@param h number Are in inventory slots, not in coordinates.
|
||||||
|
---@param startingItemIndex number? The index of the first (upper-left) item to draw. Indices start at `0`. Default is `0`.
|
||||||
|
---@return Formspec
|
||||||
|
function Formspec:listNodeMetaLocation(nodePos, listName, x, y, w, h, startingItemIndex)
|
||||||
|
local inventoryLocation = ('nodemeta:%s,%s,%s'):format(nodePos.x, nodePos.y, nodePos.z)
|
||||||
|
|
||||||
|
self:list(inventoryLocation, listName, x, y, w, h, startingItemIndex)
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
---Creates and appends a list of `listring[<inventory location>;<list name>]` items based on the passed inventory list.
|
---Creates and appends a list of `listring[<inventory location>;<list name>]` items based on the passed inventory list.
|
||||||
---
|
---
|
||||||
---**Elements:** `listring[<inventory location>;<list name>]` or `listring[]`
|
---**Elements:** `listring[<inventory location>;<list name>]` or `listring[]`
|
||||||
|
|||||||
Reference in New Issue
Block a user