Added dye support

Added a new patio stone
Changed patio stones to nodeboxes
master
DonBatman 2015-05-14 09:18:52 -07:00
parent 006bcfdceb
commit 35ccf3dd1e
22 changed files with 400 additions and 514 deletions

View File

@ -2,17 +2,7 @@
dofile(minetest.get_modpath('mylandscaping')..'/walls.lua')
dofile(minetest.get_modpath('mylandscaping')..'/stones.lua')
dofile(minetest.get_modpath('mylandscaping')..'/recipes.lua')
dofile(minetest.get_modpath("mylandscaping").."/machine.lua")
dofile(minetest.get_modpath("mylandscaping").."/mixer.lua")
dofile(minetest.get_modpath('mylandscaping')..'/concrete.lua')
local mod_myconcrete = minetest.get_modpath("myconcrete")
if mod_myconcrete then
dofile(minetest.get_modpath("mylandscaping").."/myconcrete_machine.lua")
dofile(minetest.get_modpath("mylandscaping").."/myconcrete_mixer.lua")
else
dofile(minetest.get_modpath("mylandscaping").."/machine.lua")
dofile(minetest.get_modpath("mylandscaping").."/mixer.lua")
dofile(minetest.get_modpath('mylandscaping')..'/concrete.lua')
end

View File

