HulkSmashRocks wrote:Nodeboxes are 6 faces, not 4 though?
KCoombes wrote:Try this:
output = 'noncubic:mill',
recipe = {
{'default:cobble', 'default:stick', 'default:cobble'},
{'default:wood', 'default:wood', 'default:wood'},
{'default:stick', "", 'default:stick'},
MineYoshi wrote:KCoombes wrote:Try this:
output = 'noncubic:mill',
recipe = {
{'default:cobble', 'default:stick', 'default:cobble'},
{'default:wood', 'default:wood', 'default:wood'},
{'default:stick', "", 'default:stick'},
Exactly This:
CobbleStone - Stick - CobbleStone
Wood - Wood - Wood
Stick - Empty - Stick
Not My Real Account wrote:-snip-
I have tried the recipe that was suggested here, using both planks and "tree" in place of "wood," and still have not succeeded in crafting the milling machine. Does this have something to do with the version of Minetest I am running (0.4.14), or perhaps I have not installed the correct version of the mod? Also, how do I craft doors with this mod?
local detail = detail_level
local slopebox_1 = {}
for i = 0, detail - 1 do
slopebox_1[i + 1] = {
-0.5, ( i / detail ) - 0.5, ( i / detail ) - 0.5,
0.5, ( ( i + 1 ) / detail ) - 0.5, 0.5
}
end
local slopebox_2 = {}
for i = 1, detail - 1 do
slopebox_2[i] = {
( i / detail ) - 0.5, ( i / detail ) - 0.5, -0.5,
0.5, ( ( i + 1 ) / detail ) - 0.5, 0.5
}
end
local slopeinneredgebox = {}
for i = 0, #slopebox_1 do
slopeinneredgebox_1[i + 1] = slopebox_1[i + 1]
end
for i = 0, #slopebox_2 do
slopeinneredgebox_2[i + 1 + #slopebox_1] = slopebox_2[i + 1]
end
local detail = detail_level
local slopeupsdwnbox_1 = {}
for i = 0, detail - 1 do
slopeupsdwnbox_1[i + 1] = {
-0.5, -1 * ( ( ( i + 1 ) / detail ) - 0.5 ), ( i / detail ) - 0.5,
0.5, -1 * ( ( i / detail ) - 0.5 ), 0.5
}
end
local slopeupsdwnbox_2 = {}
for i = 1, detail - 1 do
slopeupsdwnbox_2[i] = {
( i / detail ) - 0.5, -1 * ( ( ( i + 1 ) / detail ) - 0.5 ), -0.5,
0.5, -1 * ( ( i / detail ) - 0.5 ), 0.5
}
end
local slopeupdwninneredgebox = {}
for i = 0, #slopeupdwnbox_1 do
slopeupdwninneredgebox[i + 1] = slopeupdwnbox_1[i + 1]
end
for i = 0, #slopeupdwnbox_2 do
slopeupdwninneredgebox[i + 1 + #slopeupdwnbox_1] = slopeupdwnbox_2[i + 1]
end
local detail = detail_level
local sehne
local cylbox = {}
for i = 1, detail do
if i <= detail / 2 then
sehne = math.sqrt( 0.25 - ( ( ( i / detail ) - 0.5 ) ^ 2 ) )
elseif i == detail / 2 + 0.5 then
sehne = 0.5 -- For uneven numbers at detail_level
else
sehne = math.sqrt( 0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
end
cylbox[i] = {
( ( i - 1 ) / detail ) - 0.5, -0.5, -sehne,
(i / detail) - 0.5, 0.5, sehne
}
end
local detail = detail_level
local pyrabox = {}
for i = 0, math.ceil ( detail / 2 ) - 1 do
pyrabox[i + 1] = {
( i / detail ) - 0.5, ( i / detail ) - 0.5, ( i / detail ) - 0.5,
0.5 - ( i / detail ), ( ( i + 1 ) / detail ) - 0.5, 0.5 - ( i / detail )
}
end
local detail = detail_level
local sehne
local quartercyclebox = {}
for i = 1, detail do
if i > detail / 2 then
sehne = math.sqrt(0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
else
sehne = 0.5
end
quartercyclebox[i] = {
-0.5, ( ( i - 1 ) / detail ) - 0.5, -sehne,
0.5, ( i / detail ) - 0.5, 0.5
}
end
-- NonCubic Blocks MOD v1.4
------------ by yves_de_beck
-- HERE YOU CAN CHANGE THE DETAIL-LEVEL:
----------------------------------------
detail_level = 16
-- HERE YOU CAN DE/ACTIVATE BACKGROUND FOR MILLING MENU:
--------------------------------------------------------
allow_menu_background = false
-- Includes:
------------
dofile(minetest.get_modpath("noncubic") .. "/mill.lua")
-- VAR DECLARATION:
-------------------
noncubic = {}
-- REGISTER NONCUBIC FORMS, CREATE MODELS AND RECIPES:
------------------------------------------------------
-- SLOPE
--------
function noncubic.register_slope(subname, description, images, recipeitem, groups)
local detail = detail_level
local slopebox = {}
for i = 0, detail - 1 do
slopebox[i + 1] = {
-0.5, (i / detail) - 0.5, (i / detail) - 0.5,
0.5, ((i + 1) / detail) - 0.5, 0.5
}
end
minetest.register_node(":noncubic:slope_" .. subname, {
description = description .. " Slope",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopebox,
},
node_box = {
type = "fixed",
fixed = slopebox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_' .. subname .. ' 6',
recipe = {
{ recipeitem, "", "" },
{ recipeitem, recipeitem, "" },
{ recipeitem, recipeitem, recipeitem },
},
})
minetest.register_craft({
output = 'noncubic:slope_' .. subname .. ' 6',
recipe = {
{ "", "", recipeitem },
{ "", recipeitem, recipeitem },
{ recipeitem, recipeitem, recipeitem },
},
})
end
-- SLOPE Lying
----------------
function noncubic.register_slope_lying(subname, description, images, recipeitem, groups)
local detail = detail_level
local slopeboxlying = {}
for i = 0, detail - 1 do
slopeboxlying[i + 1] = {
(i / detail) - 0.5, -0.5, (i / detail) - 0.5,
((i + 1) / detail) - 0.5, 0.5, 0.5
}
end
minetest.register_node(":noncubic:slope_lying_" .. subname, {
description = description .. " Slope Lying",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopeboxlying,
},
node_box = {
type = "fixed",
fixed = slopeboxlying,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_lying_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:slope_' .. subname, "" },
{ "", "", "" },
},
})
end
-- SLOPE EDGE
-------------
function noncubic.register_slope_edge(subname, description, images, recipeitem, groups)
local detail = detail_level
local slopeboxedge = {}
for i = 0, detail - 1 do
slopeboxedge[i + 1] = {
(i / detail) - 0.5, (i / detail) - 0.5, (i / detail) - 0.5,
0.5, ((i + 1) / detail) - 0.5, 0.5
}
end
minetest.register_node(":noncubic:slope_edge_" .. subname, {
description = description .. " Slope Edge",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopeboxedge,
},
node_box = {
type = "fixed",
fixed = slopeboxedge,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_edge_' .. subname .. ' 3',
recipe = {
{ "", "", "" },
{ recipeitem, "", "" },
{ recipeitem, recipeitem, "" },
},
})
minetest.register_craft({
output = 'noncubic:slope_edge_' .. subname .. ' 3',
recipe = {
{ "", "", "" },
{ "", "", recipeitem },
{ "", recipeitem, recipeitem },
},
})
end
-- SLOPE INNER EDGE
-------------------
function noncubic.register_slope_inner_edge(subname, description, images, recipeitem, groups)
local detail = detail_level
local slopebox_1 = {}
for i = 0, detail - 1 do
slopebox_1[i + 1] = {
-0.5, ( i / detail ) - 0.5, ( i / detail ) - 0.5,
0.5, ( ( i + 1 ) / detail ) - 0.5, 0.5
}
end
local slopebox_2 = {}
for i = 1, detail - 1 do
slopebox_2[i] = {
( i / detail ) - 0.5, ( i / detail ) - 0.5, -0.5,
0.5, ( ( i + 1 ) / detail ) - 0.5, 0.5
}
end
local slopeinneredgebox = {}
for i = 0, #slopebox_1 do
slopeinneredgebox[i + 1] = slopebox_1[i + 1]
end
for i = 0, #slopebox_2 do
slopeinneredgebox[i + 1 + slopebox_1] = slopebox_2[i + 1]
end
minetest.register_node(":noncubic:slope_inner_edge_" .. subname, {
description = description .. " Slope Inner Edge",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopeinneredgebox,
},
node_box = {
type = "fixed",
fixed = slopeinneredgebox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_inner_edge_' .. subname .. ' 3',
recipe = {
{ "", "", recipeitem },
{ recipeitem, "", "" },
{ recipeitem, recipeitem, "" },
},
})
minetest.register_craft({
output = 'noncubic:slope_inner_edge_' .. subname .. ' 3',
recipe = {
{ recipeitem, "", "" },
{ "", "", recipeitem },
{ "", recipeitem, recipeitem },
},
})
end
-- SLOPE UPSIDE DOWN
--------------------
function noncubic.register_slope_upsdown(subname, description, images, recipeitem, groups)
if subname == "dirt" then
return
end
local detail = detail_level
local slopeupsdwnbox = {}
for i = 0, detail - 1 do
slopeupsdwnbox[i + 1] = {
-0.5, -1 * (((i + 1) / detail) - 0.5), (i / detail) - 0.5,
0.5, -1 * ((i / detail) - 0.5), 0.5
}
end
minetest.register_node(":noncubic:slope_upsdown_" .. subname, {
description = description .. " Slope Upside Down",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopeupsdwnbox,
},
node_box = {
type = "fixed",
fixed = slopeupsdwnbox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_upsdown_' .. subname .. ' 6',
recipe = {
{ recipeitem, recipeitem, recipeitem },
{ "", recipeitem, recipeitem },
{ "", "", recipeitem },
},
})
minetest.register_craft({
output = 'noncubic:slope_upsdown_' .. subname .. ' 6',
recipe = {
{ recipeitem, recipeitem, recipeitem },
{ recipeitem, recipeitem, "" },
{ recipeitem, "", "" },
},
})
end
-- SLOPE EDGE UPSIDE DOWN
-------------------------
function noncubic.register_slope_upsdown_edge(subname, description, images, recipeitem, groups)
if subname == "dirt" then
return
end
local detail = detail_level
local slopeupsdwnboxedge = {}
for i = 0, detail - 1 do
slopeupsdwnboxedge[i + 1] = {
(i / detail) - 0.5, -1 * (((i + 1) / detail) - 0.5), (i / detail) - 0.5,
0.5, -1 * ((i / detail) - 0.5), 0.5
}
end
minetest.register_node(":noncubic:slope_upsdown_edge_" .. subname, {
description = description .. " Slope Upside Down Edge",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopeupsdwnboxedge,
},
node_box = {
type = "fixed",
fixed = slopeupsdwnboxedge,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_upsdown_edge_' .. subname .. ' 3',
recipe = {
{ "", recipeitem, recipeitem },
{ "", "", recipeitem },
{ "", "", "" },
},
})
minetest.register_craft({
output = 'noncubic:slope_upsdown_edge_' .. subname .. ' 3',
recipe = {
{ recipeitem, recipeitem, "" },
{ recipeitem, "", "" },
{ "", "", "" },
},
})
end
-- SLOPE INNER EDGE UPSIDE DOWN
-------------------------------
function noncubic.register_slope_upsdown_inner_edge(subname, description, images, recipeitem, groups)
if subname == "dirt" then
return
end
local detail = detail_level
local slopeupsdwnbox_1 = {}
for i = 0, detail - 1 do
slopeupsdwnbox_1[i + 1] = {
-0.5, -1 * ( ( ( i + 1 ) / detail ) - 0.5 ), ( i / detail ) - 0.5,
0.5, -1 * ( ( i / detail ) - 0.5 ), 0.5
}
end
local slopeupsdwnbox_2 = {}
for i = 1, detail - 1 do
slopeupsdwnbox_2[i] = {
( i / detail ) - 0.5, -1 * ( ( ( i + 1 ) / detail ) - 0.5 ), -0.5,
0.5, -1 * ( ( i / detail ) - 0.5 ), 0.5
}
end
local slopeupsdwninneredgebox = {}
for i = 0, #slopeupsdwnbox_1 do
slopeupsdwninneredgebox[i + 1] = slopeupsdwnbox_1[i + 1]
end
for i = 0, #slopeupsdwnbox_2 do
slopeupsdwninneredgebox[i + 1 + slopeupsdwnbox_1] = slopeupsdwnbox_2[i + 1]
end
minetest.register_node(":noncubic:slope_upsdown_inner_edge_" .. subname, {
description = description .. " Slope Upside Down Inner Edge",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = slopeupsdwninneredgebox,
},
node_box = {
type = "fixed",
fixed = slopeupsdwninneredgebox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:slope_upsdown_inner_edge_' .. subname .. ' 3',
recipe = {
{ "", recipeitem, recipeitem },
{ "", "", recipeitem },
{ recipeitem, "", "" },
},
})
minetest.register_craft({
output = 'noncubic:slope_upsdown_inner_edge_' .. subname .. ' 3',
recipe = {
{ recipeitem, recipeitem, "" },
{ recipeitem, "", "" },
{ "", "", recipeitem },
},
})
end
-- PYRAMID
----------
function noncubic.register_pyramid(subname, description, images, recipeitem, groups)
local detail = detail_level
local pyrabox = {}
for i = 0, math.ceil ( detail / 2 ) - 1 do
pyrabox[i + 1] = {
( i / detail ) - 0.5, ( i / detail ) - 0.5, ( i / detail ) - 0.5,
0.5 - ( i / detail ), ( ( i + 1 ) / detail ) - 0.5, 0.5 - ( i / detail )
}
end
minetest.register_node(":noncubic:pyramid_" .. subname, {
description = description .. " Pyramid",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = pyrabox,
},
node_box = {
type = "fixed",
fixed = pyrabox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:pyramid_' .. subname .. ' 3',
recipe = {
{ "", "", "" },
{ "", recipeitem, "" },
{ recipeitem, "", recipeitem },
},
})
end
-- SPIKE
--------
function noncubic.register_spike(subname, description, images, recipeitem, groups)
if subname == "dirt" then
return
end
local detail = detail_level
local spikebox = {}
for i = 0, detail - 1 do
spikebox[i + 1] = {
( i / detail / 2 ) - 0.5, (i / detail) - 0.5, ( i / detail / 2 ) - 0.5,
0.5 - ( i / detail / 2 ), ( ( i + 1 ) / detail ) - 0.5, 0.5 - ( i / detail / 2 )
}
end
minetest.register_node(":noncubic:spike_" .. subname, {
description = description .. " Spike",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = spikebox,
},
node_box = {
type = "fixed",
fixed = spikebox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:spike_' .. subname .. ' 5',
recipe = {
{ "", recipeitem, "" },
{ recipeitem, "", recipeitem },
{ recipeitem, "", recipeitem },
},
})
end
-- BLOCK ONE CURVED EDGE
------------------------
function noncubic.register_onecurvededge(subname, description, images, recipeitem, groups)
local detail = detail_level
local sehne
local quartercyclebox = {}
for i = 1, detail do
if i > detail / 2 then
sehne = math.sqrt(0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
else
sehne = 0.5
end
quartercyclebox[i] = {
-0.5, ( ( i - 1 ) / detail ) - 0.5, -sehne,
0.5, ( i / detail ) - 0.5, 0.5
}
end
minetest.register_node(":noncubic:onecurvededge_" .. subname, {
description = description .. " One Curved Edge Block",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = quartercyclebox,
},
node_box = {
type = "fixed",
fixed = quartercyclebox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:onecurvededge_' .. subname .. ' 8',
recipe = {
{ "", recipeitem, recipeitem },
{ recipeitem, recipeitem, recipeitem },
{ recipeitem, recipeitem, recipeitem },
},
})
end
-- BLOCK TWO CURVED EDGE
------------------------
function noncubic.register_twocurvededge(subname, description, images, recipeitem, groups)
local detail = detail_level
local sehne
local quartercyclebox2 = {}
for i = 1, detail do
if i > detail / 2 then
sehne = math.sqrt( 0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
else
sehne = 0.5
end
quartercyclebox2[i] = {
-sehne, ( ( i - 1 ) / detail ) - 0.5, -sehne,
0.5, ( i / detail ) - 0.5, 0.5
}
end
minetest.register_node(":noncubic:twocurvededge_" .. subname, {
description = description .. " Two Curved Edge Block",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = quartercyclebox2,
},
node_box = {
type = "fixed",
fixed = quartercyclebox2,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:twocurvededge_' .. subname .. ' 3',
recipe = {
{ "", "", "" },
{ 'noncubic:onecurvededge_' .. subname, "", "" },
{ 'noncubic:onecurvededge_' .. subname, 'noncubic:onecurvededge_' .. subname, "" },
},
})
end
-- CYLINDER
-----------
function noncubic.register_cylinder(subname, description, images, recipeitem, groups)
local detail = detail_level
local sehne
local cylbox = {}
for i = 1, detail do
if i <= detail / 2 then
sehne = math.sqrt( 0.25 - ( ( ( i / detail ) - 0.5 ) ^ 2 ) )
elseif i == detail / 2 + 0.5 then
sehne = 0.5 -- For uneven numbers at detail_level
else
sehne = math.sqrt( 0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
end
cylbox[i] = {
( ( i - 1 ) / detail ) - 0.5, -0.5, -sehne,
(i / detail) - 0.5, 0.5, sehne
}
end
minetest.register_node(":noncubic:cylinder_" .. subname, {
description = description .. " Cylinder",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = cylbox,
},
node_box = {
type = "fixed",
fixed = cylbox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:cylinder_' .. subname .. ' 6',
recipe = {
{ recipeitem, recipeitem, "" },
{ recipeitem, recipeitem, "" },
{ recipeitem, recipeitem, "" },
},
})
minetest.register_craft({
output = 'noncubic:cylinder_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:cylinder_horizontal_' .. subname, "" },
{ "", "", "" },
},
})
end
-- CYLINDER HORIZONTAL
----------------------
function noncubic.register_cylinder_horizontal(subname, description, images, recipeitem, groups)
if subname == "dirt" then
return
end
local detail = detail_level
local sehne
local cylbox_horizontal = {}
for i = 1, detail do
if i <= detail / 2 then
sehne = math.sqrt( 0.25 - ( ( ( i / detail ) - 0.5 ) ^ 2 ) )
elseif i == detail / 2 + 0.5 then
sehne = 0.5 -- For uneven numbers at detail_level
else
sehne = math.sqrt( 0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
end
cylbox_horizontal[i] = {
-0.5, ((i - 1) / detail) - 0.5, -sehne,
0.5, (i / detail) - 0.5, sehne
}
end
minetest.register_node(":noncubic:cylinder_horizontal_" .. subname, {
description = description .. " Cylinder Horizontal",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = cylbox_horizontal,
},
node_box = {
type = "fixed",
fixed = cylbox_horizontal,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:cylinder_horizontal_' .. subname .. ' 6',
recipe = {
{ "", "", "" },
{ recipeitem, recipeitem, recipeitem },
{ recipeitem, recipeitem, recipeitem },
},
})
minetest.register_craft({
output = 'noncubic:cylinder_horizontal_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:cylinder_' .. subname, "" },
{ "", "", "" },
},
})
end
-- SPHERE
---------
function noncubic.register_sphere(subname, description, images, recipeitem, groups)
local detail = detail_level
local sehne
local spherebox = {}
for i = 1, detail do
if i <= detail / 2 then
sehne = math.sqrt( 0.25 - ( ( ( i / detail ) - 0.5 ) ^ 2 ) )
elseif i == detail / 2 + 0.5 then
sehne = 0.5 -- For uneven numbers at detail_level
else
sehne = math.sqrt( 0.25 - ( ( ( ( i - 1 ) / detail ) - 0.5 ) ^ 2 ) )
end
spherebox[i] = {
-sehne, ( ( i - 1 ) / detail ) - 0.5, -sehne,
sehne, ( i / detail ) - 0.5, sehne
}
end
minetest.register_node(":noncubic:cylinder_sphere_" .. subname, {
description = description .. " Sphere",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = spherebox,
},
node_box = {
type = "fixed",
fixed = spherebox,
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:cylinder_sphere_' .. subname .. ' 4',
recipe = {
{ "", recipeitem, "" },
{ recipeitem, "", recipeitem },
{ "", recipeitem, "" },
},
})
end
-- ELEMENT STRAIGHT
-------------------
function noncubic.register_element_straight(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_straight_" .. subname, {
description = description .. " Element Straight",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.5, 0.3125, 0, 0.5 },
},
node_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.5, 0.3125, 0, 0.5 },
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_straight_' .. subname .. ' 12',
recipe = {
{ "", recipeitem, "" },
{ "", recipeitem, "" },
{ "", recipeitem, "" },
},
})
end
-- ELEMENT EDGE
---------------
function noncubic.register_element_edge(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_edge_" .. subname, {
description = description .. " Element Edge",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0, 0.3125 },
{ -0.3125, -0.5, -0.3125, 0.3125, 0, 0.5 },
},
},
node_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0, 0.3125 },
{ -0.3125, -0.5, -0.3125, 0.3125, 0, 0.5 },
},
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_edge_' .. subname .. ' 10',
recipe = {
{ recipeitem, recipeitem, recipeitem },
{ "", "", recipeitem },
{ "", "", recipeitem },
},
})
end
-- ELEMENT T
------------
function noncubic.register_element_t(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_t_" .. subname, {
description = description .. " Element T",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0, 0.5 },
},
},
node_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0, 0.5 },
},
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_t_' .. subname .. ' 8',
recipe = {
{ "", "", "" },
{ recipeitem, recipeitem, recipeitem },
{ "", recipeitem, "" },
},
})
end
-- ELEMENT CROSS
----------------
function noncubic.register_element_cross(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_cross_" .. subname, {
description = description .. " Element Cross",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.3125, 0.5, 0, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0, 0.5 },
},
},
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.3125, 0.5, 0, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0, 0.5 },
},
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_cross_' .. subname .. ' 10',
recipe = {
{ "", recipeitem, "" },
{ recipeitem, recipeitem, recipeitem },
{ "", recipeitem, "" },
},
})
end
-- ELEMENT END
--------------
function noncubic.register_element_end(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_end_" .. subname, {
description = description .. " Element End",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0, 0.5 },
},
node_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0, 0.5 },
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_end_' .. subname .. ' 8',
recipe = {
{ "", "", "" },
{ "", recipeitem, "" },
{ "", recipeitem, "" },
},
})
end
-- ELEMENT STRAIGHT DOUBLE
--------------------------
function noncubic.register_element_straight_double(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_straight_double_" .. subname, {
description = description .. " Element Straight Double",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.5, 0.3125, 0.5, 0.5 },
},
node_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.5, 0.3125, 0.5, 0.5 },
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_straight_double_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:element_straight_' .. recipeitem, "" },
{ "", 'noncubic:element_straight_' .. recipeitem, "" },
},
})
end
-- ELEMENT EDGE DOUBLE
----------------------
function noncubic.register_element_edge_double(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_edge_double_" .. subname, {
description = description .. " Element Edge Double",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0.5, 0.3125 },
{ -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.5 },
},
},
node_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0.5, 0.3125 },
{ -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.5 },
},
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_edge_double_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:element_edge_' .. recipeitem, "" },
{ "", 'noncubic:element_edge_' .. recipeitem, "" },
},
})
end
-- ELEMENT T DOUBLE
-------------------
function noncubic.register_element_t_double(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_t_double_" .. subname, {
description = description .. " Element T Double",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0.5, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0.5, 0.5 },
},
},
node_box = {
type = "fixed",
fixed = {
{ 0.3125, -0.5, -0.3125, 0.5, 0.5, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0.5, 0.5 },
},
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_t_double_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:element_t_' .. recipeitem, "" },
{ "", 'noncubic:element_t_' .. recipeitem, "" },
},
})
end
-- ELEMENT CROSS DOUBLE
-----------------------
function noncubic.register_element_cross_double(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_cross_double_" .. subname, {
description = description .. " Element Cross Double",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.3125, 0.5, 0.5, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0.5, 0.5 },
},
},
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.3125, 0.5, 0.5, 0.3125 },
{ -0.3125, -0.5, -0.5, 0.3125, 0.5, 0.5 },
},
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_cross_double_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:element_cross_' .. recipeitem, "" },
{ "", 'noncubic:element_cross_' .. recipeitem, "" },
},
})
end
-- ELEMENT END DOUBLE
---------------------
function noncubic.register_element_end_double(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:element_end_double_" .. subname, {
description = description .. " Element End Double",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.5 },
},
node_box = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.5 },
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:element_end_double_' .. subname .. ' 1',
recipe = {
{ "", "", "" },
{ "", 'noncubic:element_end_' .. recipeitem, "" },
{ "", 'noncubic:element_end_' .. recipeitem, "" },
},
})
end
-- STICK
--------
function noncubic.register_stick(subname, description, images, recipeitem, groups)
minetest.register_node(":noncubic:stick_" .. subname, {
description = description .. " Stick",
tiles = images,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
},
node_box = {
type = "fixed",
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
},
groups = groups,
})
minetest.register_craft({
output = 'noncubic:stick_' .. subname .. ' 8',
recipe = {
{ 'default:stick', "", "" },
{ "", "", "" },
{ recipeitem, "", "" },
},
})
end
-- REGISTER NEW NONCUBIC'S PART 2:
----------------------------------
local wood_types = {
{ "wood", "Wooden", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1} },
{ "junglewood", "Jungle Wood", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1} },
{ "pine_wood", "Pine Wood", {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1} },
{ "acacia_wood", "Acacia Wood", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1} },
{ "aspen_wood", "Aspen Wood", {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1} },
{ "tree", "Tree", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tree = 1} },
{ "jungletree", "Jungle Tree", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tree = 1} },
{ "pine_tree", "Pine Tree", {choppy = 3, oddly_breakable_by_hand = 1, flammable = 3, tree = 1} },
{ "acacia_tree", "Acacia Tree", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tree = 1} },
{ "aspen_tree", "Aspen Tree", {choppy = 3, oddly_breakable_by_hand = 1, flammable = 3, tree = 1} },
{ "leaves", "Leaves", {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1} },
{ "jungleleaves", "Jungle Leaves", {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1} },
{ "pine_needles", "Pine Needles", {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1} },
{ "acacia_leaves", "Acacia Leaves", {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1} },
{ "aspen_leaves", "Aspen Leaves", {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1} }
}
local stone_types = {
{ "stone", "Stone", "stone", { cracky = 3 } },
{ "cobble", "Cobblestone", "cobble", { cracky = 3 } },
{ "mossycobble", "Mossy Cobblestone", "mossycobble", { cracky = 3 } },
{ "stonebrick", "Stone Brick", "stone_brick", { cracky = 2 } },
{ "stone_block", "Stone Block", "stone_block", { cracky = 2 } },
{ "desert_stone", "Desert Stone", "desert_stone", { cracky = 3 } },
{ "desert_cobble", "Desert Cobblestone", "desert_cobble", { cracky = 3 } },
{ "desert_stonebrick", "Desert Stone Brick", "desert_stone_brick", { cracky = 2 } },
{ "desert_stone_block", "Desert Stone Block", "desert_stone_block", { cracky = 2 } },
{ "sandstone", "Sandstone", "sandstone", { cracky = 3, crumbly = 1 } },
{ "sandstonebrick", "Sandstone Brick", "sandstone_brick", { cracky = 2 } },
{ "sandstone_block", "Sandstone Block", "sandstone_block", { cracky = 2 } },
{ "desert_sandstone", "Desert Sandstone", "desert_sandstone", { cracky = 3, crumbly = 1 } },
{ "desert_sandstonebrick", "Desert Sandstone Brick", "desert_sandstone_brick", { cracky = 2 } },
{ "desert_sandstone_block", "Desert Sandstone Block", "desert_sandstone_block", { cracky = 2 } },
{ "silver_sandstone", "Silver Sandstone", "silver_sandstone", { cracky = 3, crumbly = 1 } },
{ "silver_sandstonebrick", "Silver Sandstone Brick", "silver_sandstone_brick", { cracky = 2 } },
{ "silver_sandstone_block", "Silver Sandstone Block", "silver_sandstone_block", { cracky = 2 } },
{ "obsidian", "Obsidian", "obsidian", { cracky = 1, level = 2 } },
{ "obsidianbrick", "Obsidian Brick", "obsidian_brick", { cracky = 1, level = 2 } },
{ "obsidian_block", "Obsidian Block", "obsidian_block", { cracky = 1, level = 2 } },
{ "brick", "Brick", "brick", { cracky = 3 } }
}
local metal_types = {
{ "steelblock", "Steel Block", "steel_block", { cracky = 1, level = 2 } },
{ "tinblock", "Tin Block", "tin_block", { cracky = 1, level = 2 } },
{ "copperblock", "Copper Block", "copper_block", { cracky = 1, level = 2 } },
{ "bronzeblock", "Bronze Block", "bronze_block", { cracky = 1, level = 2 } },
{ "goldblock", "Gold Block", "gold_block", { cracky = 1 } }
}
-- REGISTER NONCUBIC NODES: noncubic.register_xyz(subname, desc_xyz, images, recipeitem, groups)
-------------------------------------------------------------------------------------------------------------
function noncubic.register_slope_edge_etc(subname, description, images, recipeitem, groups)
noncubic.register_slope(subname, description, images, recipeitem, groups)
noncubic.register_slope_lying(subname, description, images, recipeitem, groups)
noncubic.register_slope_edge(subname, description, images, recipeitem, groups)
noncubic.register_slope_inner_edge(subname, description, images, recipeitem, groups)
noncubic.register_slope_upsdown(subname, description, images, recipeitem, groups)
noncubic.register_slope_upsdown_edge(subname, description, images, recipeitem, groups)
noncubic.register_slope_upsdown_inner_edge(subname, description, images, recipeitem, groups)
noncubic.register_pyramid(subname, description, images, recipeitem, groups)
noncubic.register_spike(subname, description, images, recipeitem, groups)
noncubic.register_onecurvededge(subname, description, images, recipeitem, groups)
noncubic.register_twocurvededge(subname, description, images, recipeitem, groups)
noncubic.register_cylinder(subname, description, images, recipeitem, groups)
noncubic.register_cylinder_horizontal(subname, description, images, recipeitem, groups)
noncubic.register_sphere(subname, description, images, recipeitem, groups)
end
-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC NODES:
-----------------------------------------------------------
-- WOOD
-------
for i = 1, #wood_types do
local name, description, groups = unpack(wood_types[i])
noncubic.register_slope_edge_etc(name,
description,
{ "default_" .. name .. ".png" },
"default:" .. name,
groups)
end
-- STONE
--------
for i = 1, #stone_types do
local name, description, texture, groups = unpack(stone_types[i])
noncubic.register_slope_edge_etc(name,
description,
{ "default_" .. texture .. ".png" },
"default:" .. name,
groups)
end
-- METAL
--------
for i = 1, #metal_types do
local name, description, texture, groups = unpack(metal_types[i])
noncubic.register_slope_edge_etc(name,
description,
{ "default_" .. texture .. ".png" },
"default:" .. name,
groups)
end
-- DIRT
-------
noncubic.register_slope_edge_etc("dirt",
"Dirt",
{ "default_grass.png", "default_dirt.png", "default_grass.png" },
"default:dirt",
{ snappy = 2, choppy = 2, oddly_breakable_by_hand = 3 })
-- REGISTER WALL ELEMNTS: noncubic.register_xyz(subname3, recipeitem3, groups3, images3, desc_element_xyz)
----------------------------------------------------------------------------------------------------
function noncubic.register_elements(subname, description, images, recipeitem, groups)
noncubic.register_element_straight(subname, description, images, recipeitem, groups)
noncubic.register_element_edge(subname, description, images, recipeitem, groups)
noncubic.register_element_t(subname, description, images, recipeitem, groups)
noncubic.register_element_cross(subname, description, images, recipeitem, groups)
noncubic.register_element_end(subname, description, images, recipeitem, groups)
noncubic.register_element_straight_double(subname, description, images, recipeitem, groups)
noncubic.register_element_edge_double(subname, description, images, recipeitem, groups)
noncubic.register_element_t_double(subname, description, images, recipeitem, groups)
noncubic.register_element_cross_double(subname, description, images, recipeitem, groups)
noncubic.register_element_end_double(subname, description, images, recipeitem, groups)
end
-- REGISTER MATERIALS AND PROPERTIES FOR HALF AND NORMAL HEIGHT ELEMENTS:
-------------------------------------------------------------------------
-- WOOD
-------
for i = 1, #wood_types do
local name, description, groups = unpack(wood_types[i])
noncubic.register_elements(name,
description,
{ "default_" .. name .. ".png" },
"default:" .. name,
groups)
end
-- STONE
--------
for i = 1, #stone_types do
local name, description, texture, groups = unpack(stone_types[i])
noncubic.register_elements(name,
description,
{ "default_" .. texture .. ".png" },
"default:" .. name,
groups)
end
-- METAL
--------
for i = 1, #metal_types do
local name, description, texture, groups = unpack(metal_types[i])
noncubic.register_elements(name,
description,
{ "default_" .. texture .. ".png" },
"default:" .. name,
groups)
end
-- REGISTER MATERIALS AND PROPERTIES FOR STICKS:
------------------------------------------------
-- WOOD
-------
for i = 1, #wood_types do
local name, description, groups = unpack(wood_types[i])
noncubic.register_stick(name,
description,
{ "default_" .. name .. ".png" },
"default:" .. name,
groups)
end
-- STONE
--------
for i = 1, #stone_types do
local name, description, texture, groups = unpack(stone_types[i])
noncubic.register_stick(name,
description,
{ "default_" .. texture .. ".png" },
"default:" .. name,
groups)
end
-- METAL
--------
for i = 1, #metal_types do
local name, description, texture, groups = unpack(metal_types[i])
noncubic.register_stick(name,
description,
{ "default_" .. texture .. ".png" },
"default:" .. name,
groups)
end
Not My Real Account wrote:-snip-
I have tried the recipe that was suggested here, using both planks and "tree" in place of "wood," and still have not succeeded in crafting the milling machine. Does this have something to do with the version of Minetest I am running (0.4.14), or perhaps I have not installed the correct version of the mod? Also, how do I craft doors with this mod?
material = {}
shape = {}
size = "0"
make_ok = {}
exclude = {}
anzahl = {}
showbackground = "--"
showlabelin = "label[0,5.5;In:]"
showlabelout = "label[4.5,5.5;Out:]"
minetest.register_node("noncubic:mill", {
description = "Milling Machine",
tiles = {
"cnc_top.png", "cnc_bottom.png", "cnc_side.png",
"cnc_side.png", "cnc_side.png", "cnc_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
},
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
},
groups = { oddly_breakable_by_hand = 2, cracky = 3, dig_immediate = 1 },
can_dig = function(pos, player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("ingot") then
return false
elseif not inv:is_empty("res") then
return false
end
return true
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
if allow_menu_background == true or allow_menu_background == 1 then
showbackground = "background[-0.15,-0.25;8.40,11.75;milling_background.png]"
end
meta:set_string("formspec", "invsize[8,11;]" ..
showlabelin ..
"list[current_name;ingot;1,5.5;1,1;]" ..
showlabelout ..
"list[current_name;res;6,5.5;1,1;]" ..
"label[0,0;Choose Milling Program:]" ..
"image_button[0,0.5;1,1;slope.png;slope; ]" ..
"image_button[1,0.5;1,1;slope_edge.png;slope_edge; ]" ..
"image_button[2,0.5;1,1;slope_inner_edge.png;slope_inner_edge; ]" ..
"image_button[3,0.5;1,1;pyramid.png;pyramid; ]" ..
"image_button[4,0.5;1,1;spike.png;spike; ]" ..
"image_button[5,0.5;1,1;cylinder.png;cylinder; ]" ..
"image_button[6,0.5;1,1;sphere.png;sphere; ]" ..
"image_button[0,1.5;1,1;slope_upsdwn.png;slope_upsdwn; ]" ..
"image_button[1,1.5;1,1;slope_edge_upsdwn.png;slope_edge_upsdwn; ]" ..
"image_button[2,1.5;1,1;slope_inner_edge_upsdwn.png;slope_inner_edge_upsdwn; ]" ..
"image_button[5,1.5;1,1;cylinder_horizontal.png;cylinder_hor; ]" ..
"image_button[0,2.5;1,1;slope_lying.png;slope_lying; ]" ..
"image_button[1,2.5;1,1;onecurvededge.png;onecurvededge; ]" ..
"image_button[2,2.5;1,1;twocurvededge.png;twocurvededge; ]" ..
"label[0,3.5;Slim Elements half / normal height:]" ..
"image_button[0,4;1,0.5;full.png;full; ]" ..
"image_button[0,4.5;1,0.5;half.png;half; ]" ..
"image_button[1,4;1,1;element_straight.png;element_straight; ]" ..
"image_button[2,4;1,1;element_end.png;element_end; ]" ..
"image_button[3,4;1,1;element_cross.png;element_cross; ]" ..
"image_button[4,4;1,1;element_t.png;element_t; ]" ..
"image_button[5,4;1,1;element_edge.png;element_edge; ]" ..
"image_button[7,0.5;1,1;stick.png;stick; ]" ..
"list[current_player;main;0,7;8,4;]" ..
showbackground)
meta:set_string("infotext", "Milling Machine")
local inv = meta:get_inventory()
inv:set_size("ingot", 1)
inv:set_size("res", 1)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
-- REGISTER MILLING PROGRAMMS AND OUTPUTS:
------------------------------------------
if fields["full"] then
size = "1"
return
end
if fields["half"] then
size = "0"
return
end
if fields["slope"] then
make_ok = "0"
exclude = "0"
anzahl = "2"
shape = "noncubic:slope_"
if inv:is_empty("ingot") then
return
end
end
if fields["slope_edge"] then
make_ok = "0"
exclude = "0"
anzahl = "2"
shape = "noncubic:slope_edge_"
if inv:is_empty("ingot") then
return
end
end
if fields["slope_inner_edge"] then
make_ok = "0"
exclude = "0"
anzahl = "1"
shape = "noncubic:slope_inner_edge_"
if inv:is_empty("ingot") then
return
end
end
if fields["pyramid"] then
make_ok = "0"
exclude = "0"
anzahl = "2"
shape = "noncubic:pyramid_"
if inv:is_empty("ingot") then
return
end
end
if fields["spike"] then
make_ok = "0"
exclude = "1"
anzahl = "1"
shape = "noncubic:spike_"
if inv:is_empty("ingot") then
return
end
end
if fields["cylinder"] then
make_ok = "0"
exclude = "1"
anzahl = "1"
shape = "noncubic:cylinder_"
if inv:is_empty("ingot") then
return
end
end
if fields["cylinder_hor"] then
make_ok = "0"
exclude = "1"
anzahl = "1"
shape = "noncubic:cylinder_horizontal_"
if inv:is_empty("ingot") then
return
end
end
if fields["sphere"] then
make_ok = "0"
exclude = "1"
anzahl = "1"
shape = "noncubic:cylinder_sphere_"
if inv:is_empty("ingot") then
return
end
end
if fields["slope_upsdwn"] then
make_ok = "0"
exclude = "1"
anzahl = "2"
shape = "noncubic:slope_upsdown_"
if inv:is_empty("ingot") then
return
end
end
if fields["slope_edge_upsdwn"] then
make_ok = "0"
exclude = "1"
anzahl = "2"
shape = "noncubic:slope_upsdown_edge_"
if inv:is_empty("ingot") then
return
end
end
if fields["slope_inner_edge_upsdwn"] then
make_ok = "0"
exclude = "1"
anzahl = "1"
shape = "noncubic:slope_upsdown_inner_edge_"
if inv:is_empty("ingot") then
return
end
end
if fields["slope_lying"] then
make_ok = "0"
exclude = "0"
anzahl = "1"
shape = "noncubic:slope_lying_"
if inv:is_empty("ingot") then
return
end
end
if fields["onecurvededge"] then
make_ok = "0"
exclude = "0"
anzahl = "1"
shape = "noncubic:onecurvededge_"
if inv:is_empty("ingot") then
return
end
end
if fields["twocurvededge"] then
make_ok = "0"
exclude = "0"
anzahl = "1"
shape = "noncubic:twocurvededge_"
if inv:is_empty("ingot") then
return
end
end
if fields["element_straight"] then
make_ok = "0"
exclude = "0"
anzahl = "4"
shape = "noncubic:element_straight_"
if size == "1" then
exclude = "1"
anzahl = "2"
shape = "noncubic:element_straight_double_"
end
if inv:is_empty("ingot") then
return
end
end
if fields["element_end"] then
make_ok = "0"
exclude = "0"
anzahl = "4"
shape = "noncubic:element_end_"
if size == "1" then
exclude = "1"
anzahl = "2"
shape = "noncubic:element_end_double_"
end
if inv:is_empty("ingot") then
return
end
end
if fields["element_cross"] then
make_ok = "0"
exclude = "0"
anzahl = "2"
shape = "noncubic:element_cross_"
if size == "1" then
exclude = "1"
anzahl = "1"
shape = "noncubic:element_cross_double_"
end
if inv:is_empty("ingot") then
return
end
end
if fields["element_t"] then
make_ok = "0"
exclude = "0"
anzahl = "2"
shape = "noncubic:element_t_"
if size == "1" then
exclude = "1"
anzahl = "1"
shape = "noncubic:element_t_double_"
end
if inv:is_empty("ingot") then
return
end
end
if fields["element_edge"] then
make_ok = "0"
exclude = "0"
anzahl = "2"
shape = "noncubic:element_edge_"
if size == "1" then
exclude = "1"
anzahl = "1"
shape = "noncubic:element_edge_double_"
end
if inv:is_empty("ingot") then
return
end
end
if fields["stick"] then
make_ok = "0"
exclude = "1"
anzahl = "8"
shape = "noncubic:stick_"
if inv:is_empty("ingot") then
return
end
end
-----------------------------
local ingotstack = inv:get_stack("ingot", 1)
local resstack = inv:get_stack("res", 1)
-- Register Materials Milling Machine can make Shapes
-----------------------------------------------------
local wood_types = {
{ "wood" },
{ "junglewood" },
{ "pine_wood" },
{ "acacia_wood" },
{ "aspen_wood" },
{ "tree" },
{ "jungletree" },
{ "pine_tree" },
{ "acacia_tree" },
{ "aspen_tree" },
{ "leaves" },
{ "jungleleaves" },
{ "pine_needles" },
{ "acacia_leaves" },
{ "aspen_leaves" }
}
local stone_types = {
{ "stone" },
{ "cobble" },
{ "mossycobble" },
{ "stonebrick" },
{ "stone_block" },
{ "desert_stone" },
{ "desert_cobble" },
{ "desert_stonebrick" },
{ "desert_stone_block" },
{ "sandstone" },
{ "sandstonebrick" },
{ "sandstone_block" },
{ "desert_sandstone" },
{ "desert_sandstonebrick" },
{ "desert_sandstone_block" },
{ "silver_sandstone" },
{ "silver_sandstonebrick" },
{ "silver_sandstone_block" },
{ "obsidian" },
{ "obsidianbrick" },
{ "obsidian_block" },
{ "brick" }
}
local metal_types = {
{ "steelblock" },
{ "tinblock" },
{ "copperblock" },
{ "bronzeblock" },
{ "goldblock" }
}
for i = 1, #wood_types do
local name = unpack(wood_types[i])
if ingotstack:get_name() == "default:" .. name then
material = name
make_ok = "1"
end
end
for i = 1, #stone_types do
local name = unpack(stone_types[i])
if ingotstack:get_name() == "default:" .. name then
material = name
make_ok = "1"
end
end
for i = 1, #metal_types do
local name = unpack(metal_types[i])
if ingotstack:get_name() == "default:" .. name then
material = name
make_ok = "1"
end
end
if ingotstack:get_name() == "default:dirt" then
material = "dirt"
make_ok = "1"
if exclude == "1" then
make_ok = "0"
end
end
-----------------------------------------------------
-- Milling
----------
if make_ok == "1" then
local give = {}
for i = 0, anzahl - 1 do
give[i + 1] = inv:add_item("res", shape .. material)
end
ingotstack:take_item()
inv:set_stack("ingot", 1, ingotstack)
end
end,
})
----------
-- Milling Machine Recipe
-------------------------
minetest.register_craft({
output = 'noncubic:mill',
recipe = {
{ 'default:cobble', 'default:stick', 'default:cobble' },
{ 'default:wood', 'default:wood', 'default:wood' },
{ 'default:stick', "", 'default:stick' },
},
})
-------------------------
Users browsing this forum: vtwindsurfer and 6 guests