Skip to content

Commit

Permalink
Document changes
Browse files Browse the repository at this point in the history
  • Loading branch information
juhdanad authored and sofar committed Apr 9, 2017
1 parent 67207d2 commit fb9701b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin/game/item_entity.lua
Expand Up @@ -53,6 +53,8 @@ core.register_entity(":__builtin:item", {
if itemtable then
itemname = stack:to_table().name
end
-- Backwards compatibility: old clients use the texture
-- to get the type of the item
local item_texture = nil
local item_type = ""
if core.registered_items[itemname] then
Expand Down
16 changes: 16 additions & 0 deletions doc/lua_api.txt
Expand Up @@ -1480,6 +1480,9 @@ Item metadata only contains a key-value store.
Some of the values in the key-value store are handled specially:

* `description`: Set the itemstack's description. Defaults to idef.description
* `color`: A `ColorString`, which sets the stack's color.
* `paletteindex`: If the item has a palette, this is used to get the
current color from the palette.

Example stuff:

Expand Down Expand Up @@ -3737,6 +3740,19 @@ Definition tables
{hard = 1, metal = 1, spikes = 1}
inventory_image = "default_tool_steelaxe.png",
wield_image = "",
palette = "",
--[[
^ An image file containing the palette of a node.
^ You can set the currently used color as the
^ "paletteindex" field of the item stack metadata.
^ The palette is always stretched to fit indices
^ between 0 and 255, to ensure compatibility with
^ "colorfacedir" and "colorwallmounted" nodes.
]]
color = "0xFFFFFFFF",
--[[
^ The color of the item. The palette overrides this.
]]
wield_scale = {x = 1, y = 1, z = 1},
stack_max = 99,
range = 4.0,
Expand Down

0 comments on commit fb9701b

Please sign in to comment.