Can someone point me to information and/or a mod that I could go by to do this?
I want a simple 2x2 crafting table with type=splice


4aiman wrote:Would this do: viewtopic.php?id=3546 ?
-- Incompatible with MasterGollum's crafter mod
crafter = {}
local all_recipe_types = {}
local all_recipes = {}
function crafter.register_craft_type(name)
table.insert(all_recipe_types, name)
end
function crafter.register_craft(def)
if not def then
return
end
local typ = def.type
if not (def.output and def.recipe and typ) then
return
end
if type(def.recipe) == "string" then
def.recipe = { def.recipe }
end
local recipe = {}
for i, v in ipairs(def.recipe) do
local stack = ItemStack(v)
local name = stack:get_name()
local count = stack:get_count()
if not recipe[name] then
recipe[name] = count
else
recipe[name] = recipe[name] + count
end
end
if not all_recipes[typ] then
all_recipes[typ] = {}
end
table.insert(all_recipes[typ], { def.output, def.recipe })
end
function crafter.get_craft_result(typ, list)
if not (typ and list) then
return
end
--todo
end
minetest.after(5, function()
local test = minetest.get_inventory({type="player", name="singleplayer"})
if test then
test:set_stack("main", 10, "default:torch")
else
print("error")
end
end)
crafter.register_craft_type("12test")
crafter.register_craft({
type = "12test",
output = "default:stick",
recipe = { "default:stick" }
})
Napiophelios wrote:Ran across this on github,
I dont know if it works or not
I havent tried it.
https://github.com/SmallJoker/custom_craftsYour phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
-- Incompatible with MasterGollum's crafter mod
crafter = {}
local all_recipe_types = {}
local all_recipes = {}
function crafter.register_craft_type(name)
table.insert(all_recipe_types, name)
end
function crafter.register_craft(def)
if not def then
return
end
local typ = def.type
if not (def.output and def.recipe and typ) then
return
end
if type(def.recipe) == "string" then
def.recipe = { def.recipe }
end
local recipe = {}
for i, v in ipairs(def.recipe) do
local stack = ItemStack(v)
local name = stack:get_name()
local count = stack:get_count()
if not recipe[name] then
recipe[name] = count
else
recipe[name] = recipe[name] + count
end
end
if not all_recipes[typ] then
all_recipes[typ] = {}
end
table.insert(all_recipes[typ], { def.output, def.recipe })
end
function crafter.get_craft_result(typ, list)
if not (typ and list) then
return
end
--todo
end
minetest.after(5, function()
local test = minetest.get_inventory({type="player", name="singleplayer"})
if test then
test:set_stack("main", 10, "default:torch")
else
print("error")
end
end)
crafter.register_craft_type("12test")
crafter.register_craft({
type = "12test",
output = "default:stick",
recipe = { "default:stick" }
})
LionsDen wrote:Technic has the alloy furnace. That might be what you are looking for and the mod is still being worked on.
viewtopic.php?id=2538
Users browsing this forum: No registered users and 10 guests