@ -7,6 +7,8 @@ local stone = {}
local make_ok2 = {}
local anzahl2 = {}
minetest.register_node('mylandscaping:machine', {
description = 'concrete forms',
drawtype = 'mesh',
@ -55,7 +57,7 @@ after_place_node = function(pos, placer, itemstack)
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", "invsize[10,10;]"..
meta:set_string("formspec", "size[10,10;]"..
"background[-0.15,-0.25;10.40,10.75;mylandscaping_background.png]"..
"label[1.5,0.5;Retaining Wall]"..
--Styles of blocks
@ -73,9 +75,13 @@ on_construct = function(pos)
"label[6.5,0.5;Patio Stones]"..
--Styles of blocks
"item_image_button[6,1.5;1,1;mylandscaping:stone_square;patio1; ]"..
"item_image_button[7,1.5;1,1;mylandscaping:stone_square_sm;patio2; ]"..
"item_image_button[8,1.5;1,1;mylandscaping:stone_pavers;patio3; ]"..
"item_image_button[5.5,1.5;1,1;mylandscaping:stone_squarecement;patio1; ]"..
"item_image_button[6.5,1.5;1,1;mylandscaping:stone_square_smcement;patio2; ]"..
"item_image_button[7.5,1.5;1,1;mylandscaping:stone_square_xsmcement;patio7; ]"..
"item_image_button[8.5,1.5;1,1;mylandscaping:stone_paverscement;patio3; ]"..
"item_image_button[6,2.5;1,1;mylandscaping:stone_ashlarcement;patio4; ]"..
"item_image_button[7,2.5;1,1;mylandscaping:stone_flagstonecement;patio5; ]"..
"item_image_button[8,2.5;1,1;mylandscaping:stone_pinwheelcement;patio6; ]"..
--Input
"label[3,4; Input]"..
@ -98,6 +104,29 @@ on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
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", "", ""},
}
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]
if fields["wall1"]
or fields["wall2"]
or fields["wall3"]
@ -168,36 +197,26 @@ then
local outstack = inv:get_stack("output", 1)
local dyestack = inv:get_stack("dye", 1)
----------------------------------------------------------------------
if instack:get_name()== "mylandscaping:concrete_bag" then
material = "cement"
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== dyecol then
material = col
make_ok = "1"
end
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== "dye:yellow" then
material = "cement_tan"
make_ok = "1"
end
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== "dye:orange" then
material = "cement_autumn"
make_ok = "1"
end
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== "dye:red" then
material = "cement_red"
if instack:get_name()== "myconcrete:concrete" and
dyestack:get_name()== dyecol then
material = col
make_ok = "1"
end
----------------------------------------------------------------------
if make_ok == "1" then
local give = {}
for i = 0, anzahl-1 do
give[i+1]=inv:add_item("output",block..material)
give[i+1]=inv:add_item("output",block..col)
end
instack:take_item()
inv:set_stack("input",1,instack)
if dyestack:get_name() == "dye:yellow" or
dyestack:get_name() == "dye:orange" or
dyestack:get_name() == "dye:red" then
if dyestack:get_name() == "dye:"..col then
dyestack:take_item()
inv:set_stack("dye",1,dyestack)
end
@ -207,6 +226,10 @@ end
if fields["patio1"]
or fields["patio2"]
or fields["patio3"]
or fields["patio4"]
or fields["patio5"]
or fields["patio6"]
or fields["patio7"]
then
if fields["patio1"] then
@ -225,6 +248,14 @@ then
return
end
end
if fields["patio7"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_square_xsm"
if inv:is_empty("input") then
return
end
end
if fields["patio3"] then
make_ok2 = "0"
anzahl2 = "2"
@ -232,11 +263,44 @@ then
if inv:is_empty("input") then
return
end
end
if fields["patio4"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_ashlar"
if inv:is_empty("input") then
return
end
end
if fields["patio5"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_flagstone"
if inv:is_empty("input") then
return
end
end
if fields["patio6"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_pinwheel"
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" then
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== dyecol then
make_ok2 = "1"
end
if instack:get_name()== "myconcrete:concrete" and
dyestack:get_name()== dyecol then
make_ok2 = "1"
end
@ -244,13 +308,16 @@ then
if make_ok2 == "1" then
local give = {}
for i = 0, anzahl2-1 do
give[i+1]=inv:add_item("output",stone)
give[i+1]=inv:add_item("output",stone..col)
end
dyestack:take_item()
inv:set_stack("dye",1,dyestack)
instack:take_item()
inv:set_stack("input",1,instack)
end
end
end
end
})

View File

@ -1,257 +0,0 @@
minetest.register_alias("myconcrete:concrete", "mylandscaping:concrete")
local material = {}
local block = {}
local make_ok = {}
local anzahl = {}
local material2 = {}
local stone = {}
local make_ok2 = {}
local anzahl2 = {}
minetest.register_node('mylandscaping:machine', {
description = 'concrete forms',
drawtype = 'mesh',
mesh = 'mylandscaping_cement_mixer.obj',
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 = {
{-0.5, -0.5, -0.5, 1.1, 0.5, 0.5},
{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}
}
},
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if player:get_player_name() ~= meta:get_string("owner") then
return false
elseif not inv:is_empty("input") then
return false
elseif not inv:is_empty("output") then
return false
end
return true
end,
after_place_node = function(pos, placer, itemstack)
local meta = minetest.env:get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Concrete Mixer (owned by "..placer:get_player_name()..")")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", "invsize[10,10;]"..
"background[-0.15,-0.25;10.40,10.75;mylandscaping_background.png]"..
"label[1.5,0.5;Retaining Wall]"..
--Styles of blocks
"label[1,1;Wall Blocks]"..
"item_image_button[1,1.5;1,1;mylandscaping:rwall_left_cement;wall1; ]"..
"item_image_button[2,1.5;1,1;mylandscaping:rwall_middle_cement;wall2; ]"..
"item_image_button[3,1.5;1,1;mylandscaping:rwall_right_cement;wall3; ]"..
"item_image_button[4,1.5;1,1;mylandscaping:rwall_corner_cement;wall4; ]"..
--Styles of columns
"label[1,2.5;Columns]"..
"item_image_button[1,3;1,1;mylandscaping:rwall_column_m_t_cement;column2; ]"..
"item_image_button[2,3;1,1;mylandscaping:rwall_column_ic_t_cement;column3; ]"..
"item_image_button[3,3;1,1;mylandscaping:rwall_column_oc_t_cement;column4; ]"..
"label[6.5,0.5;Patio Stones]"..
--Styles of blocks
"item_image_button[6,1.5;1,1;mylandscaping:stone_square;patio1; ]"..
"item_image_button[7,1.5;1,1;mylandscaping:stone_square_sm;patio2; ]"..
"item_image_button[8,1.5;1,1;mylandscaping:stone_pavers;patio3; ]"..
--Input
"label[3,4; Input]"..
"list[current_name;input;3,4.5;1,1;]"..
"label[4,4; Dye]"..
"list[current_name;dye;4,4.5;1,1;]"..
--Output
"label[6,4;Output]"..
"list[current_name;output;6,4.5;1,1;]"..
--Players Inven
"list[current_player;main;1,6;8,4;]")
meta:set_string("infotext", "Concrete Mixer")
local inv = meta:get_inventory()
inv:set_size("input", 1)
inv:set_size("output", 1)
inv:set_size("dye", 1)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
if fields["wall1"]
or fields["wall2"]
or fields["wall3"]
or fields["wall4"]
or fields["column"]
or fields["column2"]
or fields["column3"]
or fields["column4"]
then
if fields["wall1"] then
make_ok = "0"
anzahl = "2"
block = "mylandscaping:rwall_left_"
if inv:is_empty("input") then
return
end
end
if fields["wall2"] then
make_ok = "0"
anzahl = "2"
block = "mylandscaping:rwall_middle_"
if inv:is_empty("input") then
return
end
end
if fields["wall3"] then
make_ok = "0"
anzahl = "2"
block = "mylandscaping:rwall_right_"
if inv:is_empty("input") then
return
end
end
if fields["wall4"] then
make_ok = "0"
anzahl = "2"
block = "mylandscaping:rwall_corner_"
if inv:is_empty("input") then
return
end
end
if fields["column2"] then
make_ok = "0"
anzahl = "1"
block = "mylandscaping:rwall_column_m_t_"
if inv:is_empty("input") then
return
end
end
if fields["column3"] then
make_ok = "0"
anzahl = "1"
block = "mylandscaping:rwall_column_ic_t_"
if inv:is_empty("input") then
return
end
end
if fields["column4"] then
make_ok = "0"
anzahl = "1"
block = "mylandscaping:rwall_column_oc_t_"
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" then
material = "cement"
make_ok = "1"
end
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== "dye:yellow" then
material = "cement_tan"
make_ok = "1"
end
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== "dye:orange" then
material = "cement_autumn"
make_ok = "1"
end
if instack:get_name()== "mylandscaping:concrete_bag" and
dyestack:get_name()== "dye:red" then
material = "cement_red"
make_ok = "1"
end
----------------------------------------------------------------------
if make_ok == "1" then
local give = {}
for i = 0, anzahl-1 do
give[i+1]=inv:add_item("output",block..material)
end
instack:take_item()
inv:set_stack("input",1,instack)
if dyestack:get_name() == "dye:yellow" or
dyestack:get_name() == "dye:orange" or
dyestack:get_name() == "dye:red" then
dyestack:take_item()
inv:set_stack("dye",1,dyestack)
end
end
end
--------------------------------------------------------------------------------------
if fields["patio1"]
or fields["patio2"]
or fields["patio3"]
then
if fields["patio1"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_square"
if inv:is_empty("input") then
return
end
end
if fields["patio2"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_square_sm"
if inv:is_empty("input") then
return
end
end
if fields["patio3"] then
make_ok2 = "0"
anzahl2 = "2"
stone = "mylandscaping:stone_pavers"
if inv:is_empty("input") then
return
end
end
local instack = inv:get_stack("input", 1)
local outstack = inv:get_stack("output", 1)
----------------------------------------------------------------------
if instack:get_name()== "myconcrete:concrete" then
make_ok2 = "1"
end
----------------------------------------------------------------------
if make_ok2 == "1" then
local give = {}
for i = 0, anzahl2-1 do
give[i+1]=inv:add_item("output",stone)
end
instack:take_item()
inv:set_stack("input",1,instack)
end
end
end
})

View File

@ -1,167 +0,0 @@
minetest.register_alias("mylandscaping:concrete", "myconcrete:concrete")
local make_gravel = {}
local output_gravel = {}
local make_concrete = {}
local output_concrete = {}
local make_cement = {}
local output_cement = {}
local amount = {}
local amount2 = {}
local amount3 = {}
minetest.register_node('mylandscaping:mixer', {
description = 'concrete mixer',
drawtype = 'mesh',
mesh = 'mylandscaping_crusher.obj',
tiles = {
{name='mylandscaping_tex1.png'},{name='mylandscaping_supports.png'},{name='mylandscaping_base.png'},{name='mylandscaping_hopper.png'},{name='mylandscaping_crusher.png'}},
groups = {oddly_breakable_by_hand=2},
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 1.5, 1.5, 0.5},
}
},
collision_box = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 1.5, 1.5, 0.5},
}
},
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if player:get_player_name() ~= meta:get_string("owner") then
return false
elseif not inv:is_empty("cobble") then
return false
elseif not inv:is_empty("gravel") then
return false
elseif not inv:is_empty("concrete") then
return false
elseif not inv:is_empty("sand") then
return false
end
return true
end,
after_place_node = function(pos, placer, itemstack)
local meta = minetest.env:get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Cement Mixer (owned by "..placer:get_player_name()..")")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", "invsize[9,10;]"..
"background[-0.15,-0.25;9.40,10.75;mylandscaping_background.png]"..
--Gravel
"label[0.5,1;Cobble]"..
"label[0.5,1.5;Crusher]"..
"label[2.5,2;Cobble]"..
"list[current_name;cobble;2.5,1;1,1;]"..
"button[4,1;1,1;crush;Crush]"..
"list[current_name;gravel;5.5,1;1,1;]"..
"label[6.5,1;Gravel]"..
--Concrete
"label[5,0.5;Concrete Mixer]"..
"list[current_name;sand;5.5,2.5;1,1;]"..
"label[6.5,2.5;Sand]"..
"button[5.5,3.5;1,1;mix;Mix]"..
"list[current_name;concrete;5.5,4.5;1,1;]"..
"label[6.5,4.5;Output]"..
--Players Inven
"list[current_player;main;0.5,6;8,4;]")
meta:set_string("infotext", "Concrete Mixer")
local inv = meta:get_inventory()
inv:set_size("cobble", 1)
inv:set_size("gravel", 1)
inv:set_size("cement", 1)
inv:set_size("concrete", 1)
inv:set_size("clay", 1)
inv:set_size("sand", 1)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
if fields["crush"]
then
if fields["crush"] then
grave = "0"
amount = "1"
if inv:is_empty("cobble") then
return
end
end
local cobblestack = inv:get_stack("cobble", 1)
local gravelstack = inv:get_stack("gravel", 1)
----------------------------------------------------------------------
if cobblestack:get_name()== "default:cobble" then
output_gravel = "default:gravel"
make_gravel = "1"
end
----------------------------------------------------------------------
if make_gravel == "1" then
local give = {}
for i = 0, amount-1 do
give[i+1]=inv:add_item("gravel",output_gravel)
end
cobblestack:take_item()
inv:set_stack("cobble",1,cobblestack)
end
end
--------------------------------------------------------------------------------------
if fields["mix"]
then
if fields["mix"] then
make_concrete = "0"
amount2 = "2"
if inv:is_empty("gravel") or
inv:is_empty("sand") then
return
end
end
local gravelstack = inv:get_stack("gravel", 1)
local sandstack = inv:get_stack("sand", 1)
local concretestack = inv:get_stack("concrete", 1)
----------------------------------------------------------------------
if gravelstack:get_name()== "default:gravel" and
sandstack:get_name()== "default:sand" then
make_concrete = "1"
output_concrete = "mylandscaping:concrete_bag"
end
if gravelstack:get_name()== "default:gravel" and
sandstack:get_name()== "default:desert_sand" then
make_concrete = "1"
output_concrete = "mylandscaping:concrete_bag"
end
----------------------------------------------------------------------
if make_concrete == "1" then
local give = {}
for i = 0, amount2-1 do
give[i+1]=inv:add_item("concrete",output_concrete)
end
gravelstack:take_item()
inv:set_stack("gravel",1,gravelstack)
sandstack:take_item()
inv:set_stack("sand",1,sandstack)
end
end
end
})

