mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
Merge pull request 'Mobs fixes' (#3032) from mobs_cleanup into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3032
This commit is contained in:
commit
c4808beef4
@ -754,7 +754,7 @@ function mob_class:check_herd(dtime)
|
||||
y = o:get_yaw()
|
||||
end
|
||||
if p then
|
||||
go_to_pos(self,p)
|
||||
self:go_to_pos(p)
|
||||
elseif y then
|
||||
self:set_yaw(y)
|
||||
end
|
||||
|
@ -441,7 +441,7 @@ local horse = {
|
||||
|
||||
on_breed = function(parent1, parent2)
|
||||
local pos = parent1.object:get_pos()
|
||||
local child = mcl_mobs:spawn_child(pos, parent1.name)
|
||||
local child = mcl_mobs.spawn_child(pos, parent1.name)
|
||||
if child then
|
||||
local ent_c = child:get_luaentity()
|
||||
local p = math.random(1, 2)
|
||||
|
@ -221,7 +221,7 @@ mcl_mobs.register_mob("mobs_mc:llama", {
|
||||
else
|
||||
parent = parent2
|
||||
end
|
||||
child = mcl_mobs:spawn_child(pos, parent.name)
|
||||
child = mcl_mobs.spawn_child(pos, parent.name)
|
||||
if child then
|
||||
local ent_c = child:get_luaentity()
|
||||
ent_c.base_texture = table.copy(ent_c.base_texture)
|
||||
|
@ -186,7 +186,7 @@ mcl_mobs.register_mob("mobs_mc:pig", {
|
||||
|
||||
on_breed = function(parent1, parent2)
|
||||
local pos = parent1.object:get_pos()
|
||||
local child = mcl_mobs:spawn_child(pos, parent1.name)
|
||||
local child = mcl_mobs.spawn_child(pos, parent1.name)
|
||||
if child then
|
||||
local ent_c = child:get_luaentity()
|
||||
ent_c.tamed = true
|
||||
|
@ -267,7 +267,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
|
||||
on_breed = function(parent1, parent2)
|
||||
-- Breed sheep and choose a fur color for the child.
|
||||
local pos = parent1.object:get_pos()
|
||||
local child = mcl_mobs:spawn_child(pos, parent1.name)
|
||||
local child = mcl_mobs.spawn_child(pos, parent1.name)
|
||||
if child then
|
||||
local ent_c = child:get_luaentity()
|
||||
local color1 = parent1.color
|
||||
|
@ -141,7 +141,7 @@ local function egg_on_step(self, dtime)
|
||||
local r = math.random(1,8)
|
||||
|
||||
if r == 1 then
|
||||
mcl_mobs:spawn_child(self._lastpos, "mobs_mc:chicken")
|
||||
mcl_mobs.spawn_child(self._lastpos, "mobs_mc:chicken")
|
||||
|
||||
-- BONUS ROUND: 1/32 chance to spawn 3 additional chicks
|
||||
local r = math.random(1,32)
|
||||
@ -153,7 +153,7 @@ local function egg_on_step(self, dtime)
|
||||
}
|
||||
for o=1, 3 do
|
||||
local pos = vector.add(self._lastpos, offsets[o])
|
||||
mcl_mobs:spawn_child(pos, "mobs_mc:chicken")
|
||||
mcl_mobs.spawn_child(pos, "mobs_mc:chicken")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user