2017-01-11 19:58:37 +01:00
|
|
|
local buildPlatform = function(node, pos, itemstack)
|
|
|
|
-- code for the building platforms
|
2020-07-20 02:20:06 +02:00
|
|
|
local posZ = {'1', '0', '-1', '-1', '0', '0', '1', '1' };
|
|
|
|
local posX = {'0', '-1', '0', '0', '1', '1', '0', '0' };
|
2017-01-11 19:58:37 +01:00
|
|
|
|
|
|
|
for nameCount = 1, 8 do
|
|
|
|
pos.z = pos.z + posZ[nameCount];
|
|
|
|
pos.x = pos.x + posX[nameCount];
|
|
|
|
local current_node = minetest.get_node(pos);
|
|
|
|
if current_node.name == "air" then
|
|
|
|
minetest.set_node(pos, {name = node} )
|
|
|
|
itemstack:take_item(1); --//and remove one if its the correct one
|
|
|
|
break;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-- end of function
|
|
|
|
end
|
|
|
|
|
|
|
|
local buildScaffolding = function(node, pos, itemstack, player)
|
|
|
|
-- many thanks to addi for improveing (rewriteing) my crappy code --
|
|
|
|
|
|
|
|
-- code for the building scaffolding
|
2020-07-20 02:20:06 +02:00
|
|
|
local height = 0;
|
|
|
|
local depth = 0; -- !!Note!! depth is not needed at the moment
|
2017-01-11 23:09:10 +01:00
|
|
|
|
2017-01-11 19:58:37 +01:00
|
|
|
|
|
|
|
--[[ debug stuff ]]
|
|
|
|
|
|
|
|
|
|
|
|
-- set pos at bottom of scafolding tower.
|
|
|
|
repeat
|
|
|
|
pos.y = pos.y - 1; --every run get one node up
|
|
|
|
depth = depth - 1
|
|
|
|
local current_node = minetest.get_node(pos); --get the node of the new position
|
2017-01-11 23:09:10 +01:00
|
|
|
|
2017-01-11 19:58:37 +01:00
|
|
|
|
|
|
|
until current_node.name ~= node -- will repeat untill it dose not find a scaffolding node
|
2017-01-11 23:09:10 +01:00
|
|
|
|
2017-01-11 19:58:37 +01:00
|
|
|
|
|
|
|
-- check height of scaffolding tower --
|
|
|
|
|
|
|
|
repeat
|
|
|
|
pos.y = pos.y + 1; --every run get one node up
|
|
|
|
height = height + 1
|
|
|
|
local current_node = minetest.get_node(pos); --get the node of the new position
|
2017-01-11 23:09:10 +01:00
|
|
|
|
2017-01-11 19:58:37 +01:00
|
|
|
|
|
|
|
if current_node.name == "air" then
|
|
|
|
minetest.set_node(pos, {name = node } )
|
|
|
|
itemstack:take_item(1); --//and remove one if its the correct one
|
|
|
|
player:set_wielded_item(itemstack);--//update inventory of the player
|
|
|
|
end
|
|
|
|
until current_node.name ~= node or height >= 32 --we repeat until we find something else then "scaffolding:scaffolding"
|
|
|
|
--maybe there should be also another limit, because its currently possible to build infinite towers
|
2017-01-11 23:09:10 +01:00
|
|
|
|
2017-01-11 19:58:37 +01:00
|
|
|
end
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-20 15:55:03 +01:00
|
|
|
print("scaffolding: Loading 'functions.lua'")
|
|
|
|
dofile(minetest.get_modpath("scaffolding").."/functions.lua")
|
|
|
|
|
2015-02-20 22:55:13 +01:00
|
|
|
minetest.register_craftitem("scaffolding:scaffolding_wrench", {
|
|
|
|
description = "Scaffolding Wrench",
|
|
|
|
inventory_image = "scaffolding_wrench.png",
|
|
|
|
})
|
|
|
|
|
2015-02-20 15:55:03 +01:00
|
|
|
minetest.register_node("scaffolding:scaffolding", {
|
|
|
|
description = "Wooden Scaffolding",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding.png",
|
|
|
|
"scaffolding_wooden_scaffolding.png", "scaffolding_wooden_scaffolding.png", "scaffolding_wooden_scaffolding.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = true,
|
|
|
|
walkable = false,
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-02-20 22:55:13 +01:00
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:reinforced_scaffolding"
|
|
|
|
minetest.env:set_node(pos, node)
|
2015-02-21 16:07:34 +01:00
|
|
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
2015-02-20 22:55:13 +01:00
|
|
|
end
|
2015-02-21 16:07:34 +01:00
|
|
|
end,
|
2016-10-19 10:14:17 +02:00
|
|
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
2017-01-11 19:58:37 +01:00
|
|
|
-- if user hits scaffolding with platform Wooden scaffolding then --
|
2016-11-01 21:42:19 +01:00
|
|
|
if itemstack:get_name() == "scaffolding:platform" then
|
2017-01-11 19:58:37 +01:00
|
|
|
node = "scaffolding:platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
|
|
|
end
|
|
|
|
-- if user hits scaffolding with platform Iron scaffolding then --
|
|
|
|
if itemstack:get_name() == "scaffolding:iron_platform" then
|
|
|
|
node = "scaffolding:iron_platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
2016-11-01 21:42:19 +01:00
|
|
|
end
|
2017-01-11 13:12:16 +01:00
|
|
|
-- if user hits scaffolding with scaffolding then --
|
2016-10-19 10:14:17 +02:00
|
|
|
if itemstack:get_name() == "scaffolding:scaffolding" then
|
2017-01-11 19:58:37 +01:00
|
|
|
node = "scaffolding:scaffolding";
|
2016-10-19 10:14:17 +02:00
|
|
|
local name = minetest.get_node(pos).name -- get loacation of node
|
2017-01-11 19:58:37 +01:00
|
|
|
buildScaffolding(node, pos, itemstack, player)
|
|
|
|
end
|
|
|
|
end,
|
2015-02-20 15:55:03 +01:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
after_dig_node = function(pos, node, metadata, digger)
|
|
|
|
default.dig_up(pos, node, digger)
|
|
|
|
end,
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-20 22:55:13 +01:00
|
|
|
minetest.register_node("scaffolding:reinforced_scaffolding", {
|
|
|
|
description = "Wooden Scaffolding",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png", "scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png",
|
|
|
|
"scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png"},
|
|
|
|
drop = "scaffolding:scaffolding",
|
|
|
|
paramtype = "light",
|
2017-01-11 13:12:16 +01:00
|
|
|
light_source = 14,
|
2015-02-20 22:55:13 +01:00
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = true,
|
|
|
|
walkable = false,
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:scaffolding"
|
|
|
|
minetest.env:set_node(pos, node)
|
2015-02-21 16:07:34 +01:00
|
|
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
2015-02-20 22:55:13 +01:00
|
|
|
end
|
2015-02-21 16:07:34 +01:00
|
|
|
end,
|
2017-01-11 19:58:37 +01:00
|
|
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
|
|
|
-- if user hits scaffolding with platform Wooden scaffolding then --
|
|
|
|
if itemstack:get_name() == "scaffolding:platform" then
|
|
|
|
node = "scaffolding:platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
2015-02-21 16:07:34 +01:00
|
|
|
end
|
2017-01-11 19:58:37 +01:00
|
|
|
-- if user hits scaffolding with platform Iron scaffolding then --
|
|
|
|
if itemstack:get_name() == "scaffolding:iron_platform" then
|
|
|
|
node = "scaffolding:iron_platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
2015-02-21 16:07:34 +01:00
|
|
|
end
|
2017-01-11 19:58:37 +01:00
|
|
|
end,
|
2015-02-20 22:55:13 +01:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
minetest.register_node("scaffolding:platform", {
|
|
|
|
description = "Wooden Platform",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding.png^scaffolding_platform.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = false,
|
|
|
|
walkable = true,
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:reinforced_platform"
|
|
|
|
minetest.env:set_node(pos, node)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
after_dig_node = function(pos, node, metadata, digger)
|
|
|
|
default.dig_horx(pos, node, digger)
|
|
|
|
default.dig_horx2(pos, node, digger)
|
|
|
|
default.dig_horz(pos, node, digger)
|
|
|
|
default.dig_horz2(pos, node, digger)
|
|
|
|
end,
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
minetest.register_node("scaffolding:reinforced_platform", {
|
|
|
|
description = "Wooden Platform",
|
|
|
|
drawtype = "nodebox",
|
2017-01-11 13:12:16 +01:00
|
|
|
light_source = 14,
|
2015-02-21 16:07:34 +01:00
|
|
|
tiles = {"scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png", "scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png", "scaffolding_wooden_scaffolding.png^scaffolding_platform.png"},
|
|
|
|
drop = "scaffolding:platform",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = false,
|
|
|
|
walkable = true,
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:platform"
|
|
|
|
minetest.env:set_node(pos, node)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
minetest.register_node("scaffolding:iron_scaffolding", {
|
2015-02-20 15:55:03 +01:00
|
|
|
description = "Iron Scaffolding",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding.png",
|
|
|
|
"scaffolding_iron_scaffolding.png", "scaffolding_iron_scaffolding.png", "scaffolding_iron_scaffolding.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = true,
|
2015-02-21 16:07:34 +01:00
|
|
|
walkable = false,
|
2015-02-20 15:55:03 +01:00
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
2015-02-20 22:55:13 +01:00
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:reinforced_iron_scaffolding"
|
|
|
|
minetest.env:set_node(pos, node)
|
2015-02-21 16:07:34 +01:00
|
|
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
2015-02-20 22:55:13 +01:00
|
|
|
end
|
2015-02-21 16:07:34 +01:00
|
|
|
end,
|
2016-10-19 10:14:17 +02:00
|
|
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
2017-01-11 19:58:37 +01:00
|
|
|
-- if user hits scaffolding with platform Iron scaffolding then --
|
2017-01-11 13:12:16 +01:00
|
|
|
if itemstack:get_name() == "scaffolding:iron_platform" then
|
2017-01-11 19:58:37 +01:00
|
|
|
node = "scaffolding:iron_platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
|
|
|
end
|
|
|
|
-- if user hits scaffolding with platform Wooden scaffolding then --
|
|
|
|
if itemstack:get_name() == "scaffolding:platform" then
|
|
|
|
node = "scaffolding:platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
2017-01-11 13:12:16 +01:00
|
|
|
end
|
2017-01-11 19:58:37 +01:00
|
|
|
-- if user hits scaffolding with scaffolding then --
|
2016-10-19 10:14:17 +02:00
|
|
|
if itemstack:get_name() == "scaffolding:iron_scaffolding" then
|
2017-01-11 19:58:37 +01:00
|
|
|
node = "scaffolding:iron_scaffolding";
|
2016-10-19 10:14:17 +02:00
|
|
|
local name = minetest.get_node(pos).name -- get loacation of node
|
2017-01-11 19:58:37 +01:00
|
|
|
buildScaffolding(node, pos, itemstack, player)
|
2015-02-21 16:07:34 +01:00
|
|
|
end
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
end,
|
|
|
|
after_dig_node = function(pos, node, metadata, digger)
|
|
|
|
default.dig_up(pos, node, digger)
|
2015-02-20 15:55:03 +01:00
|
|
|
end,
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-20 22:55:13 +01:00
|
|
|
minetest.register_node("scaffolding:reinforced_iron_scaffolding", {
|
|
|
|
description = "Iron Scaffolding",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_iron_scaffolding.png^scaffolding_reinforced.png", "scaffolding_iron_scaffolding.png^scaffolding_reinforced.png",
|
|
|
|
"scaffolding_iron_scaffolding.png^scaffolding_reinforced.png"},
|
|
|
|
drop = "scaffolding:iron_scaffolding",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = true,
|
2015-02-21 16:07:34 +01:00
|
|
|
walkable = false,
|
2017-01-11 13:12:16 +01:00
|
|
|
light_source = 14,
|
2015-02-20 22:55:13 +01:00
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_punch = function(pos, node, puncher)
|
2015-02-21 16:07:34 +01:00
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:iron_scaffolding"
|
|
|
|
minetest.env:set_node(pos, node)
|
|
|
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
|
|
|
end
|
|
|
|
end,
|
2017-01-11 19:58:37 +01:00
|
|
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
|
|
|
-- if user hits scaffolding with platform Iron scaffolding then --
|
|
|
|
if itemstack:get_name() == "scaffolding:iron_platform" then
|
|
|
|
node = "scaffolding:iron_platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
2015-02-20 22:55:13 +01:00
|
|
|
end
|
2017-01-11 19:58:37 +01:00
|
|
|
-- if user hits scaffolding with platform Wooden scaffolding then --
|
|
|
|
if itemstack:get_name() == "scaffolding:platform" then
|
|
|
|
node = "scaffolding:platform";
|
|
|
|
buildPlatform(node, pos, itemstack)
|
2015-02-21 16:07:34 +01:00
|
|
|
end
|
2017-01-11 19:58:37 +01:00
|
|
|
end,
|
2015-02-20 22:55:13 +01:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
minetest.register_node("scaffolding:iron_platform", {
|
|
|
|
description = "Iron Platform",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding.png^scaffolding_platform.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = false,
|
|
|
|
walkable = true,
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:reinforced_iron_platform"
|
|
|
|
minetest.env:set_node(pos, node)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
after_dig_node = function(pos, node, metadata, digger)
|
|
|
|
default.dig_horx(pos, node, digger)
|
|
|
|
default.dig_horx2(pos, node, digger)
|
|
|
|
default.dig_horz(pos, node, digger)
|
|
|
|
default.dig_horz2(pos, node, digger)
|
|
|
|
end,
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
minetest.register_node("scaffolding:reinforced_iron_platform", {
|
|
|
|
description = "Iron Platform",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {"scaffolding_iron_scaffolding.png^scaffolding_reinforced.png", "scaffolding_iron_scaffolding.png^scaffolding_reinforced.png", "scaffolding_iron_scaffolding.png^scaffolding_platform.png"},
|
|
|
|
drop = "scaffolding:iron_platform",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
climbable = false,
|
|
|
|
walkable = true,
|
2017-01-11 13:12:16 +01:00
|
|
|
light_source = 14,
|
2015-02-21 16:07:34 +01:00
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=2,cracky=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_punch = function(pos, node, puncher)
|
|
|
|
local tool = puncher:get_wielded_item():get_name()
|
|
|
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
|
|
|
node.name = "scaffolding:iron_platform"
|
|
|
|
minetest.env:set_node(pos, node)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.3, -0.5, 0.5, 0.1, 0.5},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2016-10-19 10:14:17 +02:00
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
----------------------
|
|
|
|
-- wood scaffolding --
|
|
|
|
----------------------
|
2015-02-20 15:55:03 +01:00
|
|
|
|
|
|
|
minetest.register_craft({
|
2015-02-20 22:55:13 +01:00
|
|
|
output = 'scaffolding:scaffolding 12',
|
2015-02-20 15:55:03 +01:00
|
|
|
recipe = {
|
|
|
|
{'default:wood', 'default:wood', 'default:wood'},
|
|
|
|
{'default:stick', '', 'default:stick'},
|
|
|
|
{'default:wood', 'default:wood', 'default:wood'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2015-02-20 22:55:13 +01:00
|
|
|
output = 'scaffolding:scaffolding 4',
|
|
|
|
recipe = {
|
|
|
|
{'default:wood'},
|
|
|
|
{'default:stick'},
|
|
|
|
{'default:wood'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2015-02-21 16:07:34 +01:00
|
|
|
-- back to scaffolding --
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:scaffolding',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:platform'},
|
|
|
|
{'scaffolding:platform'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- wood platforms --
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:platform 2',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:scaffolding'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:platform 6',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:scaffolding', 'scaffolding:scaffolding', 'scaffolding:scaffolding'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- get wood back --
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'default:wood',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:scaffolding', 'scaffolding:scaffolding'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
----------------------
|
|
|
|
-- iron scaffolding --
|
|
|
|
----------------------
|
|
|
|
|
2015-02-20 22:55:13 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:iron_scaffolding 12',
|
2015-02-20 15:55:03 +01:00
|
|
|
recipe = {
|
2015-02-21 16:07:34 +01:00
|
|
|
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
|
|
|
{'default:stick', '', 'default:stick'},
|
|
|
|
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
2015-02-20 15:55:03 +01:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2015-02-20 22:55:13 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:iron_scaffolding 4',
|
|
|
|
recipe = {
|
|
|
|
{'default:steel_ingot'},
|
2015-02-21 16:07:34 +01:00
|
|
|
{'default:stick'},
|
|
|
|
{'default:steel_ingot'},
|
2015-02-20 22:55:13 +01:00
|
|
|
}
|
|
|
|
})
|
2015-02-21 16:07:34 +01:00
|
|
|
-- back to scaffolding --
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:iron_scaffolding',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:iron_platform'},
|
|
|
|
{'scaffolding:iron_platform'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- iron platforms --
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:iron_platform 2',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:iron_scaffolding'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:iron_platform 6',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:iron_scaffolding', 'scaffolding:iron_scaffolding', 'scaffolding:iron_scaffolding'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- get iron back --
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'default:steel_ingot',
|
|
|
|
recipe = {
|
|
|
|
{'scaffolding:iron_scaffolding', 'scaffolding:iron_scaffolding'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------
|
|
|
|
-- wrench --
|
|
|
|
------------
|
2015-02-20 22:55:13 +01:00
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'scaffolding:scaffolding_wrench',
|
|
|
|
recipe = {
|
|
|
|
{'', 'default:steel_ingot', ''},
|
|
|
|
{'', 'default:steel_ingot', 'default:steel_ingot'},
|
|
|
|
{'default:steel_ingot', '', ''},
|
|
|
|
}
|
|
|
|
})
|
2020-07-20 02:20:06 +02:00
|
|
|
|
|
|
|
minetest.log("action", "[scaffolding] loaded.")
|