2013-05-08 06:23:49 +02:00
|
|
|
minetest.register_node("darkage:chain", {
|
|
|
|
description = "Chain",
|
|
|
|
drawtype = "signlike",
|
|
|
|
tiles = {"darkage_chain.png"},
|
|
|
|
inventory_image = "darkage_chain.png",
|
|
|
|
wield_image = "darkage_chain.png",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "wallmounted",
|
2016-07-10 10:42:04 +02:00
|
|
|
is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
--wall_top = = <default>
|
|
|
|
--wall_bottom = = <default>
|
|
|
|
--wall_side = = <default>
|
|
|
|
},
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = {snappy=1, cracky=2, oddly_breakable_by_hand=2, not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
legacy_wallmounted = true
|
|
|
|
})
|
2017-01-14 07:51:10 +01:00
|
|
|
|
|
|
|
|
2016-07-12 16:24:24 +02:00
|
|
|
local box_formspec = [[
|
|
|
|
size[8,9]
|
|
|
|
list[context;main;0,0.3;8,4;]
|
|
|
|
list[current_player;main;0,4.85;8,1;]
|
|
|
|
list[current_player;main;0,6.08;8,3;8]
|
|
|
|
listring[context;main]
|
|
|
|
listring[current_player;main]
|
|
|
|
]].. darkage.formbg
|
|
|
|
|
2016-07-10 10:42:04 +02:00
|
|
|
minetest.register_node("darkage:box", {
|
2013-05-08 06:23:49 +02:00
|
|
|
description = "Box",
|
2016-07-10 10:42:04 +02:00
|
|
|
tiles = { "darkage_box_top.png","darkage_box_top.png","darkage_box.png"},
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = { snappy = 3, not_cuttable=1 },
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_construct = function(pos)
|
2016-07-01 11:25:16 +02:00
|
|
|
local meta = minetest.get_meta(pos)
|
2016-07-12 16:24:24 +02:00
|
|
|
meta:set_string("formspec", box_formspec )
|
2013-05-08 06:23:49 +02:00
|
|
|
meta:set_string("infotext", "Box")
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
inv:set_size("main", 16)
|
|
|
|
end,
|
|
|
|
can_dig = function(pos,player)
|
2016-07-01 11:25:16 +02:00
|
|
|
local meta = minetest.get_meta(pos);
|
2013-05-08 06:23:49 +02:00
|
|
|
local inv = meta:get_inventory()
|
|
|
|
return inv:is_empty("main")
|
|
|
|
end,
|
|
|
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
|
|
|
minetest.log("action", player:get_player_name()..
|
|
|
|
" moves stuff in box at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
2016-07-10 10:42:04 +02:00
|
|
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
2013-05-08 06:23:49 +02:00
|
|
|
minetest.log("action", player:get_player_name()..
|
|
|
|
" moves stuff to box at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
2016-07-10 10:42:04 +02:00
|
|
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
2013-05-08 06:23:49 +02:00
|
|
|
minetest.log("action", player:get_player_name()..
|
|
|
|
" takes stuff from box at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2016-07-12 16:24:24 +02:00
|
|
|
local shelves_formspec = [[
|
|
|
|
size[8,9]
|
|
|
|
list[context;up;0,0;8,2;]
|
|
|
|
list[context;down;0,2.3;8,2;]
|
|
|
|
|
|
|
|
list[current_player;main;0,4.85;8,1;]
|
|
|
|
list[current_player;main;0,6.08;8,3;8]
|
|
|
|
listring[context;up]
|
|
|
|
listring[context;down]
|
|
|
|
listring[current_player;main]
|
|
|
|
]].. darkage.formbg
|
|
|
|
|
2016-07-10 10:42:04 +02:00
|
|
|
minetest.register_node("darkage:wood_shelves", {
|
2013-05-08 06:23:49 +02:00
|
|
|
description = "Wooden Shelves",
|
2016-07-10 10:42:04 +02:00
|
|
|
tiles = { "darkage_shelves.png","darkage_shelves.png","darkage_shelves.png",
|
|
|
|
"darkage_shelves.png","darkage_shelves.png","darkage_shelves_front.png"},
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = { snappy = 3, not_cuttable=1 },
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_construct = function(pos)
|
2016-07-01 11:25:16 +02:00
|
|
|
local meta = minetest.get_meta(pos)
|
2016-07-12 16:24:24 +02:00
|
|
|
meta:set_string("formspec", shelves_formspec)
|
2013-05-08 06:23:49 +02:00
|
|
|
meta:set_string("infotext", "Wooden Shelves")
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
inv:set_size("up", 16)
|
|
|
|
inv:set_size("down", 16)
|
|
|
|
end,
|
|
|
|
can_dig = function(pos,player)
|
2016-07-01 11:25:16 +02:00
|
|
|
local meta = minetest.get_meta(pos);
|
2013-05-08 06:23:49 +02:00
|
|
|
local inv = meta:get_inventory()
|
2016-07-10 10:42:04 +02:00
|
|
|
return inv:is_empty("up") and inv:is_empty("down")
|
2013-05-08 06:23:49 +02:00
|
|
|
end,
|
|
|
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
|
|
|
minetest.log("action", player:get_player_name()..
|
|
|
|
" moves stuff in shelves at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
2016-07-10 10:42:04 +02:00
|
|
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
2013-05-08 06:23:49 +02:00
|
|
|
minetest.log("action", player:get_player_name()..
|
|
|
|
" moves stuff to shelves at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
2016-07-10 10:42:04 +02:00
|
|
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
2013-05-08 06:23:49 +02:00
|
|
|
minetest.log("action", player:get_player_name()..
|
|
|
|
" takes stuff from shelves at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
--minetest.register_node("darkage:rosace", {
|
|
|
|
-- description = "Rose Window",
|
|
|
|
-- tiles = {"darkage_rosace.png"},
|
2016-07-10 10:42:04 +02:00
|
|
|
-- is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
-- groups = {cracky=3},
|
|
|
|
-- sounds = default.node_sound_stone_defaults()
|
|
|
|
--})
|
|
|
|
|
|
|
|
minetest.register_node("darkage:iron_bars", {
|
|
|
|
description = "Iron Bars",
|
2016-07-10 10:42:04 +02:00
|
|
|
drawtype = "glasslike",
|
2013-05-08 06:23:49 +02:00
|
|
|
tiles = {"darkage_iron_bars.png"},
|
2016-07-10 10:42:04 +02:00
|
|
|
inventory_image = "darkage_iron_bars.png",
|
2013-05-08 06:23:49 +02:00
|
|
|
wield_image = "darkage_iron_bars.png",
|
2016-07-10 10:42:04 +02:00
|
|
|
is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = {cracky=3 , not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_stone_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("darkage:lamp", {
|
|
|
|
description = "Lamp",
|
2016-07-10 10:42:04 +02:00
|
|
|
tiles = { "darkage_lamp.png" },
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2016-07-10 10:42:04 +02:00
|
|
|
light_source = default.LIGHT_MAX-1,
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, flammable=1 , not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("darkage:iron_grille", {
|
|
|
|
description = "Iron Grille",
|
2016-07-10 10:42:04 +02:00
|
|
|
drawtype = "glasslike",
|
2013-05-08 06:23:49 +02:00
|
|
|
tiles = {"darkage_iron_grille.png"},
|
2016-07-10 10:42:04 +02:00
|
|
|
inventory_image = "darkage_iron_grille.png",
|
2013-05-08 06:23:49 +02:00
|
|
|
wield_image = "darkage_iron_grille.png",
|
2016-07-10 10:42:04 +02:00
|
|
|
is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = {cracky=3 , not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_stone_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("darkage:wood_bars", {
|
|
|
|
description = "Wooden Bars",
|
2016-07-10 10:42:04 +02:00
|
|
|
drawtype = "glasslike",
|
2013-05-08 06:23:49 +02:00
|
|
|
tiles = {"darkage_wood_bars.png"},
|
2016-07-10 10:42:04 +02:00
|
|
|
inventory_image = "darkage_wood_bars.png",
|
2013-05-08 06:23:49 +02:00
|
|
|
wield_image = "darkage_wood_bars.png",
|
2016-07-10 10:42:04 +02:00
|
|
|
is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = {snappy=1, choppy=2, not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_stone_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("darkage:wood_grille", {
|
|
|
|
description = "Wooden Grille",
|
2016-07-10 10:42:04 +02:00
|
|
|
drawtype = "glasslike",
|
2013-05-08 06:23:49 +02:00
|
|
|
tiles = {"darkage_wood_grille.png"},
|
2016-07-10 10:42:04 +02:00
|
|
|
inventory_image = "darkage_wood_grille.png",
|
2013-05-08 06:23:49 +02:00
|
|
|
wield_image = "darkage_wood_grille.png",
|
2016-07-10 10:42:04 +02:00
|
|
|
is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2017-01-14 07:51:10 +01:00
|
|
|
groups = {snappy=1, choppy=2, not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_stone_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("darkage:wood_frame", {
|
|
|
|
description = "Wooden Frame",
|
2017-02-23 12:38:35 +01:00
|
|
|
drawtype = "glasslike_framed",
|
2013-05-08 06:23:49 +02:00
|
|
|
tiles = {"darkage_wood_frame.png"},
|
2016-07-10 10:42:04 +02:00
|
|
|
inventory_image = "darkage_wood_frame.png",
|
2013-05-08 06:23:49 +02:00
|
|
|
wield_image = "darkage_wood_frame.png",
|
2016-07-10 10:42:04 +02:00
|
|
|
is_ground_content = false,
|
2013-05-08 06:23:49 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2017-02-22 11:16:56 +01:00
|
|
|
groups = {snappy=1, choppy=2, oddly_breakable_by_hand = 3, not_cuttable=1},
|
2013-05-08 06:23:49 +02:00
|
|
|
sounds = default.node_sound_stone_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
---------------
|
|
|
|
-- Crafts Item
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
|
|
----------
|
|
|
|
-- Crafts
|
|
|
|
----------
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:box",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"default:wood", "", "default:wood"},
|
|
|
|
{"", "", ""},
|
|
|
|
{"default:wood", "", "default:wood"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2016-07-10 10:42:04 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "darkage:chain 2",
|
|
|
|
recipe = {
|
|
|
|
{"darkage:iron_stick"},
|
|
|
|
{"darkage:iron_stick"},
|
|
|
|
{"darkage:iron_stick"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:iron_bars 2",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"darkage:iron_stick", "", "darkage:iron_stick"},
|
|
|
|
{"darkage:iron_stick", "", "darkage:iron_stick"},
|
|
|
|
{"darkage:iron_stick", "", "darkage:iron_stick"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:iron_grille 3",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"", "darkage:iron_bars", ""},
|
|
|
|
{"darkage:iron_bars", "", "darkage:iron_bars"},
|
|
|
|
{"", "darkage:iron_bars", ""},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:lamp",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"group:stick", "", "group:stick"},
|
|
|
|
{"", "default:torch", ""},
|
|
|
|
{"group:stick", "", "group:stick"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:wood_bars 2",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"group:stick", "", "group:stick"},
|
|
|
|
{"group:stick", "", "group:stick"},
|
|
|
|
{"group:stick", "", "group:stick"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:wood_grille 3",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"", "darkage:wood_bars", ""},
|
|
|
|
{"darkage:wood_bars", "", "darkage:wood_bars"},
|
|
|
|
{"", "darkage:wood_bars", ""},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:wood_shelves",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"darkage:box"},
|
|
|
|
{"darkage:box"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-07-10 10:42:04 +02:00
|
|
|
output = "darkage:wood_frame",
|
2013-05-08 06:23:49 +02:00
|
|
|
recipe = {
|
2016-07-10 10:42:04 +02:00
|
|
|
{"group:stick", "", "group:stick"},
|
|
|
|
{"", "default:glass", ""},
|
|
|
|
{"group:stick", "", "group:stick"},
|
2013-05-08 06:23:49 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
-- Cookings
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:glass",
|
|
|
|
recipe = "darkage:wood_frame",
|
|
|
|
})
|
|
|
|
|
|
|
|
|