Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.44 KB | None | 0 0
  1. minetest.register_node("protection_chest:chest", {
  2.  
  3. description = "Protection Chest",
  4.         tiles = {
  5.                 "default_chest_top.png",
  6.                 "default_chest_top.png",
  7.                 "default_chest_side.png",
  8.                 "default_chest_side.png",
  9.                 "default_chest_lock.png",
  10.                 "default_chest_inside.png"
  11.         },
  12.         sounds = default.node_sound_wood_defaults(),
  13.         groups = {choppy = 2, oddly_breakable_by_hand = 2},
  14.  
  15. on_construct = function(pos)
  16.                         local meta = minetest.get_meta(pos)
  17.                         meta:set_string("infotext", "Protection Chest")
  18.                         meta:set_string("owner", "")
  19.                         local inv = meta:get_inventory()
  20.                         inv:set_size("main", 8*4)
  21.                 end
  22. --                after_place_node = function(pos, placer)
  23. --                        local meta = minetest.get_meta(pos)
  24. --                        meta:set_string("owner", placer:get_player_name() or "")
  25. --                        meta:set_string("infotext", "Protection Chest (placed by " ..
  26. --                                        meta:get_string("owner") .. ")")
  27. --                end
  28.                 can_dig = function(pos,player)
  29.                         local meta = minetest.get_meta(pos);
  30.                         local inv = meta:get_inventory()
  31.                         return inv:is_empty("main")
  32.                 end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement