Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_node("protection_chest:chest", {
- description = "Protection Chest",
- tiles = {
- "default_chest_top.png",
- "default_chest_top.png",
- "default_chest_side.png",
- "default_chest_side.png",
- "default_chest_lock.png",
- "default_chest_inside.png"
- },
- sounds = default.node_sound_wood_defaults(),
- groups = {choppy = 2, oddly_breakable_by_hand = 2},
- on_construct = function(pos)
- local meta = minetest.get_meta(pos)
- meta:set_string("infotext", "Protection Chest")
- meta:set_string("owner", "")
- local inv = meta:get_inventory()
- inv:set_size("main", 8*4)
- end
- -- after_place_node = function(pos, placer)
- -- local meta = minetest.get_meta(pos)
- -- meta:set_string("owner", placer:get_player_name() or "")
- -- meta:set_string("infotext", "Protection Chest (placed by " ..
- -- meta:get_string("owner") .. ")")
- -- end
- can_dig = function(pos,player)
- local meta = minetest.get_meta(pos);
- local inv = meta:get_inventory()
- return inv:is_empty("main")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement