Added dig protection and a few other funtions
18
machine.lua
|
@ -32,6 +32,24 @@ minetest.register_node('mylandscaping:machine', {
|
|||
{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 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;]"..
|
||||
|
|
11
stones.lua
|
@ -15,17 +15,17 @@ minetest.register_node("mylandscaping:stone_"..style,{
|
|||
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",
|
||||
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
|
||||
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
|
||||
"mylandscaping_"..img1..".png^mylandscaping_"..img2..".png",
|
||||
},
|
||||
paramtype = "light",
|
||||
groups = {cracky = 2},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5},
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -38,6 +38,7 @@ minetest.register_node("mylandscaping:stone_"..style,{
|
|||
minetest.set_node(pos,{name = "air"})
|
||||
end
|
||||
end,
|
||||
|
||||
})
|
||||
minetest.register_node("mylandscaping:stone_"..style.."_sand",{
|
||||
description = desc.." Patio Stone in Sand",
|
||||
|
|
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 255 B |
27
walls.lua
|
@ -60,11 +60,34 @@ minetest.register_node('mylandscaping:rwall_'..typ..mat, {
|
|||
|
||||
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 node = minetest.get_node(pos)
|
||||
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 == "mylandscaping:rwall_"..typ..mat or
|
||||
nodeu == "mylandscaping:rwall_b"..typ..mat then
|
||||
minetest.set_node(pos,{name="mylandscaping:rwall_"..typ..mat,param2=node.param2})
|
||||
end
|
||||
if nodeu.name == "mylandscaping:rwall_"..typ..mat then
|
||||
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:rwall_b"..typ..mat,param2=node.param2})
|
||||
end
|
||||
end
|
||||
if nodea.name == "mylandscaping:rwall_"..typ..mat then
|
||||
minetest.set_node(pos,{name="mylandscaping:rwall_b"..typ..mat,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 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
|
||||
nodea.name == "air" then
|
||||
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mylandscaping:rwall_"..typ..mat,param2=node.param2})
|
||||
end
|
||||
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
end
|
||||
|
|