1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-05 18:10:26 +01:00

added more unbreakable nodes by creeper explosion

added default:obsidian_cooled, default:obsidianbrick, more_chests:x (exclued wifi) in unbreakable nodes by creeper explosion
and fix global var
This commit is contained in:
crabman77 2015-04-03 00:02:03 +02:00
parent 27b925f996
commit d9c671e10c

View File

@ -627,17 +627,20 @@ function mobs:register_mob(name, def)
if x*x+y*y+z*z <= 3 * 3 + 3 then
local np={x=pos.x+x,y=pos.y+y,z=pos.z+z}
local n = minetest.get_node(np)
if n.name ~= "air" and n.name ~= "doors:door_steel_b_1" and n.name ~= "doors:door_steel_t_1"
and n.name ~= "doors:door_steel_b_2" and n.name ~= "doors:door_steel_t_2"
and n.name ~= "default:chest_locked" and n.name ~= "default:obsidian" and n.name ~= "default:bedrock"
if n.name ~= "air" and n.name ~= "doors:door_steel_b_1" and n.name ~= "doors:door_steel_t_1"
and n.name ~= "doors:door_steel_b_2" and n.name ~= "doors:door_steel_t_2"
and n.name ~= "default:chest_locked" and n.name ~= "default:obsidian" and n.name ~= "default:obsidian_cooled"
and n.name ~= "default:obsidianbrick" and n.name ~= "default:bedrock"
and n.name ~= "more_chests:cobble" and n.name ~= "more_chests:shared" and n.name ~= "more_chests:secret"
and n.name ~= "more_chests:dropbox" and n.name ~= "chesttools:shared_chest"
and minetest.get_item_group(n.name, "unbreakable") ~= 1 and next(areas:getAreasAtPos(np)) == nil then
--activate_if_tnt(n.name, np, pos, 3) -- Pas de module TNT sur le serveur donc inutile
if n.name == "default:chest" then
meta = minetest.get_meta(np)
inv = meta:get_inventory()
local inv = meta:get_inventory()
for i = 1,32 do
m_stack = inv:get_stack("main",i)
obj = minetest.add_item(pos,m_stack)
local m_stack = inv:get_stack("main",i)
local obj = minetest.add_item(pos,m_stack)
if obj then
obj:setvelocity({x=math.random(-2,2), y=7, z=math.random(-2,2)})
end