mirror of
https://bitbucket.org/Infinatum/scaffolding.git
synced 2025-01-10 00:50:18 +01:00
Mod Update to 1.0
This commit is contained in:
parent
2a362d1479
commit
a08266f872
@ -1,4 +1,4 @@
|
|||||||
scaffolding_nodenames={"scaffolding:scaffolding"}
|
scaffolding_nodenames={"scaffolding:scaffolding","scaffolding:iron_scaffolding"}
|
||||||
|
|
||||||
minetest.register_on_dignode(function(pos, node)
|
minetest.register_on_dignode(function(pos, node)
|
||||||
local i=1
|
local i=1
|
||||||
@ -15,7 +15,7 @@ minetest.register_on_dignode(function(pos, node)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
iron_scaffolding_nodenames={"scaffolding:iron_scaffolding"}
|
iron_scaffolding_nodenames={"scaffolding:platform","scaffolding:iron_platform"}
|
||||||
|
|
||||||
minetest.register_on_dignode(function(pos, node)
|
minetest.register_on_dignode(function(pos, node)
|
||||||
local i=1
|
local i=1
|
||||||
|
320
init.lua
320
init.lua
@ -23,10 +23,24 @@ minetest.register_node("scaffolding:scaffolding", {
|
|||||||
if tool and tool == "scaffolding:scaffolding_wrench" then
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
node.name = "scaffolding:reinforced_scaffolding"
|
node.name = "scaffolding:reinforced_scaffolding"
|
||||||
minetest.env:set_node(pos, node)
|
minetest.env:set_node(pos, node)
|
||||||
--puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard"))
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
--puncher:get_inventory():add_item("main", ItemStack("beer_test:tankard_beer"))
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
--[[on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||||
|
if itemstack:get_name() == "scaffolding:scaffolding_wrench" then
|
||||||
|
node.name = "scaffolding:reinforced_scaffolding"
|
||||||
|
minetest.env:set_node(pos, node)
|
||||||
|
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_punch = function(pos, node, puncher)
|
||||||
|
local tool = puncher:get_wielded_item():get_name()
|
||||||
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
|
node.name = "air"
|
||||||
|
minetest.env:set_node(pos, node)
|
||||||
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
|
end
|
||||||
|
end,]]
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -62,10 +76,24 @@ minetest.register_node("scaffolding:reinforced_scaffolding", {
|
|||||||
if tool and tool == "scaffolding:scaffolding_wrench" then
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
node.name = "scaffolding:scaffolding"
|
node.name = "scaffolding:scaffolding"
|
||||||
minetest.env:set_node(pos, node)
|
minetest.env:set_node(pos, node)
|
||||||
--puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard"))
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
--puncher:get_inventory():add_item("main", ItemStack("beer_test:tankard_beer"))
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
--[[ on_rightclick = 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)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_punch = function(pos, node, puncher)
|
||||||
|
local tool = puncher:get_wielded_item():get_name()
|
||||||
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
|
node.name = "air"
|
||||||
|
minetest.env:set_node(pos, node)
|
||||||
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
|
end
|
||||||
|
end,]]
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -80,7 +108,78 @@ minetest.register_node("scaffolding:reinforced_scaffolding", {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("scaffolding:iron_scaffolding", {
|
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,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("scaffolding:reinforced_platform", {
|
||||||
|
description = "Wooden Platform",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
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},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("scaffolding:iron_scaffolding", {
|
||||||
description = "Iron Scaffolding",
|
description = "Iron Scaffolding",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {"scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding.png",
|
tiles = {"scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding.png",
|
||||||
@ -88,7 +187,7 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
climbable = true,
|
climbable = true,
|
||||||
walkable = true,
|
walkable = false,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {snappy=2,cracky=3},
|
groups = {snappy=2,cracky=3},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
@ -109,13 +208,27 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||||||
if tool and tool == "scaffolding:scaffolding_wrench" then
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
node.name = "scaffolding:reinforced_iron_scaffolding"
|
node.name = "scaffolding:reinforced_iron_scaffolding"
|
||||||
minetest.env:set_node(pos, node)
|
minetest.env:set_node(pos, node)
|
||||||
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
after_dig_node = function(pos, node, metadata, digger)
|
--[[on_rightclick = function(pos, node, puncher)
|
||||||
default.dig_horx(pos, node, digger)
|
local tool = puncher:get_wielded_item():get_name()
|
||||||
default.dig_horx2(pos, node, digger)
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
default.dig_horz(pos, node, digger)
|
node.name = "scaffolding:reinforced_iron_scaffolding"
|
||||||
default.dig_horz2(pos, node, digger)
|
minetest.env:set_node(pos, node)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_punch = function(pos, node, puncher)
|
||||||
|
local tool = puncher:get_wielded_item():get_name()
|
||||||
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
|
node.name = "air"
|
||||||
|
minetest.env:set_node(pos, node)
|
||||||
|
--puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard"))
|
||||||
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
|
end
|
||||||
|
end,]]
|
||||||
|
after_dig_node = function(pos, node, metadata, digger)
|
||||||
|
default.dig_up(pos, node, digger)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -128,7 +241,7 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
climbable = true,
|
climbable = true,
|
||||||
walkable = true,
|
walkable = false,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {snappy=2,cracky=3},
|
groups = {snappy=2,cracky=3},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
@ -137,8 +250,25 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||||||
if tool and tool == "scaffolding:scaffolding_wrench" then
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
node.name = "scaffolding:iron_scaffolding"
|
node.name = "scaffolding:iron_scaffolding"
|
||||||
minetest.env:set_node(pos, node)
|
minetest.env:set_node(pos, node)
|
||||||
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
--[[on_rightclick = function(pos, node, puncher)
|
||||||
|
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)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_punch = function(pos, node, puncher)
|
||||||
|
local tool = puncher:get_wielded_item():get_name()
|
||||||
|
if tool and tool == "scaffolding:scaffolding_wrench" then
|
||||||
|
node.name = "air"
|
||||||
|
minetest.env:set_node(pos, node)
|
||||||
|
--puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard"))
|
||||||
|
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
|
||||||
|
end
|
||||||
|
end,]]
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -153,6 +283,81 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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,
|
||||||
|
})
|
||||||
|
|
||||||
|
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,
|
||||||
|
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},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
-- wood scaffolding --
|
||||||
|
----------------------
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'scaffolding:scaffolding 12',
|
output = 'scaffolding:scaffolding 12',
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -171,23 +376,102 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- 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 --
|
||||||
|
----------------------
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'scaffolding:iron_scaffolding 12',
|
output = 'scaffolding:iron_scaffolding 12',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
{'default:stick', '', 'default:stick'},
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'scaffolding:iron_scaffolding 4',
|
output = 'scaffolding:iron_scaffolding 4',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood'},
|
|
||||||
{'default:steel_ingot'},
|
{'default:steel_ingot'},
|
||||||
{'default:wood'},
|
{'default:stick'},
|
||||||
|
{'default:steel_ingot'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
-- 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 --
|
||||||
|
------------
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'scaffolding:scaffolding_wrench',
|
output = 'scaffolding:scaffolding_wrench',
|
||||||
@ -197,3 +481,5 @@ minetest.register_craft({
|
|||||||
{'default:steel_ingot', '', ''},
|
{'default:steel_ingot', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
BIN
textures/scaffolding_platform.png
Normal file
BIN
textures/scaffolding_platform.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in New Issue
Block a user