2015-04-27 10:31:29 -07:00
|
|
|
local material = {}
|
|
|
|
local block = {}
|
2015-05-18 07:17:15 -07:00
|
|
|
local make_ok = false
|
|
|
|
local anzahl = 0
|
2015-04-27 10:31:29 -07:00
|
|
|
local material2 = {}
|
|
|
|
local stone = {}
|
2015-09-13 16:04:26 -07:00
|
|
|
local deco = {}
|
2015-04-27 10:31:29 -07:00
|
|
|
|
2015-05-14 09:18:52 -07:00
|
|
|
|
2015-05-18 07:17:15 -07:00
|
|
|
local color_tab = {
|
|
|
|
{"black", "Black", "dye:black"},
|
|
|
|
{"blue", "Blue", "dye:blue"},
|
|
|
|
{"brown", "Brown", "dye:brown"},
|
|
|
|
{"cyan", "Cyan", "dye:cyan"},
|
|
|
|
{"dark_green", "Dark Green", "dye:dark_green"},
|
|
|
|
{"dark_grey", "Dark Grey", "dye:dark_grey"},
|
|
|
|
{"green", "Green", "dye:green"},
|
|
|
|
{"grey", "Grey", "dye:grey"},
|
|
|
|
{"magenta", "Magenta", "dye:magenta"},
|
|
|
|
{"orange", "Orange", "dye:orange"},
|
|
|
|
{"pink", "Pink", "dye:pink"},
|
|
|
|
{"red", "Red", "dye:red"},
|
|
|
|
{"violet", "Violet", "dye:violet"},
|
|
|
|
{"white", "White", "dye:white"},
|
|
|
|
{"yellow", "Yellow", "dye:yellow"},
|
|
|
|
{"cement", "", ""},
|
|
|
|
}
|
2015-05-14 09:18:52 -07:00
|
|
|
|
2015-04-26 14:38:21 -07:00
|
|
|
minetest.register_node('mylandscaping:machine', {
|
2015-05-04 13:37:29 -07:00
|
|
|
description = 'concrete forms',
|
2015-04-26 14:38:21 -07:00
|
|
|
drawtype = 'mesh',
|
2015-05-01 18:34:07 -07:00
|
|
|
mesh = 'mylandscaping_cement_mixer.obj',
|
2015-04-26 14:38:21 -07:00
|
|
|
tiles = {
|
|
|
|
{name='mylandscaping_tex3.png'},{name='mylandscaping_tex1.png'},{name='default_gravel.png'},{name='mylandscaping_tex2.png'}},
|
|
|
|
groups = {oddly_breakable_by_hand=2},
|
|
|
|
paramtype = 'light',
|
|
|
|
paramtype2 = 'facedir',
|
|
|
|
selection_box = {
|
|
|
|
type = 'fixed',
|
|
|
|
fixed = {
|
2015-05-03 18:09:16 -07:00
|
|
|
{-0.5, -0.5, -0.5, 1.1, 0.5, 0.5},
|
2015-04-26 14:38:21 -07:00
|
|
|
{1.1, -0.5, -0.1, 1.5, -0.3, 0.5}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
collision_box = {
|
|
|
|
type = 'fixed',
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 1.1, 0.5, 0.5},
|
|
|
|
{1.1, -0.5, -0.1, 1.5, -0.3, 0.5}
|
|
|
|
}
|
|
|
|
},
|
2015-04-27 16:18:04 -07:00
|
|
|
|
|
|
|
can_dig = function(pos,player)
|
2015-11-15 05:04:01 -08:00
|
|
|
local meta = minetest.get_meta(pos);
|
2015-04-27 16:18:04 -07:00
|
|
|
local inv = meta:get_inventory()
|
2015-05-18 07:17:15 -07:00
|
|
|
if player:get_player_name() == meta:get_string("owner") and
|
|
|
|
inv:is_empty("input") and
|
|
|
|
inv:is_empty("input") and
|
|
|
|
inv:is_empty("output") then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
2015-04-27 16:18:04 -07:00
|
|
|
end
|
2015-05-05 09:09:48 -07:00
|
|
|
|
|
|
|
|
2015-04-27 16:18:04 -07:00
|
|
|
end,
|
|
|
|
|
|
|
|
after_place_node = function(pos, placer, itemstack)
|
2015-11-15 05:04:01 -08:00
|
|
|
local meta = minetest.get_meta(pos)
|
2015-04-27 16:18:04 -07:00
|
|
|
meta:set_string("owner",placer:get_player_name())
|
|
|
|
meta:set_string("infotext","Concrete Mixer (owned by "..placer:get_player_name()..")")
|
|
|
|
end,
|
|
|
|
|
2015-04-27 10:31:29 -07:00
|
|
|
on_construct = function(pos)
|
2015-11-15 05:04:01 -08:00
|
|
|
local meta = minetest.get_meta(pos)
|
2015-09-14 17:41:00 -07:00
|
|
|
meta:set_string("formspec", retaining_walls)
|
2015-04-27 10:31:29 -07:00
|
|
|
meta:set_string("infotext", "Concrete Mixer")
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
inv:set_size("input", 1)
|
|
|
|
inv:set_size("output", 1)
|
2015-04-28 07:48:19 -07:00
|
|
|
inv:set_size("dye", 1)
|
2015-04-27 10:31:29 -07:00
|
|
|
end,
|
|
|
|
|
|
|
|
on_receive_fields = function(pos, formname, fields, sender)
|
2015-11-15 05:04:01 -08:00
|
|
|
local meta = minetest.get_meta(pos)
|
2015-04-27 10:31:29 -07:00
|
|
|
local inv = meta:get_inventory()
|
2015-09-13 16:04:26 -07:00
|
|
|
if fields['retain'] then
|
|
|
|
meta:set_string('formspec', retaining_walls)
|
|
|
|
end
|
|
|
|
if fields['patio'] then
|
|
|
|
meta:set_string('formspec', patio_pavers)
|
|
|
|
end
|
|
|
|
if fields['deco'] then
|
|
|
|
meta:set_string('formspec', deco_walls)
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
if fields['column'] then
|
|
|
|
meta:set_string('formspec', columns)
|
|
|
|
end
|
2015-04-27 10:31:29 -07:00
|
|
|
|
2015-05-14 09:18:52 -07:00
|
|
|
for i in ipairs (color_tab) do
|
|
|
|
local col = color_tab[i][1]
|
|
|
|
local coldesc = color_tab[i][2]
|
|
|
|
local dyecol = color_tab[i][3]
|
|
|
|
|
2015-09-16 15:50:08 -07:00
|
|
|
if fields["awall1"]
|
|
|
|
or fields["awall2"]
|
|
|
|
or fields["awall3"]
|
|
|
|
or fields["awall4"]
|
2015-09-22 07:15:37 -07:00
|
|
|
or fields["awall5"]
|
2015-09-16 15:50:08 -07:00
|
|
|
then
|
|
|
|
|
|
|
|
if fields["awall1"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
|
|
|
block = "mylandscaping:awall_left_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["awall2"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
|
|
|
block = "mylandscaping:awall_middle_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["awall3"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
|
|
|
block = "mylandscaping:awall_right_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["awall4"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
2015-09-22 07:15:37 -07:00
|
|
|
block = "mylandscaping:awall_icorner_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["awall5"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
|
|
|
block = "mylandscaping:awall_ocorner_"
|
2015-09-16 15:50:08 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
local instack = inv:get_stack("input", 1)
|
|
|
|
local outstack = inv:get_stack("output", 1)
|
|
|
|
local dyestack = inv:get_stack("dye", 1)
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
if instack:get_name()== "mylandscaping:concrete_bag" and
|
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
material = col
|
|
|
|
make_ok = true
|
|
|
|
end
|
|
|
|
if instack:get_name()== "myconcrete:concrete" and
|
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
material = col
|
|
|
|
make_ok = true
|
|
|
|
end
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
if make_ok == true then
|
|
|
|
local give = {}
|
|
|
|
for i = 0, anzahl-1 do
|
|
|
|
give[i+1]=inv:add_item("output",block..col)
|
|
|
|
end
|
|
|
|
instack:take_item()
|
|
|
|
inv:set_stack("input",1,instack)
|
|
|
|
if dyestack:get_name() == "dye:"..col then
|
|
|
|
dyestack:take_item()
|
|
|
|
inv:set_stack("dye",1,dyestack)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
--------------------------------------------------------------------------------
|
2015-09-14 17:41:00 -07:00
|
|
|
if fields["fwall1"]
|
|
|
|
or fields["fwall2"]
|
|
|
|
or fields["fwall3"]
|
|
|
|
or fields["fwall4"]
|
2015-04-27 10:31:29 -07:00
|
|
|
then
|
|
|
|
|
2015-09-14 17:41:00 -07:00
|
|
|
if fields["fwall1"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_left_"
|
2015-04-27 10:31:29 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-14 17:41:00 -07:00
|
|
|
if fields["fwall2"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_middle_"
|
2015-04-27 10:31:29 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-14 17:41:00 -07:00
|
|
|
if fields["fwall3"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_right_"
|
2015-04-27 10:31:29 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-14 17:41:00 -07:00
|
|
|
if fields["fwall4"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 2
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_corner_"
|
2015-04-27 10:31:29 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
local instack = inv:get_stack("input", 1)
|
|
|
|
local outstack = inv:get_stack("output", 1)
|
|
|
|
local dyestack = inv:get_stack("dye", 1)
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
if instack:get_name()== "mylandscaping:concrete_bag" and
|
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
material = col
|
|
|
|
make_ok = true
|
|
|
|
end
|
|
|
|
if instack:get_name()== "myconcrete:concrete" and
|
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
material = col
|
|
|
|
make_ok = true
|
|
|
|
end
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
if make_ok == true then
|
|
|
|
local give = {}
|
|
|
|
for i = 0, anzahl-1 do
|
|
|
|
give[i+1]=inv:add_item("output",block..col)
|
|
|
|
end
|
|
|
|
instack:take_item()
|
|
|
|
inv:set_stack("input",1,instack)
|
|
|
|
if dyestack:get_name() == "dye:"..col then
|
|
|
|
dyestack:take_item()
|
|
|
|
inv:set_stack("dye",1,dyestack)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
--all columns here, possible decorative caps too.
|
|
|
|
if fields['acolumn1']
|
|
|
|
or fields['acolumn2']
|
|
|
|
or fields['acolumn3']
|
|
|
|
or fields['fcolumn1']
|
|
|
|
or fields['fcolumn2']
|
|
|
|
or fields['fcolumn3']
|
|
|
|
or fields['mcolumn1']
|
|
|
|
or fields['mcolumn2']
|
|
|
|
or fields['mcolumn3']
|
2015-09-28 18:44:01 -07:00
|
|
|
or fields['column_sphere']
|
|
|
|
or fields['column_dragon']
|
|
|
|
or fields['column_suzanne']
|
2015-09-27 13:35:44 -07:00
|
|
|
then
|
|
|
|
if fields["acolumn1"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 1
|
|
|
|
block = "mylandscaping:awall_column_m_t_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["acolumn2"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 1
|
|
|
|
block = "mylandscaping:awall_column_ic_t_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["acolumn3"] then
|
|
|
|
make_ok = false
|
|
|
|
anzahl = 1
|
|
|
|
block = "mylandscaping:awall_column_oc_t_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["fcolumn1"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 1
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_column_m_t_"
|
2015-04-27 10:31:29 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
if fields["fcolumn2"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 1
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_column_ic_t_"
|
2015-04-28 13:02:17 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
if fields["fcolumn3"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
|
|
|
anzahl = 1
|
2015-09-14 17:41:00 -07:00
|
|
|
block = "mylandscaping:fwall_column_oc_t_"
|
2015-05-01 06:15:34 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-28 18:44:01 -07:00
|
|
|
if fields["column_sphere"] then
|
|
|
|
make_ok = false
|
2015-10-01 09:40:51 -07:00
|
|
|
anzahl = 2
|
|
|
|
block = "mylandscaping:column_t_sphere_"
|
2015-09-28 18:44:01 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["column_dragon"] then
|
|
|
|
make_ok = false
|
2015-10-01 09:40:51 -07:00
|
|
|
anzahl = 1
|
|
|
|
block = "mylandscaping:column_t_dragon_"
|
2015-09-28 18:44:01 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["column_suzanne"] then
|
|
|
|
make_ok = false
|
2015-10-01 09:40:51 -07:00
|
|
|
anzahl = 2
|
|
|
|
block = "mylandscaping:column_t_suzanne_"
|
2015-09-28 18:44:01 -07:00
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-04-28 07:48:19 -07:00
|
|
|
local instack = inv:get_stack("input", 1)
|
2015-04-27 10:31:29 -07:00
|
|
|
local outstack = inv:get_stack("output", 1)
|
2015-04-28 07:48:19 -07:00
|
|
|
local dyestack = inv:get_stack("dye", 1)
|
2015-04-27 10:31:29 -07:00
|
|
|
----------------------------------------------------------------------
|
2015-05-14 09:18:52 -07:00
|
|
|
|
2015-05-04 19:26:47 -07:00
|
|
|
if instack:get_name()== "mylandscaping:concrete_bag" and
|
2015-05-14 09:18:52 -07:00
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
material = col
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = true
|
2015-04-28 07:48:19 -07:00
|
|
|
end
|
2015-05-18 07:17:15 -07:00
|
|
|
if instack:get_name()== "myconcrete:concrete" and
|
2015-05-14 09:18:52 -07:00
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
material = col
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = true
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
2015-05-18 07:17:15 -07:00
|
|
|
if make_ok == true then
|
2015-04-27 10:31:29 -07:00
|
|
|
local give = {}
|
|
|
|
for i = 0, anzahl-1 do
|
2015-05-14 09:18:52 -07:00
|
|
|
give[i+1]=inv:add_item("output",block..col)
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
2015-04-28 07:48:19 -07:00
|
|
|
instack:take_item()
|
|
|
|
inv:set_stack("input",1,instack)
|
2015-05-14 09:18:52 -07:00
|
|
|
if dyestack:get_name() == "dye:"..col then
|
2015-04-28 07:48:19 -07:00
|
|
|
dyestack:take_item()
|
|
|
|
inv:set_stack("dye",1,dyestack)
|
|
|
|
end
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
|
2015-04-27 10:31:29 -07:00
|
|
|
if fields["patio1"]
|
|
|
|
or fields["patio2"]
|
|
|
|
or fields["patio3"]
|
2015-05-14 09:18:52 -07:00
|
|
|
or fields["patio4"]
|
|
|
|
or fields["patio5"]
|
|
|
|
or fields["patio6"]
|
|
|
|
or fields["patio7"]
|
2015-04-27 10:31:29 -07:00
|
|
|
then
|
|
|
|
|
|
|
|
if fields["patio1"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-04-27 10:31:29 -07:00
|
|
|
stone = "mylandscaping:stone_square"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["patio2"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-04-27 10:31:29 -07:00
|
|
|
stone = "mylandscaping:stone_square_sm"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-05-14 09:18:52 -07:00
|
|
|
if fields["patio7"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-05-14 09:18:52 -07:00
|
|
|
stone = "mylandscaping:stone_square_xsm"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-04-27 10:31:29 -07:00
|
|
|
if fields["patio3"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-04-27 10:31:29 -07:00
|
|
|
stone = "mylandscaping:stone_pavers"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
2015-05-14 09:18:52 -07:00
|
|
|
end
|
|
|
|
if fields["patio4"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-05-14 09:18:52 -07:00
|
|
|
stone = "mylandscaping:stone_ashlar"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["patio5"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-05-14 09:18:52 -07:00
|
|
|
stone = "mylandscaping:stone_flagstone"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["patio6"] then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 3
|
2015-05-14 09:18:52 -07:00
|
|
|
stone = "mylandscaping:stone_pinwheel"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
2015-04-28 07:48:19 -07:00
|
|
|
local instack = inv:get_stack("input", 1)
|
2015-04-27 10:31:29 -07:00
|
|
|
local outstack = inv:get_stack("output", 1)
|
2015-05-14 09:18:52 -07:00
|
|
|
local dyestack = inv:get_stack("dye", 1)
|
|
|
|
|
|
|
|
if instack:get_name()== "mylandscaping:concrete_bag" and
|
|
|
|
dyestack:get_name()== dyecol then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = true
|
2015-05-14 09:18:52 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
if instack:get_name()== "myconcrete:concrete" and
|
|
|
|
dyestack:get_name()== dyecol then
|
2015-05-18 07:17:15 -07:00
|
|
|
make_ok = true
|
2015-04-27 10:31:29 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
----------------------------------------------------------------------
|
2015-05-18 07:17:15 -07:00
|
|
|
if make_ok == true then
|
2015-04-27 10:31:29 -07:00
|
|
|
local give = {}
|
2015-05-18 07:17:15 -07:00
|
|
|
for i = 0, anzahl-1 do
|
2015-05-14 09:18:52 -07:00
|
|
|
give[i+1]=inv:add_item("output",stone..col)
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
2015-05-14 09:18:52 -07:00
|
|
|
dyestack:take_item()
|
|
|
|
inv:set_stack("dye",1,dyestack)
|
2015-04-28 07:48:19 -07:00
|
|
|
instack:take_item()
|
|
|
|
inv:set_stack("input",1,instack)
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
|
|
|
end
|
2015-09-27 13:35:44 -07:00
|
|
|
--------------------------------------------------------------------------------
|
2015-09-13 16:04:26 -07:00
|
|
|
if fields["deco1"]
|
|
|
|
or fields["deco2"]
|
|
|
|
or fields["deco3"]
|
|
|
|
or fields['deco4']
|
|
|
|
or fields['deco5']
|
|
|
|
then
|
|
|
|
|
|
|
|
if fields["deco1"] then
|
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 4
|
2015-09-13 16:04:26 -07:00
|
|
|
deco = "mylandscaping:deco_wall_r_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["deco2"] then
|
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 4
|
2015-09-13 16:04:26 -07:00
|
|
|
deco = "mylandscaping:deco_wall_f_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["deco3"] then
|
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 4
|
2015-09-13 16:04:26 -07:00
|
|
|
deco = "mylandscaping:deco_wall_p_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["deco4"] then
|
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 4
|
2015-09-13 16:04:26 -07:00
|
|
|
deco = "mylandscaping:deco_wall_ra_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if fields["deco5"] then
|
|
|
|
make_ok = false
|
2015-09-16 15:50:08 -07:00
|
|
|
anzahl = 4
|
2015-09-13 16:04:26 -07:00
|
|
|
deco = "mylandscaping:deco_column_"
|
|
|
|
if inv:is_empty("input") then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-09-28 18:44:01 -07:00
|
|
|
|
2015-09-13 16:04:26 -07:00
|
|
|
local instack = inv:get_stack("input", 1)
|
|
|
|
local outstack = inv:get_stack("output", 1)
|
|
|
|
local dyestack = inv:get_stack("dye", 1)
|
|
|
|
|
|
|
|
if instack:get_name()== "mylandscaping:concrete_bag" and
|
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
make_ok = true
|
|
|
|
|
|
|
|
end
|
|
|
|
if instack:get_name()== "myconcrete:concrete" and
|
|
|
|
dyestack:get_name()== dyecol then
|
|
|
|
make_ok = true
|
|
|
|
end
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
if make_ok == true then
|
|
|
|
local give = {}
|
|
|
|
for i = 0, anzahl-1 do
|
|
|
|
give[i+1]=inv:add_item("output",deco..col)
|
|
|
|
end
|
|
|
|
dyestack:take_item()
|
|
|
|
inv:set_stack("dye",1,dyestack)
|
|
|
|
instack:take_item()
|
|
|
|
inv:set_stack("input",1,instack)
|
|
|
|
end
|
|
|
|
end
|
2015-04-27 10:31:29 -07:00
|
|
|
end
|
2015-05-14 09:18:52 -07:00
|
|
|
end
|
2015-04-26 14:38:21 -07:00
|
|
|
})
|