View File

@ -1,67 +1,306 @@
local stone_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local sstone_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local sq_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, 0.4375, -0.3125, 0.4375},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local s_sq_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, 0.4375, 0.5, 0.4375},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local smsq_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, -0.0625, -0.3125, -0.0625},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
{-0.4375, -0.5, 0.0625, -0.0625, -0.3125, 0.4375},
{0.0625, -0.5, -0.4375, 0.4375, -0.3125, -0.0625},
{0.0625, -0.5, 0.0625, 0.4375, -0.3125, 0.4375},
}
}
local s_smsq_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, -0.0625, 0.5, -0.0625},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
{-0.4375, -0.5, 0.0625, -0.0625, 0.5, 0.4375},
{0.0625, -0.5, -0.4375, 0.4375, 0.5, -0.0625},
{0.0625, -0.5, 0.0625, 0.4375, 0.5, 0.4375},
}
}
local xsmsq_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, -0.1875, -0.3125, -0.1875},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
{-0.4375, -0.5, 0.1875, -0.1875, -0.3125, 0.4375},
{0.1875, -0.5, -0.4375, 0.4375, -0.3125, -0.1875},
{0.1875, -0.5, 0.1875, 0.4375, -0.3125, 0.4375},
{-0.4375, -0.5, -0.125, -0.1875, -0.3125, 0.125},
{-0.125, -0.5, 0.1875, 0.125, -0.3125, 0.4375},
{-0.125, -0.5, -0.125, 0.125, -0.3125, 0.125},
{0.1875, -0.5, -0.125, 0.4375, -0.3125, 0.125},
{-0.125, -0.5, -0.4375, 0.125, -0.3125, -0.1875},
}
}
local s_xsmsq_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, -0.1875, 0.5, -0.1875},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
{-0.4375, -0.5, 0.1875, -0.1875, 0.5, 0.4375},
{0.1875, -0.5, -0.4375, 0.4375, 0.5, -0.1875},
{0.1875, -0.5, 0.1875, 0.4375, 0.5, 0.4375},
{-0.4375, -0.5, -0.125, -0.1875, 0.5, 0.125},
{-0.125, -0.5, 0.1875, 0.125, 0.5, 0.4375},
{-0.125, -0.5, -0.125, 0.125, 0.5, 0.125},
{0.1875, -0.5, -0.125, 0.4375, 0.5, 0.125},
{-0.125, -0.5, -0.4375, 0.125, 0.5, -0.1875},
}
}
local paver_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.3125, -0.3125, -0.3125, 0.5},
{-0.25, -0.5, 0.3125, -0.0625, -0.3125, 0.5},
{-0.5, -0.5, 0.0625, -0.0625, -0.3125, 0.25},
{0, -0.5, 0.0625, 0.1875, -0.3125, 0.5},
{-0.5, -0.5, -0.4375, -0.3125, -0.3125, 0},
{-0.25, -0.5, -0.1875, 0.1875, -0.3125, 0},
{0.25, -0.5, 0.3125, 0.5, -0.3125, 0.5},
{0.25, -0.5, -0.1875, 0.4375, -0.3125, 0.25},
{-0.25, -0.5, -0.5, -0.0625, -0.3125, -0.25},
{0, -0.5, -0.4375, 0.4375, -0.3125, -0.25},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local spaver_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
{-0.25, -0.5, 0.3125, -0.0625, 0.5, 0.5},
{-0.5, -0.5, 0.0625, -0.0625, 0.5, 0.25},
{0, -0.5, 0.0625, 0.1875, 0.5, 0.5},
{-0.5, -0.5, -0.4375, -0.3125, 0.5, 0},
{-0.25, -0.5, -0.1875, 0.1875, 0.5, 0},
{0.25, -0.5, 0.3125, 0.5, 0.5, 0.5},
{0.25, -0.5, -0.1875, 0.4375, 0.5, 0.25},
{-0.25, -0.5, -0.5, -0.0625, 0.5, -0.25},
{0, -0.5, -0.4375, 0.4375, 0.5, -0.25},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local ashlar_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.375, -0.375, -0.3125, 0.5},
{-0.5, -0.5, 0.1875, -0.375, -0.3125, 0.3125},
{-0.3125, -0.5, 0.1875, -0.0625, -0.3125, 0.5},
{0, -0.5, 0.375, 0.25, -0.3125, 0.5},
{0.3125, -0.5, 0.375, 0.5, -0.3125, 0.5},
{-0.5, -0.5, -0.1875, -0.1875, -0.3125, 0.125},
{-0.5, -0.5, -0.5, -0.375, -0.3125, -0.25},
{-0.3125, -0.5, -0.375, -0.1875, -0.3125, -0.25},
{-0.125, -0.5, -0.0625, -0.0625, -0.3125, 0.125},
{-0.125, -0.5, -0.375, 0.0625, -0.3125, -0.125},
{0, -0.5, -0.0625, 0.0625, -0.3125, 0},
{0, -0.5, 0.0625, 0.3125, -0.3125, 0.3125},
{0.375, -0.5, 0.1875, 0.5, -0.3125, 0.3125},
{0.375, -0.5, -0.1875, 0.5, -0.3125, 0.125},
{0.125, -0.5, -0.1875, 0.3125, -0.3125, 0},
{0.125, -0.5, -0.375, 0.25, -0.3125, -0.25},
{-0.3125, -0.5, -0.5, -0.0625, -0.3125, -0.4375},
{0, -0.5, -0.5, 0.25, -0.3125, -0.4375},
{0.3125, -0.5, -0.5, 0.5, -0.3125, -0.25},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local sashlar_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.375, -0.375, 0.5, 0.5},
{-0.5, -0.5, 0.1875, -0.375, 0.5, 0.3125},
{-0.3125, -0.5, 0.1875, -0.0625, 0.5, 0.5},
{0, -0.5, 0.375, 0.25, 0.5, 0.5},
{0.3125, -0.5, 0.375, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.1875, -0.1875, 0.5, 0.125},
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.25},
{-0.3125, -0.5, -0.375, -0.1875, 0.5, -0.25},
{-0.125, -0.5, -0.0625, -0.0625, 0.5, 0.125},
{-0.125, -0.5, -0.375, 0.0625, 0.5, -0.125},
{0, -0.5, -0.0625, 0.0625, 0.5, 0},
{0, -0.5, 0.0625, 0.3125, 0.5, 0.3125},
{0.375, -0.5, 0.1875, 0.5, 0.5, 0.3125},
{0.375, -0.5, -0.1875, 0.5, 0.5, 0.125},
{0.125, -0.5, -0.1875, 0.3125, 0.5, 0},
{0.125, -0.5, -0.375, 0.25, 0.5, -0.25},
{-0.3125, -0.5, -0.5, -0.0625, 0.5, -0.4375},
{0, -0.5, -0.5, 0.25, 0.5, -0.4375},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.25},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local flag_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.0625, -0.0625, -0.3125, 0.5},
{-0.5, -0.5, -0.1875, -0.25, -0.3125, 0},
{-0.5, -0.5, -0.4375, -0.25, -0.3125, -0.25},
{0, -0.5, 0.3125, 0.4375, -0.3125, 0.5},
{0, -0.5, 0.0625, 0.1875, -0.3125, 0.25},
{-0.1875, -0.5, -0.4375, 0.1875, -0.3125, 0},
{0.25, -0.5, -0.1875, 0.4375, -0.3125, 0.25},
{0.25, -0.5, -0.4375, 0.5, -0.3125, -0.25},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local sflag_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.0625, -0.0625, 0.5, 0.5},
{-0.5, -0.5, -0.1875, -0.25, 0.5, 0},
{-0.5, -0.5, -0.4375, -0.25, 0.5, -0.25},
{0, -0.5, 0.3125, 0.4375, 0.5, 0.5},
{0, -0.5, 0.0625, 0.1875, 0.5, 0.25},
{-0.1875, -0.5, -0.4375, 0.1875, 0.5, 0},
{0.25, -0.5, -0.1875, 0.4375, 0.5, 0.25},
{0.25, -0.5, -0.4375, 0.5, 0.5, -0.25},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local pin_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.125, -0.25, -0.3125, 0.5},
{-0.5, -0.5, -0.4375, 0.125, -0.3125, -0.1875},
{0.1875, -0.5, -0.4375, 0.4375, -0.3125, 0.1875},
{-0.1875, -0.5, 0.25, 0.4375, -0.3125, 0.5},
{-0.1875, -0.5, -0.125, 0.125, -0.3125, 0.1875},
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local spin_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.125, -0.25, 0.5, 0.5},
{-0.5, -0.5, -0.4375, 0.125, 0.5, -0.1875},
{0.1875, -0.5, -0.4375, 0.4375, 0.5, 0.1875},
{-0.1875, -0.5, 0.25, 0.4375, 0.5, 0.5},
{-0.1875, -0.5, -0.125, 0.125, 0.5, 0.1875},
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local stone_types = { --style, desc, img1, img2
{"square", "Square", "concrete", "square"},
{"square_sm", "Small Square", "concrete", "square_sm"},
{"pavers", "Paver", "concrete", "pavers"},
{"mess", "Messy Paver", "concrete", "mess"},
{"pin", "Pinwheel", "concrete", "pin"},
{"diamond", "Diamond Corner", "concrete", "diamond"},
{"square", "Square", "concrete", "square",sq_cbox,s_sq_cbox},
{"square_sm", "Small Square", "concrete", "square_sm",smsq_cbox,s_smsq_cbox},
{"square_xsm", "Extra Small Square", "concrete", "square_xsm",xsmsq_cbox,s_xsmsq_cbox},
{"pavers", "Paver", "concrete", "pavers",paver_cbox,spaver_cbox},
{"ashlar", "Ashlar", "concrete", "ashlar",ashlar_cbox,sashlar_cbox},
{"flagstone", "Flagstone", "concrete", "flagstone",flag_cbox,sflag_cbox},
{"pinwheel", "Pinwheel", "concrete", "pinwheel",pin_cbox,spin_cbox},
}
for i in ipairs (stone_types) do
local style = stone_types[i][1]
local desc = stone_types[i][2]
local img1 = stone_types[i][3]
local img2 = stone_types[i][4]
local cbox = stone_types[i][5]
local scbox = stone_types[i][6]
minetest.register_node("mylandscaping:stone_"..style,{
description = desc.." Patio Stone",
local color_tab = {
{"black", "Black", "^[colorize:black:150"},
{"blue", "Blue", "^[colorize:#0404B4:100"},
{"brown", "Brown", "^[colorize:#190B07:100"},
{"cyan", "Cyan", "^[colorize:cyan:100"},
{"dark_green", "Dark Green", "^[colorize:#071907:150"},
{"dark_grey", "Dark Grey", "^[colorize:black:150"},
{"green", "Green", "^[colorize:green:100"},
{"grey", "Grey", "^[colorize:black:100"},
{"magenta", "Magenta", "^[colorize:magenta:100"},
{"orange", "Orange", "^[colorize:orange:100"},
{"pink", "Pink", "^[colorize:#FE2E9A:100"},
{"red", "Red", "^[colorize:#B40404:100"},
{"violet", "Violet", "^[colorize:#2F0B3A:100"},
{"white", "White", "^[colorize:white:100"},
{"yellow", "Yellow", "^[colorize:yellow:100"},
{"cement", "Concrete", ""},
}
for i in ipairs (color_tab) do
local col = color_tab[i][1]
local coldesc = color_tab[i][2]
local alpha = color_tab[i][3]
minetest.register_alias("mylandscaping:stone_"..style,"mylandscaping:stone_"..style.."cement")
minetest.register_node("mylandscaping:stone_"..style..col,{
description = desc.." Patio Stone"..coldesc,
drawtype = "nodebox",
tiles = {
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
"mylandscaping_"..img1..".png",
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
},
paramtype = "light",
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
},
node_box = cbox,
selection_box = stone_cbox,
collision_box = stone_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
local nodeu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
if nodeu == "default:sand" then
minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z},{name = "mylandscaping:stone_"..style.."_sand"})
if nodeu == "default:sand" or
nodeu == "default:desert_sand" then
minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z},{name = "mylandscaping:stone_"..style.."_sand"..col})
minetest.set_node(pos,{name = "air"})
end
end,
})
minetest.register_node("mylandscaping:stone_"..style.."_sand",{
description = desc.." Patio Stone in Sand",
drawtype = "normal",
minetest.register_node("mylandscaping:stone_"..style.."_sand"..col,{
description = desc.." Patio Stone in Sand "..coldesc,
drawtype = "nodebox",
tiles = {
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
"mylandscaping_"..img1..".png",
"mylandscaping_"..img1..".png",
"mylandscaping_"..img1..".png",
"mylandscaping_"..img1..".png",
"mylandscaping_"..img1..".png",
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
"mylandscaping_"..img1..".png"..alpha,
},
drop = "mylandscaping:stone_"..style,
paramtype = "light",
groups = {cracky = 2, not_in_creative_inventory = 1},
sounds = default.node_sound_stone_defaults(),
node_box = scbox,
selection_box = sstone_cbox,
collision_box = sstone_cbox,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
minetest.set_node(pos,{name = "default:sand"})
end,
})
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -75,28 +75,42 @@ for i in ipairs (block_mat) do
local img = block_mat[i][3]
local img2 = block_mat[i][4]
local img3 = block_mat[i][5]
local color_tab = {
"cement",
"cement_tan",
"cement_autumn",
"cement_red",
{"black", "Black", "^[colorize:black:150"},
{"blue", "Blue", "^[colorize:#0404B4:100"},
{"brown", "Brown", "^[colorize:#190B07:100"},
{"cyan", "Cyan", "^[colorize:cyan:100"},
{"dark_green", "Dark Green", "^[colorize:#071907:150"},
{"dark_grey", "Dark Grey", "^[colorize:black:150"},
{"green", "Green", "^[colorize:green:100"},
{"grey", "Grey", "^[colorize:black:100"},
{"magenta", "Magenta", "^[colorize:magenta:100"},
{"orange", "Orange", "^[colorize:orange:100"},
{"pink", "Pink", "^[colorize:#FE2E9A:100"},
{"red", "Red", "^[colorize:#B40404:100"},
{"violet", "Violet", "^[colorize:#2F0B3A:100"},
{"white", "White", "^[colorize:white:100"},
{"yellow", "Yellow", "^[colorize:yellow:100"},
{"cement", "Concrete", ""},
}
for i = 1,#color_tab do
local colors = color_tab[i]
for i in ipairs (color_tab) do
local col = color_tab[i][1]
local coldesc = color_tab[i][2]
local alpha = color_tab[i][3]
minetest.register_node('mylandscaping:rwall_'..typ.."_"..mat, {
minetest.register_node('mylandscaping:rwall_'..typ.."_"..col, {
description = desc2,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {{name=img..img2}, {name=img3..img2}},
tiles = {{name=img..alpha}, {name=img3..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
drop = 'mylandscaping:rwall_'..drops.."_"..mat,
drop = 'mylandscaping:rwall_'..drops.."_"..col,
selection_box = colbox,
collision_box = colbox,
@ -105,12 +119,12 @@ after_place_node = function(pos, placer, itemstack, pointed_thing)
local nodeu = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
local nodea = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
if nodeu.name == "mylandscaping:rwall_"..typ.."_"..colors then
minetest.set_node(pos,{name="mylandscaping:rwall_"..typ.."_"..mat,param2=nodeu.param2})
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:rwall_b"..typ.."_"..colors,param2=nodeu.param2})
if nodeu.name == "mylandscaping:rwall_"..typ.."_"..col then
minetest.set_node(pos,{name="mylandscaping:rwall_"..typ.."_"..col,param2=nodeu.param2})
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:rwall_b"..typ.."_"..col,param2=nodeu.param2})
end
if nodea.name == "mylandscaping:rwall_"..typ..mat then
minetest.set_node(pos,{name="mylandscaping:rwall_b"..typ.."_"..mat,param2=node.param2})
if nodea.name == "mylandscaping:rwall_"..typ..col then
minetest.set_node(pos,{name="mylandscaping:rwall_b"..typ.."_"..col,param2=node.param2})
end
end,
@ -120,9 +134,9 @@ after_destruct = function(pos, oldnode)
local nodeu2 = minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z})
local nodea = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if nodeu.name == "mylandscaping:rwall_b"..typ.."_"..mat and
if nodeu.name == "mylandscaping:rwall_b"..typ.."_"..col and
nodea.name == "air" then
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:rwall_"..typ.."_"..mat,param2=nodeu.param2})
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:rwall_"..typ.."_"..col,param2=nodeu.param2})
end