Fix 2 bugs
This commit is contained in:
parent
9e09edd497
commit
222ae80d93
10
init.lua
10
init.lua
|
@ -265,6 +265,10 @@ local function msg(name, str)
|
||||||
return chat_send(name, sprintf("[i3] %s", str))
|
return chat_send(name, sprintf("[i3] %s", str))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function is_num(x)
|
||||||
|
return type(x) == "number"
|
||||||
|
end
|
||||||
|
|
||||||
local function is_str(x)
|
local function is_str(x)
|
||||||
return type(x) == "string"
|
return type(x) == "string"
|
||||||
end
|
end
|
||||||
|
@ -1111,6 +1115,7 @@ local function select_item(player, name, data, _f)
|
||||||
end
|
end
|
||||||
|
|
||||||
item = reg_aliases[item] or item
|
item = reg_aliases[item] or item
|
||||||
|
if not reg_items[item] then return end
|
||||||
|
|
||||||
if item == data.query_item then
|
if item == data.query_item then
|
||||||
if creative_enabled(name) then
|
if creative_enabled(name) then
|
||||||
|
@ -1465,6 +1470,7 @@ local function get_model_fs(fs, data, def, model_alias)
|
||||||
local _name
|
local _name
|
||||||
|
|
||||||
if v.color then
|
if v.color then
|
||||||
|
if is_num(v.color) then
|
||||||
local hex = sprintf("%02x", v.color)
|
local hex = sprintf("%02x", v.color)
|
||||||
|
|
||||||
while #hex < 8 do
|
while #hex < 8 do
|
||||||
|
@ -1473,7 +1479,9 @@ local function get_model_fs(fs, data, def, model_alias)
|
||||||
|
|
||||||
_name = sprintf("%s^[multiply:%s", v.name,
|
_name = sprintf("%s^[multiply:%s", v.name,
|
||||||
sprintf("#%s%s", sub(hex, 3), sub(hex, 1, 2)))
|
sprintf("#%s%s", sub(hex, 3), sub(hex, 1, 2)))
|
||||||
|
else
|
||||||
|
_name = sprintf("%s^[multiply:%s", v.name, v.color)
|
||||||
|
end
|
||||||
elseif v.animation then
|
elseif v.animation then
|
||||||
_name = sprintf("%s^[verticalframe:%u:0", v.name, v.animation.aspect_h)
|
_name = sprintf("%s^[verticalframe:%u:0", v.name, v.animation.aspect_h)
|
||||||
end
|
end
|
||||||
|
|
Ŝarĝante…
Reference in New Issue