mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
use mcl_util.replace_mob function to simplify dispenser code
This commit is contained in:
parent
463fe2af5f
commit
fe91d7f3e0
1 changed files with 2 additions and 6 deletions
|
@ -203,12 +203,8 @@ local dispenserdef = {
|
|||
else
|
||||
minetest.add_item(droppos, mobs_mc.items.mushroom_red .. " 5")
|
||||
end
|
||||
local oldyaw = obj:get_yaw()
|
||||
obj:remove()
|
||||
local cow = minetest.add_entity(pos, "mobs_mc:cow")
|
||||
cow:set_yaw(oldyaw)
|
||||
obj = cow
|
||||
entity = cow:get_luaentity()
|
||||
obj = mcl_util.replace_mob(obj, "mobs_mc:cow")
|
||||
entity = obj:get_luaentity()
|
||||
used = true
|
||||
end
|
||||
if used then
|
||||
|
|
Loading…
Reference in a new issue