mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-23 11:23:44 +01:00
Fix error message in progressive mode
This commit is contained in:
parent
6e744b44b1
commit
e37f1df6d3
14
init.lua
14
init.lua
@ -941,9 +941,10 @@ mt.register_chatcommand("craft", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local red = mt.colorize("red", "[craftguide] ")
|
||||||
|
|
||||||
if not node_name then
|
if not node_name then
|
||||||
return false, mt.colorize("red", "[craftguide] ") ..
|
return false, red .. S("No node pointed")
|
||||||
S("No node pointed")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local data = player_data[name]
|
local data = player_data[name]
|
||||||
@ -957,15 +958,18 @@ mt.register_chatcommand("craft", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not recipes or #recipes == 0 then
|
if not recipes or #recipes == 0 then
|
||||||
|
local ylw = mt.colorize("yellow", node_name)
|
||||||
|
local msg = red .. "%s: " .. ylw
|
||||||
|
|
||||||
if is_fuel then
|
if is_fuel then
|
||||||
recipes = get_item_usages(node_name)
|
recipes = get_item_usages(node_name)
|
||||||
if #recipes > 0 then
|
if #recipes > 0 then
|
||||||
data.show_usages = true
|
data.show_usages = true
|
||||||
end
|
end
|
||||||
|
elseif recipes_cache[node_name] then
|
||||||
|
return false, fmt(msg, S("You don't know a recipe for this node"))
|
||||||
else
|
else
|
||||||
return false, mt.colorize("red", "[craftguide] ") ..
|
return false, fmt(msg, S("No recipe for this node"))
|
||||||
S("No recipe for this node:") .. " " ..
|
|
||||||
mt.colorize("yellow", node_name)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user