Browse Source

Fixed some forgotten checks for protections

master
npx 6 years ago
parent
commit
c044ff294b
  1. 3
      darts.lua
  2. 5
      nssm_materials.lua
  3. 3
      rainbow_staff.lua

3
darts.lua

@ -22,6 +22,9 @@ mobs:register_arrow("nssm:duck_father", { @@ -22,6 +22,9 @@ mobs:register_arrow("nssm:duck_father", {
})
function duck_explosion(pos)
if minetest.is_protected(pos, "") then
return
end
pos.y = pos.y+1;
minetest.add_particlespawner({
amount = 10,

5
nssm_materials.lua

@ -381,6 +381,9 @@ minetest.register_abm({ @@ -381,6 +381,9 @@ minetest.register_abm({
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.is_protected(pos, "") then
return
end
--local under = {x=pos.x, y=pos.y-1, z=pos.z}
--local n = minetest.env:get_node(under).name
--if n~= "air" then
@ -485,7 +488,7 @@ minetest.register_tool('nssm:sun_sword', { @@ -485,7 +488,7 @@ minetest.register_tool('nssm:sun_sword', {
},
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
if puncher:get_wielded_item():get_name() == 'nssm:sun_sword' then
if node.name ~= "air" then
if node.name ~= "air" and not minetest.is_protected(pos, "") then
minetest.add_node(pointed_thing.above, {name = "fire:basic_flame"})
end
end

3
rainbow_staff.lua

@ -4,6 +4,9 @@ minetest.register_entity("nssm:rainbow", { @@ -4,6 +4,9 @@ minetest.register_entity("nssm:rainbow", {
velocity = 10,
on_step = function (self, pos, node, dtime)
local pos = self.object:getpos()
if minetest.is_protected(pos, "") then
return
end
local n = minetest.env:get_node(pos).name
if n ~= "default:nyancat_rainbow" then
if n=="air" then

Loading…
Cancel
Save