forked from VoxeLibre/VoxeLibre
Merge pull request 'Check protection on dragon egg punch (#2127)' (#2129) from enderdragon_egg_fix into master
Reviewed-on: MineClone2/MineClone2#2129 Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
commit
0c03d420b8
|
@ -166,11 +166,12 @@ minetest.register_node("mcl_end:dragon_egg", {
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "regular",
|
type = "regular",
|
||||||
},
|
},
|
||||||
groups = {handy=1, falling_node = 1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1 },
|
groups = {handy = 1, falling_node = 1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1 },
|
||||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
_mcl_blast_resistance = 9,
|
_mcl_blast_resistance = 9,
|
||||||
_mcl_hardness = 3,
|
_mcl_hardness = 3,
|
||||||
on_punch = function(pos, node)
|
on_punch = function(pos, node, puncher)
|
||||||
|
if not minetest.is_protected(pos, puncher:get_player_name()) then
|
||||||
local max_dist = vector.new(15, 7, 15)
|
local max_dist = vector.new(15, 7, 15)
|
||||||
local positions = minetest.find_nodes_in_area(vector.subtract(pos, max_dist), vector.add(pos, max_dist), "air", false)
|
local positions = minetest.find_nodes_in_area(vector.subtract(pos, max_dist), vector.add(pos, max_dist), "air", false)
|
||||||
if #positions > 0 then
|
if #positions > 0 then
|
||||||
|
@ -179,6 +180,7 @@ minetest.register_node("mcl_end:dragon_egg", {
|
||||||
minetest.set_node(tpos, node)
|
minetest.set_node(tpos, node)
|
||||||
minetest.check_for_falling(tpos)
|
minetest.check_for_falling(tpos)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue