forked from minetest-mods/craftguide
Small fix for custom recipe
This commit is contained in:
parent
06bef9777a
commit
7c891ff2b6
12
init.lua
12
init.lua
|
@ -202,9 +202,17 @@ function craftguide.register_craft(def)
|
||||||
local len = #def.items
|
local len = #def.items
|
||||||
|
|
||||||
for i = 1, len do
|
for i = 1, len do
|
||||||
def.items[i] = def.items[i]:gsub(",,", ", ,")
|
local cc = 1
|
||||||
local rlen = #split(def.items[i], ",")
|
for char in gmatch(def.items[i], ".") do
|
||||||
|
if char == "," and sub(def.items[i], cc, cc) == "," then
|
||||||
|
def.items[i] = sub(def.items[i], 1, cc) .. " " ..
|
||||||
|
sub(def.items[i], cc + 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
cc = cc + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local rlen = #split(def.items[i], ",")
|
||||||
if rlen > def.width then
|
if rlen > def.width then
|
||||||
def.width = rlen
|
def.width = rlen
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user