Removed env:

This commit is contained in:
DonBatman 2015-11-15 06:36:11 -08:00
parent d3fe1383e1
commit 061121282c
4 changed files with 12 additions and 97 deletions

View File

@ -248,8 +248,17 @@ minetest.register_node("mysheetmetal:downspout_bottomw", {
{-0.125, -0.5, -0.125, 0.125, -0.3125, 0.5},
}
},
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos);
meta:set_string("owner", (placer:get_player_name() or ""));
on_punch = function(pos, node, puncher, pointed_thing)
local owner = minetest.get_meta(pos).owner
if puncher == owner
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:downspout_bottom", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
else
return
end
end
})

View File

@ -1,94 +0,0 @@
local fascia_L_U = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
}
}
--Fascia 1
minetest.register_node("mysheetmetal:fascia", {
description = "Fascia",
drawtype = "mesh",
mesh = "twelve-twelve_L_Upper.obj",
tiles = {"mysheetmetal_white.png"},
paramtype = "light",
paramtype2 = "facedir",
selection_box = fascia_L_U,
groups = {choppy=2, oddly_breakable_by_hand=2},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:fascia_L_L", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
end
})
--Fascia 2
minetest.register_node("mysheetmetal:fascia_L_L", {
description = "Fascia Left Lower",
drawtype = "mesh",
mesh = "twelve-twelve_L_Under.obj",
tiles = {"mysheetmetal_white.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mysheetmetal:fascia",
selection_box = fascia_L_U,
groups = {choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:fascia_R_U", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
end
})
--Fascia 3
minetest.register_node("mysheetmetal:fascia_R_U", {
description = "Fascia Right Upper",
drawtype = "mesh",
mesh = "twelve-twelve_R_Upper.obj",
tiles = {"mysheetmetal_white.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mysheetmetal:fascia",
selection_box = fascia_L_U,
groups = {choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:fascia_R_L", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
end
})
--Fascia 4
minetest.register_node("mysheetmetal:fascia_R_L", {
description = "Fascia Right Lower",
drawtype = "mesh",
mesh = "twelve-twelve_R_Under.obj",
tiles = {"mysheetmetal_white.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mysheetmetal:fascia",
selection_box = fascia_L_U,
groups = {choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:fascia_full", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
end
})
--]]
--Fascia 5
minetest.register_node("mysheetmetal:fascia_full", {
description = "Fascia Full",
drawtype = "nodebox",
tiles = {"mysheetmetal_white.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mysheetmetal:fascia",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.5, 0.5, 0.5, 0.4375},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.5, 0.5, 0.5, 0.4375},
}
},
groups = {choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:fascia", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
end
})

View File

@ -73,7 +73,7 @@ minetest.register_node("mysheetmetal:machine", {
},
after_place_node = function(pos, placer)
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
meta:set_string("owner", (placer:get_player_name() or ""));
meta:set_string("infotext", "Eavestrough Machine is empty (owned by " .. (placer:get_player_name() or "") .. ")");
end,
@ -92,7 +92,7 @@ can_dig = function(pos,player)
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "invsize[10,11;]"..
"background[-0.15,-0.25;10.40,11.75;mysheetmetal_background.png]"..
"label[3,5;Steel Ingot:]"..
@ -128,7 +128,7 @@ on_construct = function(pos)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
--eaves trough
if fields["et"]

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB