Mod Update to 1.0

This commit is contained in:
Infinatum 2015-02-21 15:07:34 +00:00
parent 2a362d1479
commit a08266f872
3 changed files with 309 additions and 23 deletions

View File

@ -1,4 +1,4 @@
scaffolding_nodenames={"scaffolding:scaffolding"}
scaffolding_nodenames={"scaffolding:scaffolding","scaffolding:iron_scaffolding"}
minetest.register_on_dignode(function(pos, node)
local i=1
@ -15,7 +15,7 @@ minetest.register_on_dignode(function(pos, node)
end
end)
iron_scaffolding_nodenames={"scaffolding:iron_scaffolding"}
iron_scaffolding_nodenames={"scaffolding:platform","scaffolding:iron_platform"}
minetest.register_on_dignode(function(pos, node)
local i=1

328
init.lua
View File

@ -23,10 +23,24 @@ minetest.register_node("scaffolding:scaffolding", {
if tool and tool == "scaffolding:scaffolding_wrench" then
node.name = "scaffolding:reinforced_scaffolding"
minetest.env:set_node(pos, node)
--puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard"))
--puncher:get_inventory():add_item("main", ItemStack("beer_test:tankard_beer"))
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
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 = {
type = "fixed",
fixed = {
@ -43,7 +57,7 @@ minetest.register_node("scaffolding:scaffolding", {
default.dig_up(pos, node, digger)
end,
})
minetest.register_node("scaffolding:reinforced_scaffolding", {
description = "Wooden Scaffolding",
drawtype = "nodebox",
@ -62,10 +76,24 @@ minetest.register_node("scaffolding:reinforced_scaffolding", {
if tool and tool == "scaffolding:scaffolding_wrench" then
node.name = "scaffolding:scaffolding"
minetest.env:set_node(pos, node)
--puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard"))
--puncher:get_inventory():add_item("main", ItemStack("beer_test:tankard_beer"))
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
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 = {
type = "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",
drawtype = "nodebox",
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",
paramtype2 = "facedir",
climbable = true,
walkable = true,
walkable = false,
is_ground_content = true,
groups = {snappy=2,cracky=3},
sounds = default.node_sound_wood_defaults(),
@ -109,13 +208,27 @@ minetest.register_node("scaffolding:iron_scaffolding", {
if tool and tool == "scaffolding:scaffolding_wrench" then
node.name = "scaffolding:reinforced_iron_scaffolding"
minetest.env:set_node(pos, node)
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
end
end,
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,
--[[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:reinforced_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,]]
after_dig_node = function(pos, node, metadata, digger)
default.dig_up(pos, node, digger)
end,
})
@ -128,17 +241,34 @@ minetest.register_node("scaffolding:iron_scaffolding", {
paramtype = "light",
paramtype2 = "facedir",
climbable = true,
walkable = true,
walkable = false,
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_scaffolding"
minetest.env:set_node(pos, node)
puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
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 = {
type = "fixed",
fixed = {
@ -152,6 +282,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({
output = 'scaffolding:scaffolding 12',
@ -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({
output = 'scaffolding:iron_scaffolding 12',
recipe = {
{'default:wood', 'default:wood', 'default:wood'},
{'default:steel_ingot', '', 'default:steel_ingot'},
{'default:wood', 'default:wood', 'default:wood'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:stick', '', 'default:stick'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'scaffolding:iron_scaffolding 4',
recipe = {
{'default:wood'},
{'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({
output = 'scaffolding:scaffolding_wrench',
@ -197,3 +481,5 @@ minetest.register_craft({
{'default:steel_ingot', '', ''},
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB