Add code to support raillike group names
Conflicts: builtin/game/misc.lua
This commit is contained in:
parent
9e22a4a0d5
commit
4135d7e9bd
|
@ -114,11 +114,14 @@ function core.record_protection_violation(pos, name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function freeminer.color(color)
|
local raillike_ids = {}
|
||||||
assert(#color == 6, "Color must be six characters in length.")
|
local raillike_cur_id = 0
|
||||||
return "\v" .. color
|
function core.raillike_group(name)
|
||||||
end
|
local id = raillike_ids[name]
|
||||||
|
if not id then
|
||||||
function freeminer.colorize(color, message)
|
raillike_cur_id = raillike_cur_id + 1
|
||||||
return freeminer.color(color) .. message .. freeminer.color("ffffff")
|
raillike_ids[name] = raillike_cur_id
|
||||||
|
id = raillike_cur_id
|
||||||
|
end
|
||||||
|
return id
|
||||||
end
|
end
|
||||||
|
|
|
@ -2190,6 +2190,10 @@ These functions return the leftover itemstack.
|
||||||
* Get rating of a group of an item. (`0` means: not in group)
|
* Get rating of a group of an item. (`0` means: not in group)
|
||||||
* `minetest.get_node_group(name, group)`: returns a rating
|
* `minetest.get_node_group(name, group)`: returns a rating
|
||||||
* Deprecated: An alias for the former.
|
* Deprecated: An alias for the former.
|
||||||
|
* `minetest.raillike_group(name)`: returns a rating
|
||||||
|
* Returns rating of the connect_to_raillike group corresponding to name
|
||||||
|
* If name is not yet the name of a connect_to_raillike group, a new group id
|
||||||
|
* is created, with that name
|
||||||
* `minetest.get_content_id(name)`: returns an integer
|
* `minetest.get_content_id(name)`: returns an integer
|
||||||
* Gets the internal content ID of `name`
|
* Gets the internal content ID of `name`
|
||||||
* `minetest.get_name_from_content_id(content_id)`: returns a string
|
* `minetest.get_name_from_content_id(content_id)`: returns a string
|
||||||
|
|
Loading…
Reference in New Issue