major code cleanup. No new features.

master
NathanSalapat 2019-02-16 16:47:56 -06:00
parent 0516d1496c
commit 2fcfe695db
15 changed files with 1122 additions and 1159 deletions

View File

@ -1,10 +1,8 @@
minetest.register_node("mylandscaping:concrete", {
description = "Concrete",
drawtype = "normal",
tiles = {"mylandscaping_cement.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=1},
minetest.register_node('mylandscaping:concrete', {
description = 'Concrete',
tiles = {'mylandscaping_cement.png'},
groups = {cracky=1, ml=1},
sounds = default.node_sound_stone_defaults(),
})
--THIS NEEDS TO BE CRAFTABLE. Right now it has ZERO purpose.

View File

@ -8,12 +8,12 @@ form =
input =
'label[3,4.5;Input]'..
'list[current_name;input;3,5;1,1;]'..
'list[context;input;3,5;1,1;]'..
'label[4,4.5;Dye]'..
'list[current_name;dye;4,5;1,1;]'..
'list[context;dye;4,5;1,1;]'..
--Output
'label[6,4.5;Output]'..
'list[current_name;output;6,5;1,1;]'..
'list[context;output;6,5;1,1;]'..
--Players Inven
'list[current_player;main;1,6;8,4;]'

View File

@ -1,6 +1,9 @@
--configs
-- change this to make blocks show in creative inventory. 0 will show, 1 is invisible
mylandscaping_visible = 1
mylandscaping = {}
if minetest.settings:get_bool('mylandscaping.creative') then
ml_visible = 0
else
ml_visible = 1
end
--Load File
dofile(minetest.get_modpath('mylandscaping')..'/walls_freeport.lua')
@ -9,8 +12,8 @@ dofile(minetest.get_modpath('mylandscaping')..'/walls_adaridge.lua')
dofile(minetest.get_modpath('mylandscaping')..'/walls_deco.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')..'/machine.lua')
dofile(minetest.get_modpath('mylandscaping')..'/mixer.lua')
dofile(minetest.get_modpath('mylandscaping')..'/concrete.lua')
dofile(minetest.get_modpath('mylandscaping')..'/formspec.lua')
dofile(minetest.get_modpath('mylandscaping')..'/toppers.lua')

File diff suppressed because it is too large Load Diff

128
mixer.lua
View File

@ -1,12 +1,11 @@
minetest.register_alias("myconcrete:concrete", "mylandscaping:concrete")
minetest.register_node('mylandscaping:mixer', {
description = 'concrete 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'}},
{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',
@ -26,63 +25,59 @@ minetest.register_node('mylandscaping:mixer', {
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if player:get_player_name() == meta:get_string("owner") and
inv:is_empty("cobble") and
inv:is_empty("gravel") and
inv:is_empty("concrete") and
inv:is_empty("sand") then
if player:get_player_name() == meta:get_string('owner') and
inv:is_empty('cobble') and
inv:is_empty('gravel') and
inv:is_empty('concrete') and
inv:is_empty('sand') then
return true
else
return false
return false
end
end,
after_place_node = function(pos, placer, itemstack)
local meta = minetest.get_meta(pos)
local timer = minetest.get_node_timer(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Cement Mixer (owned by "..placer:get_player_name()..")")
local timer = minetest.get_node_timer(pos)
meta:set_string('owner',placer:get_player_name())
meta:set_string('infotext','Cement Mixer (owned by '..placer:get_player_name()..')')
timer:start(10)
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[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")
meta:set_string('formspec', 'size[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[context;cobble;2.5,1;1,1;]'..
'list[context;gravel;5.5,1;1,1;]'..
'label[6.5,1;Gravel]'..
--Concrete
'label[5,0.5;Concrete Mixer]'..
'list[context;sand;5.5,2.5;1,1;]'..
'label[6.5,2.5;Sand]'..
'list[context;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("concrete", 1)
inv:set_size("sand", 1)
end,
inv:set_size('cobble', 1)
inv:set_size('gravel', 1)
inv:set_size('concrete', 1)
inv:set_size('sand', 1)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local input = stack:get_name()
if listname == 'cobble' then
if input ~= 'default:cobble' then
return 0
else
if input == 'default:cobble' or minetest.get_item_group(input, 'ml') > 0 then
return 99
else
return 0
end
elseif listname == 'gravel' then
if input ~= 'default:gravel' then
@ -91,10 +86,10 @@ on_construct = function(pos)
return 99
end
elseif listname == 'sand' then
if input ~= 'default:sand' then
return 0
else
if minetest.get_item_group(input, 'sand') > 0 then
return 99
else
return 0
end
elseif listname == 'concrete' then
return 0
@ -102,30 +97,27 @@ on_construct = function(pos)
end,
on_timer = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local cobble = inv:get_stack("cobble", 1)
local gravel = inv:get_stack("gravel", 1)
local sand = inv:get_stack("sand", 1)
local cobble_inv= cobble:get_name()
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local cobble = inv:get_stack('cobble', 1)
local gravel = inv:get_stack('gravel', 1)
local sand = inv:get_stack('sand', 1)
local cobble_inv= cobble:get_name()
local sand_inv = sand:get_name()
----------------------------------------------------------------------
if cobble:get_name() == "default:cobble" or
minetest.get_item_group(cobble_inv, 'ml') > 0 then
inv:add_item("gravel","default:gravel")
cobble:take_item()
inv:set_stack("cobble",1,cobble)
if cobble:get_name() == 'default:cobble' or minetest.get_item_group(cobble_inv, 'ml') > 0 then
inv:add_item('gravel','default:gravel')
cobble:take_item()
inv:set_stack('cobble',1,cobble)
end
if gravel:get_name() == "default:gravel" and
sand:get_name() == "default:sand" or
sand:get_name() == "default:desert_sand" then
inv:add_item("concrete","mylandscaping:concrete_bag")
gravel:take_item()
inv:set_stack("gravel",1,gravel)
sand:take_item()
inv:set_stack("sand",1,sand)
if gravel:get_name() == 'default:gravel' and minetest.get_item_group(sand_inv, 'sand') > 0 then
inv:add_item('concrete','mylandscaping:concrete_bag')
gravel:take_item()
inv:set_stack('gravel',1,gravel)
sand:take_item()
inv:set_stack('sand',1,sand)
end
timer:start(10)
end,
})

View File

@ -15,7 +15,3 @@ This is a Minetest mod that adds retaining walls and column nodes.
- default
- bucket
- myconcrete?
#
Please Note:
If you don't want all the blocks showing in creative inventory modify the walls.lua file and change the first line to say visible = 0, (this is the default setting.)

View File

@ -1,19 +1,28 @@
minetest.register_craft({
output = 'mylandscaping:machine 1',
recipe = {
{'default:shovel_steel', 'bucket:bucket_water', ''},
{'default:steel_ingot', 'mylandscaping:concrete_bag', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
output = 'mylandscaping:machine',
recipe = {
{'default:shovel_steel', 'bucket:bucket_water', ''},
{'default:steel_ingot', 'mylandscaping:concrete_bag', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'mylandscaping:mixer 1',
recipe = {
{'default:pick_steel', 'default:paper', 'default:chest'},
{'group:stick', 'default:paper', 'group:stick'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
output = 'mylandscaping:mixer',
recipe = {
{'default:pick_steel', 'default:paper', 'default:chest'},
{'group:stick', 'default:paper', 'group:stick'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'mylandscaping:concrete',
recipe = {
{'', '', ''},
{'', '', ''},
{'', '', ''},
}
})
minetest.register_craftitem('mylandscaping:concrete_bag', {

1
settingtypes.txt Normal file
View File

@ -0,0 +1 @@
mylandscaping.creative (Display retaining wall blocks in creative inventory?) bool false

View File

@ -1,32 +1,32 @@
local stone_cbox = {
type = "fixed",
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
}
}
local sstone_cbox = {
type = "fixed",
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
}
}
local sq_cbox = {
type = "fixed",
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",
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",
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},
@ -36,7 +36,7 @@ local smsq_cbox = {
}
}
local s_smsq_cbox = {
type = "fixed",
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},
@ -46,7 +46,7 @@ local s_smsq_cbox = {
}
}
local xsmsq_cbox = {
type = "fixed",
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},
@ -61,7 +61,7 @@ local xsmsq_cbox = {
}
}
local s_xsmsq_cbox = {
type = "fixed",
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},
@ -76,89 +76,89 @@ local s_xsmsq_cbox = {
}
}
local paver_cbox = {
type = "fixed",
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.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},
{-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",
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.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},
{-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",
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},
{-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",
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},
{-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",
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},
@ -172,7 +172,7 @@ local flag_cbox = {
}
}
local sflag_cbox = {
type = "fixed",
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},
@ -186,7 +186,7 @@ local sflag_cbox = {
}
}
local pin_cbox = {
type = "fixed",
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},
@ -197,7 +197,7 @@ local pin_cbox = {
}
}
local spin_cbox = {
type = "fixed",
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},
@ -208,16 +208,14 @@ local spin_cbox = {
}
}
local stone_types = { --style, desc, img1, img2
{"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},
{'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]
@ -226,83 +224,80 @@ for i in ipairs (stone_types) do
local img2 = stone_types[i][4]
local cbox = stone_types[i][5]
local scbox = stone_types[i][6]
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', ''},
}
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]
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_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"..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, not_in_creative_inventory=1, ml=1,},
node_box = cbox,
selection_box = stone_cbox,
collision_box = stone_cbox,
sounds = default.node_sound_stone_defaults(),
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
minetest.register_node('mylandscaping:stone_'..style..col,{
description = desc..' Patio Stone '..coldesc,
drawtype = 'nodebox',
tiles = {
'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, not_in_creative_inventory=ml_visible, ml=1,},
node_box = cbox,
selection_box = stone_cbox,
collision_box = stone_cbox,
sounds = default.node_sound_stone_defaults(),
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,
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 minetest.get_item_group(nodeu, 'sand') > 0 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"..col,{
description = desc.." Patio Stone in Sand "..coldesc,
drawtype = "nodebox",
tiles = {
"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},
node_box = scbox,
selection_box = sstone_cbox,
collision_box = sstone_cbox,
sounds = default.node_sound_stone_defaults(),
after_dig_node = function(pos, oldnode, oldmetadata, digger)
minetest.set_node(pos,{name = "default:sand"})
end,
})
end
})
minetest.register_node('mylandscaping:stone_'..style..'_sand'..col,{
description = desc..' Patio Stone in Sand '..coldesc,
drawtype = 'nodebox',
tiles = {
'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},
node_box = scbox,
selection_box = sstone_cbox,
collision_box = sstone_cbox,
sounds = default.node_sound_stone_defaults(),
after_dig_node = function(pos, oldnode, oldmetadata, digger)
minetest.set_node(pos,{name = 'default:silver_sand'})
end,
})
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 401 B

View File

@ -1,48 +1,47 @@
local block_type1 = { -- desc2, obj, texture
{"Sphere", "sphere", 'concrete'},
{"Suzanne", "suzanne", 'concrete'},
{'Sphere', 'sphere', 'concrete'},
{'Suzanne', 'suzanne', 'concrete'},
{'Dragon', 'dragon', 'dragon'},
{'Cross', 'cross', 'concrete'},
}
for i in ipairs (block_type1) do
local desc2 = block_type1[i][1]
local obj = block_type1[i][2]
local tex = block_type1[i][3]
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', ''},
}
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_node('mylandscaping:column_t_'..obj.."_"..col, {
description = desc2..' topper',
drawtype = 'mesh',
mesh = 'mylandscaping_column_t_'..obj..'.obj',
tiles = {name='mylandscaping_'..tex..'.png'..alpha},
groups = {cracky=2, not_in_creative_inventory=mylandscaping_visible, ml=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
})
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:column_t_'..obj..'_'..col, {
description = desc2..' topper',
drawtype = 'mesh',
mesh = 'mylandscaping_column_t_'..obj..'.obj',
tiles = {name='mylandscaping_'..tex..'.png'..alpha},
groups = {cracky=2, not_in_creative_inventory=ml_visible, ml=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
})
end
end
end

View File

@ -1,26 +1,26 @@
local colbox_type1 = { --top blocks
type = "fixed",
type = 'fixed',
fixed = {{-.49, -.5, 0.05, .5, .5, .52}}
}
local colbox_type2 = { --outside corner columns
type = "fixed",
type = 'fixed',
fixed = {{-.2, -.5, -.2, .5, .5, .5}}
}
local colbox_type3 = { --bottom blocks
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, -.16, .5, .5, .25}}
}
local colbox_type4 = { --inside corner
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, 0, .5, .5, .5},
{0, -.5, -.5, .5, .5, .5}}
}
local colbox_type5 = { --inside corner column
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, -.5, .5, .5, .5},}
}
local colbox_type6 = { --middle column
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, -.3, .5, .5, .5},}
}
@ -30,22 +30,22 @@ local colbox_type7 = { --outside corner
}
local block_type1 = { -- desc2, typ, obj, colbox, drops, grup
{"Retaining Wall Left", "left", "blocka_l_t", colbox_type1, "left", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Middle", "middle", "blocka_m_t", colbox_type1, "middle", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Right", "right", "blocka_r_t", colbox_type1, "right", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Inside Corner", "icorner", "blocka_ic_t", colbox_type4, "icorner", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Outside Corner", "ocorner", "blocka_oc_t", colbox_type2, "ocorner", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Left Bot", "bleft", "blocka_l_b", colbox_type3, "left", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Middle Bot", "bmiddle", "blocka_m_b", colbox_type3, "middle", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Right Bot", "bright", "blocka_r_b", colbox_type3, "right", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Inside Corner Bot", "bicorner", "blocka_ic_b", colbox_type4, "icorner", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Outside Corner Bot", "bocorner", "blocka_oc_b", colbox_type2, "ocorner", {not_in_creative_inventory=mylandscaping_visible}},
{"Column Inside Corner", "column_ic_t", "columna_ic_t", colbox_type5, "column_ic_t", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Column Outside Corner", "column_oc_t", "columna_oc_t", colbox_type2, "column_oc_t", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Column Middle", "column_m_t", "columna_m_t", colbox_type6, "column_m_t", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Column Inside Corner Bot", "bcolumn_ic_t", "columna_ic_b", colbox_type5, "column_ic_b", {not_in_creative_inventory=mylandscaping_visible}},
{"Column Outside Corner Bot", "bcolumn_oc_t", "columna_oc_b", colbox_type2, "column_oc_b", {not_in_creative_inventory=mylandscaping_visible}},
{"Column Middle Bot", "bcolumn_m_t", "columna_m_b", colbox_type6, "column_m_b", {not_in_creative_inventory=mylandscaping_visible}},
{'Adaridge Left', 'left', 'blocka_l_t', colbox_type1, 'left', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Adaridge Middle', 'middle', 'blocka_m_t', colbox_type1, 'middle', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Adaridge Right', 'right', 'blocka_r_t', colbox_type1, 'right', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Adaridge Inside Corner', 'icorner', 'blocka_ic_t', colbox_type4, 'icorner', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Adaridge Outside Corner', 'ocorner', 'blocka_oc_t', colbox_type2, 'ocorner', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bleft', 'blocka_l_b', colbox_type3, 'left', {not_in_creative_inventory=1}},
{'Hax0r', 'bmiddle', 'blocka_m_b', colbox_type3, 'middle', {not_in_creative_inventory=1}},
{'Hax0r', 'bright', 'blocka_r_b', colbox_type3, 'right', {not_in_creative_inventory=1}},
{'Hax0r', 'bicorner', 'blocka_ic_b', colbox_type4, 'icorner', {not_in_creative_inventory=1}},
{'Hax0r', 'bocorner', 'blocka_oc_b', colbox_type2, 'ocorner', {not_in_creative_inventory=1}},
{'Adaridge Column (IC)', 'column_ic_t', 'columna_ic_t', colbox_type5, 'column_ic_t', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Adaridge Column (OC)', 'column_oc_t', 'columna_oc_t', colbox_type2, 'column_oc_t', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Adaridge Column (M)', 'column_m_t', 'columna_m_t', colbox_type6, 'column_m_t', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bcolumn_ic_t', 'columna_ic_b', colbox_type5, 'column_ic_b', {not_in_creative_inventory=1}},
{'Hax0r', 'bcolumn_oc_t', 'columna_oc_b', colbox_type2, 'column_oc_b', {not_in_creative_inventory=1}},
{'Hax0r', 'bcolumn_m_t', 'columna_m_b', colbox_type6, 'column_m_b', {not_in_creative_inventory=1}},
}
for i in ipairs (block_type1) do
local desc2 = block_type1[i][1]
@ -54,66 +54,61 @@ for i in ipairs (block_type1) do
local colbox = block_type1[i][4]
local drops = block_type1[i][5]
local grup = block_type1[i][6]
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]
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_node('mylandscaping:awall_'..typ..'_'..col, {
description = desc2..' '..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {name='mylandscaping_adaridge_tex.png'..alpha},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'mylandscaping:awall_'..drops..'_'..col,
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
minetest.register_node('mylandscaping:awall_'..typ.."_"..col, {
description = desc2.." "..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {name='mylandscaping_adaridge_tex.png'..alpha},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'mylandscaping:awall_'..drops.."_"..col,
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
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:awall_"..typ.."_"..col then
minetest.set_node(pos,{name="mylandscaping:awall_"..typ.."_"..col,param2=nodeu.param2})
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:awall_b"..typ.."_"..col,param2=nodeu.param2})
end
if nodea.name == "mylandscaping:awall_"..typ..col then
minetest.set_node(pos,{name="mylandscaping:awall_b"..typ.."_"..col,param2=node.param2})
end
end,
after_destruct = function(pos, oldnode)
local node = minetest.get_node(pos).name
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})
if nodeu.name == "mylandscaping:awall_b"..typ.."_"..col then
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:awall_"..typ.."_"..col,param2=nodeu.param2})
end
end,
})
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:awall_'..typ..'_'..col then
minetest.swap_node(pos,{name='mylandscaping:awall_'..typ..'_'..col,param2=nodeu.param2})
minetest.swap_node({x=pos.x,y=pos.y-1,z=pos.z},{name='mylandscaping:awall_b'..typ..'_'..col,param2=nodeu.param2})
end
if nodea.name == 'mylandscaping:awall_'..typ..'_'..col then
minetest.swap_node(pos,{name='mylandscaping:awall_b'..typ..'_'..col,param2=nodea.param2})
end
end,
end
after_destruct = function(pos, oldnode)
local nodeu = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if nodeu.name == 'mylandscaping:awall_b'..typ..'_'..col then
minetest.swap_node({x=pos.x,y=pos.y-1,z=pos.z},{name='mylandscaping:awall_'..typ..'_'..col,param2=nodeu.param2})
end
end,
})
end
end

View File

@ -8,77 +8,76 @@ local colbox_type2 = { --wall
}
local block_type1 = { -- desc2, obj, colbox, grup,
{"Deco Wall Scalloped", "wall_s", colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Deco Wall Flat Top", "wall_f", colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{'Deco Wall Peaked Top', 'wall_p', colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{'Deco Wall Random Top', 'wall_r', colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Deco Wall Column", "column", colbox_type1, {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Deco Wall Scalloped", "wall_s", colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{"Deco Wall Flat Top", "wall_f", colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Deco Wall Peaked Top', 'wall_p', colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Deco Wall Random Top', 'wall_r', colbox_type2, {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{"Deco Wall Column", "column", colbox_type1, {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
}
for i in ipairs (block_type1) do
local desc2 = block_type1[i][1]
local obj = block_type1[i][2]
local colbox = block_type1[i][3]
local grup = block_type1[i][4]
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]
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_node('mylandscaping:deco_'..obj..'_'..col, {
description = desc2.." "..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_deco_'..obj..'.obj',
tiles = {{name='mylandscaping_block_split.png'..alpha}, {name='mylandscaping_block_smooth.png'..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node('mylandscaping:deco_'..obj..'_'..col, {
description = desc2.." "..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_deco_'..obj..'.obj',
tiles = {{name='mylandscaping_block_split.png'..alpha}, {name='mylandscaping_block_smooth.png'..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node('mylandscaping:deco_column_light_'..col, {
description = coldesc..'lighted column',
drawtype = 'mesh',
mesh = 'mylandscaping_deco_column_l.obj',
tiles = {
{name='mylandscaping_block_split.png'..alpha},
{name='mylandscaping_block_smooth.png'..alpha},
{name='mylandscaping_block_smooth.png^[colorize:yellow:255'},
{name='mylandscaping_block_smooth.png^[colorize:#190B07:200'}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
light_source = LIGHT_MAX,
selection_box = colbox_type1,
collision_box = colbox_type1,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node('mylandscaping:deco_column_light_'..col, {
description = coldesc..'lighted column',
drawtype = 'mesh',
mesh = 'mylandscaping_deco_column_l.obj',
tiles = {
{name='mylandscaping_block_split.png'..alpha},
{name='mylandscaping_block_smooth.png'..alpha},
{name='mylandscaping_block_smooth.png^[colorize:yellow:255'},
{name='mylandscaping_block_smooth.png^[colorize:#190B07:200'}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
light_source = LIGHT_MAX,
selection_box = colbox_type1,
collision_box = colbox_type1,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
type = 'shapeless',
output = 'mylandscaping:deco_column_light_'..col,
recipe = {'default:torch', 'mylandscaping:deco_column_'..col}
})
minetest.register_craft({
type = 'shapeless',
output = 'mylandscaping:deco_column_light_'..col,
recipe = {'default:torch', 'mylandscaping:deco_column_'..col}
})
end
end
end

View File

@ -1,44 +1,44 @@
local colbox_type1 = { --top blocks
type = "fixed",
type = 'fixed',
fixed = {{-.49, -.5, 0.05, .5, .5, .52}}
}
local colbox_type2 = { --columns
type = "fixed",
type = 'fixed',
fixed = {{-.2, -.5, -.2, .5, .5, .5}}
}
local colbox_type3 = { --bottom blocks
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, -.16, .5, .5, .25}}
}
local colbox_type4 = { --corner
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, 0, .5, .5, .5},
{0, -.5, -.5, .5, .5, .5}}
}
local colbox_type5 = { --corner
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, -.5, .5, .5, .5},}
}
local colbox_type6 = { --corner
type = "fixed",
type = 'fixed',
fixed = {{-.5, -.5, -.3, .5, .5, .5},}
}
local block_type1 = { -- desc2, typ, obj, colbox, drops, grup
{"Retaining Wall Left", "left", "blockf_l_t", colbox_type1, "left", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Middle", "middle", "blockf_m_t", colbox_type1, "middle", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Right", "right", "blockf_r_t", colbox_type1, "right", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Corner", "corner", "blockf_c_t", colbox_type4, "corner", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Left Bot", "bleft", "blockf_l_b", colbox_type3, "left", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Middle Bot", "bmiddle", "blockf_m_b", colbox_type3, "middle", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Right Bot", "bright", "blockf_r_b", colbox_type3, "right", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Corner Bot", "bcorner", "blockf_c_b", colbox_type4, "corner", {not_in_creative_inventory=mylandscaping_visible}},
{"Column Inside Corner", "column_ic_t", "columnf_ic_t", colbox_type5, "column_ic_t", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Column Outside Corner", "column_oc_t", "columnf_oc_t", colbox_type2, "column_oc_t", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Column Middle", "column_m_t", "columnf_m_t", colbox_type6, "column_m_t", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Column Inside Corner Bot", "bcolumn_ic_t", "columnf_ic_b", colbox_type5, "column_ic_b", {not_in_creative_inventory=mylandscaping_visible}},
{"Column Outside Corner Bot", "bcolumn_oc_t", "columnf_oc_b", colbox_type2, "column_oc_b", {not_in_creative_inventory=mylandscaping_visible}},
{"Column Middle Bot", "bcolumn_m_t", "columnf_m_b", colbox_type6, "column_m_b", {not_in_creative_inventory=mylandscaping_visible}},
{'Freeport Left', 'left', 'blockf_l_t', colbox_type1, 'left', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Freeport Middle', 'middle', 'blockf_m_t', colbox_type1, 'middle', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Freeport Right', 'right', 'blockf_r_t', colbox_type1, 'right', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Freeport Inside Corner', 'corner', 'blockf_c_t', colbox_type4, 'corner', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bleft', 'blockf_l_b', colbox_type3, 'left', {not_in_creative_inventory=1}},
{'Hax0r', 'bmiddle', 'blockf_m_b', colbox_type3, 'middle', {not_in_creative_inventory=1}},
{'Hax0r', 'bright', 'blockf_r_b', colbox_type3, 'right', {not_in_creative_inventory=1}},
{'Hax0r', 'bcorner', 'blockf_c_b', colbox_type4, 'corner', {not_in_creative_inventory=1}},
{'Freeport Column (IC)', 'column_ic_t', 'columnf_ic_t', colbox_type5, 'column_ic_t', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Freeport Column (OC)', 'column_oc_t', 'columnf_oc_t', colbox_type2, 'column_oc_t', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Freeport Column (M)', 'column_m_t', 'columnf_m_t', colbox_type6, 'column_m_t', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bcolumn_ic_t', 'columnf_ic_b', colbox_type5, 'column_ic_b', {not_in_creative_inventory=1}},
{'Hax0r', 'bcolumn_oc_t', 'columnf_oc_b', colbox_type2, 'column_oc_b', {not_in_creative_inventory=1}},
{'Hax0r', 'bcolumn_m_t', 'columnf_m_b', colbox_type6, 'column_m_b', {not_in_creative_inventory=1}},
}
for i in ipairs (block_type1) do
local desc2 = block_type1[i][1]
@ -47,65 +47,61 @@ for i in ipairs (block_type1) do
local colbox = block_type1[i][4]
local drops = block_type1[i][5]
local grup = block_type1[i][6]
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]
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_node('mylandscaping:fwall_'..typ..'_'..col, {
description = desc2..' '..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {{name='mylandscaping_block_smooth.png'..alpha}, {name='mylandscaping_block_split.png'..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'mylandscaping:fwall_'..drops..'_'..col,
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
minetest.register_node('mylandscaping:fwall_'..typ.."_"..col, {
description = desc2.." "..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {{name='mylandscaping_block_smooth.png'..alpha}, {name='mylandscaping_block_split.png'..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'mylandscaping:fwall_'..drops.."_"..col,
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
after_place_node = function(pos, placer, itemstack)
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})
if nodeu.name == 'mylandscaping:fwall_'..typ..'_'..col then
minetest.swap_node(pos,{name='mylandscaping:fwall_'..typ..'_'..col,param2=nodeu.param2})
minetest.swap_node({x=pos.x,y=pos.y-1,z=pos.z},{name='mylandscaping:fwall_b'..typ..'_'..col,param2=nodeu.param2})
end
if nodea.name == 'mylandscaping:fwall_'..typ..'_'..col then
minetest.swap_node(pos,{name='mylandscaping:fwall_b'..typ..'_'..col,param2=nodea.param2})
end
end,
after_place_node = function(pos, placer, itemstack)
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})
if nodeu.name == "mylandscaping:fwall_"..typ.."_"..col then
minetest.set_node(pos,{name="mylandscaping:fwall_"..typ.."_"..col,param2=nodeu.param2})
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:fwall_b"..typ.."_"..col,param2=nodeu.param2})
end
if nodea.name == "mylandscaping:fwall_"..typ..'_'..col then
minetest.set_node(pos,{name="mylandscaping:fwall_b"..typ.."_"..col,param2=nodea.param2})
end
end,
after_destruct = function(pos, oldnode)
local node = minetest.get_node(pos)
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})
if nodeu.name == "mylandscaping:fwall_b"..typ.."_"..col then
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:fwall_"..typ.."_"..col,param2=node.param2})
end
end,
})
after_destruct = function(pos, oldnode)
local nodeu = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if nodeu.name == 'mylandscaping:fwall_b'..typ..'_'..col then
minetest.swap_node({x=pos.x,y=pos.y-1,z=pos.z},{name='mylandscaping:fwall_'..typ..'_'..col,param2=nodeu.param2})
end
end,
end
})
end
end

View File

@ -1,37 +1,37 @@
local colbox_type1 = { --top blocks
type = "fixed",
type = 'fixed',
fixed = {-.5, -.5, -.2, .5, .5, .5}
}
local colbox_type2 = { --bottom blocks
type = "fixed",
type = 'fixed',
fixed = {-.5, -.5, -.2, .5, .5, .5}
}
local colbox_type3 = { --top inside corner
type = "fixed",
type = 'fixed',
fixed = {{-.2, -.5, -.5, .5, .5, .5},
{-.5, -.5, -.2, .5, .5, .5}}
}
local colbox_type4 = { --bottom inside corner
type = "fixed",
type = 'fixed',
fixed = {{-.2, -.5, -.5, .5, .5, .5},
{-.5, -.5, -.2, .5, .5, .5}}
}
local colbox_type5 = { --top outside corner
type = "fixed",
type = 'fixed',
fixed = {-.2, -.5, -.2, .5, .5, .5}
}
local colbox_type6 = { --bottom outside corner
type = "fixed",
type = 'fixed',
fixed = {-.2, -.5, -.2, .5, .5, .5}
}
local block_type1 = { -- desc2, typ, obj, colbox, drops, grup
{"Retaining Wall Middle", "middle", "blockm_m_t", colbox_type1, "middle", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Middle Bot", "bmiddle", "blockm_m_b", colbox_type2, "middle", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Inside Corner", "icorner", "blockm_ic_t", colbox_type3, "icorner", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Inside Corner Bot", "bicorner", "blockm_ic_b", colbox_type4, "icorner", {not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Outside Corner", "ocorner", "blockm_oc_t", colbox_type5, "ocorner", {ml=1,cracky=2,not_in_creative_inventory=mylandscaping_visible}},
{"Retaining Wall Outside Corner Bot", "bocorner", "blockm_oc_b", colbox_type6, "ocorner", {not_in_creative_inventory=mylandscaping_visible}},
{'Madison Middle', 'middle', 'blockm_m_t', colbox_type1, 'middle', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bmiddle', 'blockm_m_b', colbox_type2, 'middle', {not_in_creative_inventory=1}},
{'Madison Inside Corner', 'icorner', 'blockm_ic_t', colbox_type3, 'icorner', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bicorner', 'blockm_ic_b', colbox_type4, 'icorner', {not_in_creative_inventory=1}},
{'Madison Outside Corner', 'ocorner', 'blockm_oc_t', colbox_type5, 'ocorner', {ml=1,cracky=2,not_in_creative_inventory=ml_visible}},
{'Hax0r', 'bocorner', 'blockm_oc_b', colbox_type6, 'ocorner', {not_in_creative_inventory=1}},
}
for i in ipairs (block_type1) do
@ -41,65 +41,60 @@ for i in ipairs (block_type1) do
local colbox = block_type1[i][4]
local drops = block_type1[i][5]
local grup = block_type1[i][6]
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]
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_node('mylandscaping:mwall_'..typ..'_'..col, {
description = desc2..' '..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {{name='mylandscaping_madison_wood.png'}, {name='mylandscaping_madison_stone.png'..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'mylandscaping:mwall_'..drops..'_'..col,
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
minetest.register_node('mylandscaping:mwall_'..typ.."_"..col, {
description = desc2.." "..coldesc,
drawtype = 'mesh',
mesh = 'mylandscaping_'..obj..'.obj',
tiles = {{name='mylandscaping_madison_wood.png'}, {name='mylandscaping_madison_stone.png'..alpha}},
groups = grup,
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'mylandscaping:mwall_'..drops.."_"..col,
selection_box = colbox,
collision_box = colbox,
sounds = default.node_sound_stone_defaults(),
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})
if nodeu.name == "mylandscaping:mwall_"..typ.."_"..col then
minetest.set_node(pos,{name="mylandscaping:mwall_"..typ.."_"..col,param2=nodeu.param2})
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:mwall_b"..typ.."_"..col,param2=nodeu.param2})
end
if nodea.name == "mylandscaping:mwall_"..typ..col then
minetest.set_node(pos,{name="mylandscaping:mwall_b"..typ.."_"..col,param2=nodea.param2})
end
end,
after_destruct = function(pos, oldnode)
local node = minetest.get_node(pos)
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})
if nodeu.name == "mylandscaping:mwall_b"..typ.."_"..col then
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:mwall_"..typ.."_"..col,param2=node.param2})
end
end,
})
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})
if nodeu.name == 'mylandscaping:mwall_'..typ..'_'..col then
minetest.swap_node(pos,{name='mylandscaping:mwall_'..typ..'_'..col,param2=nodeu.param2})
minetest.swap_node({x=pos.x,y=pos.y-1,z=pos.z},{name='mylandscaping:mwall_b'..typ..'_'..col,param2=nodeu.param2})
end
if nodea.name == 'mylandscaping:mwall_'..typ..'_'..col then
minetest.swap_node(pos,{name='mylandscaping:mwall_b'..typ..'_'..col,param2=nodea.param2})
end
end,
end
after_destruct = function(pos, oldnode)
local nodeu = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if nodeu.name == 'mylandscaping:mwall_b'..typ..'_'..col then
minetest.swap_node({x=pos.x,y=pos.y-1,z=pos.z},{name='mylandscaping:mwall_'..typ..'_'..col,param2=nodeu.param2})
end
end,
})
end
end