mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-09 01:10:20 +01:00
add replace sound, tweak spawn egg y_pos
This commit is contained in:
parent
e9c3d6c505
commit
627d468b9a
18
api.lua
18
api.lua
@ -18,7 +18,7 @@ end
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20241020",
|
version = "20241028",
|
||||||
spawning_mobs = {},
|
spawning_mobs = {},
|
||||||
translate = S,
|
translate = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
@ -1437,6 +1437,8 @@ function mob_class:replace(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.set_node(pos, {name = with})
|
minetest.set_node(pos, {name = with})
|
||||||
|
|
||||||
|
self:mob_sound(self.sounds.replace)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -4248,7 +4250,12 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
pos.y = pos.y + 1
|
-- get mob collisionbox and determine how high up to spawn
|
||||||
|
local _mob = minetest.registered_entities[mob]
|
||||||
|
local _prop = _mob and _mob.initial_properties or {}
|
||||||
|
local _y = _prop and -_prop.collisionbox[2] or 1
|
||||||
|
|
||||||
|
pos.y = pos.y + _y--1
|
||||||
|
|
||||||
local data = itemstack:get_metadata()
|
local data = itemstack:get_metadata()
|
||||||
local smob = minetest.add_entity(pos, mob, data)
|
local smob = minetest.add_entity(pos, mob, data)
|
||||||
@ -4304,7 +4311,12 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
pos.y = pos.y + 1
|
-- get mob collisionbox and determine how high up to spawn
|
||||||
|
local _mob = minetest.registered_entities[mob]
|
||||||
|
local _prop = _mob and _mob.initial_properties or {}
|
||||||
|
local _y = _prop and -_prop.collisionbox[2] or 1
|
||||||
|
|
||||||
|
pos.y = pos.y + _y--1
|
||||||
|
|
||||||
local smob = minetest.add_entity(pos, mob)
|
local smob = minetest.add_entity(pos, mob)
|
||||||
local ent = smob and smob:get_luaentity()
|
local ent = smob and smob:get_luaentity()
|
||||||
|
Loading…
Reference in New Issue
Block a user