mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
Fix generated mob spawners sometimes have pig
This commit is contained in:
parent
9bae398946
commit
3845369237
@ -214,7 +214,20 @@ minetest.register_node("mcl_mobspawners:spawner", {
|
||||
is_ground_content = false,
|
||||
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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
Loading…
Reference in New Issue
Block a user