Complete prototype of TooManyItems
This commit is contained in:
parent
c7df75c019
commit
47c535b1e6
@ -36,3 +36,12 @@ minetest.register_node("buildtest:glass_pipe", {
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "buildtest:glass_pipe 20",
|
||||
recipe = {
|
||||
{"main:glass","","main:glass"},
|
||||
{"main:glass","","main:glass"},
|
||||
{"main:glass","","main:glass"},
|
||||
}
|
||||
})
|
||||
|
@ -50,6 +50,16 @@ local recipe_converter = function (items, width)
|
||||
|
||||
return(usable_recipe)
|
||||
end
|
||||
get_if_group = function(item)
|
||||
if item == "group:stone" then
|
||||
return("main:cobble")
|
||||
elseif item == "group:wood" then
|
||||
return("main:wood")
|
||||
else
|
||||
return(item)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function create_craft_formspec(item)
|
||||
--don't do air
|
||||
@ -73,7 +83,7 @@ function create_craft_formspec(item)
|
||||
if recipe.width > 0 then
|
||||
for x = 1,3 do
|
||||
for y = 1,3 do
|
||||
local item = usable_table[x][y]
|
||||
local item = get_if_group(usable_table[x][y])
|
||||
if item then
|
||||
output = output.."item_image_button["..base_x+y..","..base_y+x..";1,1;"..item..";"..item..";]"
|
||||
else
|
||||
@ -86,7 +96,7 @@ function create_craft_formspec(item)
|
||||
local i = 1
|
||||
for x = 1,3 do
|
||||
for y = 1,3 do
|
||||
local item = usable_table[i]
|
||||
local item = get_if_group(usable_table[i])
|
||||
if item then
|
||||
output = output.."item_image_button["..base_x+y..","..base_y+x..";1,1;"..item..";"..item..";]"
|
||||
else
|
||||
@ -97,6 +107,10 @@ function create_craft_formspec(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif recipe.method == "cooking" then
|
||||
local item = recipe.items[1]
|
||||
output = output.."item_image_button["..(base_x+2)..","..(base_y+1)..";1,1;"..item..";"..item..";]"
|
||||
output = output.."image[2.75,1.5;1,1;default_furnace_fire_fg.png]"
|
||||
end
|
||||
return(output)
|
||||
--print(dump(usable_table))
|
||||
@ -256,6 +270,7 @@ local y = 0
|
||||
|
||||
--dump all the items in
|
||||
for index,data in pairs(minetest.registered_items) do
|
||||
if data.name ~= "" then
|
||||
local recipe = minetest.get_craft_recipe(data.name)
|
||||
--only put in craftable items
|
||||
if recipe.method then
|
||||
@ -271,6 +286,7 @@ for index,data in pairs(minetest.registered_items) do
|
||||
inv["page_"..page] = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--add buttons and labels
|
||||
|
Loading…
x
Reference in New Issue
Block a user