From ba62febdee197f4367ca193049a597ace509a1c3 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Wed, 8 Feb 2017 20:57:42 +0000 Subject: [PATCH] Armor stand, check protection and ignore, ignore --- 3d_armor_stand/init.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/3d_armor_stand/init.lua b/3d_armor_stand/init.lua index d3463ca..1b8cff8 100644 --- a/3d_armor_stand/init.lua +++ b/3d_armor_stand/init.lua @@ -98,10 +98,11 @@ local function has_locked_armor_stand_privilege(meta, player) return true end -local function add_hidden_node(pos) +local function add_hidden_node(pos, player) local p = {x=pos.x, y=pos.y + 1, z=pos.z} + local name = player:get_player_name() local node = minetest.get_node(p) - if node.name == "air" or node.name == "ignore" then + if node.name == "air" and not minetest.is_protected(pos, name) then minetest.set_node(p, {name="3d_armor_stand:top"}) end end @@ -162,9 +163,9 @@ minetest.register_node("3d_armor_stand:armor_stand", { end return true end, - after_place_node = function(pos) + after_place_node = function(pos, placer) minetest.add_entity(pos, "3d_armor_stand:armor_entity") - add_hidden_node(pos) + add_hidden_node(pos, placer) end, allow_metadata_inventory_put = function(pos, listname, index, stack) local def = stack:get_definition() or {} @@ -238,7 +239,7 @@ minetest.register_node("3d_armor_stand:locked_armor_stand", { meta:set_string("owner", placer:get_player_name() or "") meta:set_string("infotext", "Armor Stand (owned by " .. meta:get_string("owner") .. ")") - add_hidden_node(pos) + add_hidden_node(pos, placer) end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos)