summaryrefslogtreecommitdiff
path: root/iron_chest.lua
diff options
context:
space:
mode:
authorMaciej Kasatkin <mk@realbadangel.pl>2012-10-09 11:02:29 +0200
committerMaciej Kasatkin <mk@realbadangel.pl>2012-10-09 11:02:29 +0200
commiteabde42244a4f541c13ee8f39b3542fb26d8af9b (patch)
treece8d367f434ce0d3a8684227396a460529a21efc /iron_chest.lua
parentef174a7deeb362e8519b25b09c7cf45730468d24 (diff)
several fixes, brass added
Diffstat (limited to 'iron_chest.lua')
-rw-r--r--iron_chest.lua26
1 files changed, 25 insertions, 1 deletions
diff --git a/iron_chest.lua b/iron_chest.lua
index 1a89ed3..b6685b2 100644
--- a/iron_chest.lua
+++ b/iron_chest.lua
@@ -6,6 +6,16 @@ minetest.register_craft({
{'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
}
})
+
+minetest.register_craft({
+ output = 'technic:iron_locked_chest 1',
+ recipe = {
+ {'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
+ {'default:steel_ingot','default:locked_chest','default:steel_ingot'},
+ {'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
+ }
+})
+
minetest.register_craft({
output = 'technic:iron_locked_chest 1',
recipe = {
@@ -24,6 +34,8 @@ minetest.register_craftitem("technic:iron_locked_chest", {
stack_max = 99,
})
+minetest.register_alias("blabla", "technic:iron_chest")
+
minetest.register_node("technic:iron_chest", {
description = "Iron Chest",
tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
@@ -32,7 +44,6 @@ minetest.register_node("technic:iron_chest", {
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
-
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
@@ -43,6 +54,15 @@ minetest.register_node("technic:iron_chest", {
local inv = meta:get_inventory()
inv:set_size("main", 9*4)
end,
+
+ after_place_node = function(pos, placer)
+ ntop1 = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z})
+ ntop = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z})
+ if ntop.name ~= "air" then
+ minetest.node_dig(pos, ntop1, placer)
+ end
+ end,
+
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
@@ -150,3 +170,7 @@ on_construct = function(pos)
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
end,
})
+
+function add_item (player)
+player:get_inventory():add_item("main", "blabla 1")
+end \ No newline at end of file