mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Fix generated mob spawners sometimes have pig
This commit is contained in:
parent
9bae398946
commit
3845369237
1 changed files with 14 additions and 1 deletions
|
@ -214,7 +214,20 @@ minetest.register_node("mcl_mobspawners:spawner", {
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
drop = "",
|
drop = "",
|
||||||
|
|
||||||
on_construct = mcl_mobspawners.setup_spawner,
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
local node_under = minetest.get_node(pointed_thing.under)
|
||||||
|
local new_itemstack, success = minetest.item_place(itemstack, placer, pointed_thing)
|
||||||
|
if success then
|
||||||
|
local placepos
|
||||||
|
if minetest.registered_nodes[node_under.name].buildable_to then
|
||||||
|
placepos = pointed_thing.under
|
||||||
|
else
|
||||||
|
placepos = pointed_thing.above
|
||||||
|
end
|
||||||
|
mcl_mobspawners.setup_spawner(placepos)
|
||||||
|
end
|
||||||
|
return new_itemstack
|
||||||
|
end,
|
||||||
|
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
Loading…
Reference in a new issue