forked from MineClone5/MineClone5
Merge remote-tracking branch 'origin/master' into testing
This commit is contained in:
commit
3268a94b20
|
@ -821,8 +821,7 @@ function mobs.mob_step(self, dtime)
|
||||||
self.lifetimer = self.lifetimer - dtime
|
self.lifetimer = self.lifetimer - dtime
|
||||||
if self.lifetimer <= 0 then
|
if self.lifetimer <= 0 then
|
||||||
self.lifetimer = self.lifetimer_reset
|
self.lifetimer = self.lifetimer_reset
|
||||||
if not mobs.check_for_player_within_area(self, 64) then
|
if mobs.can_despawn(self) then
|
||||||
--print("removing in MAIN LOGIC!")
|
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -122,7 +122,10 @@ mobs.death_logic = function(self, dtime)
|
||||||
if self.death_animation_timer >= 1.25 then
|
if self.death_animation_timer >= 1.25 then
|
||||||
item_drop(self,false,1)
|
item_drop(self,false,1)
|
||||||
mobs.death_effect(self)
|
mobs.death_effect(self)
|
||||||
mcl_experience.throw_experience(self.object:get_pos(), math_random(self.xp_min, self.xp_max))
|
mcl_experience.throw_experience(self.object:get_pos(), math_random(self.xp_min, self.xp_max))
|
||||||
|
if self.on_die then
|
||||||
|
self.on_die(self, self.object:get_pos())
|
||||||
|
end
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,16 +5,18 @@ local minetest_settings = minetest.settings
|
||||||
-- CMI support check
|
-- CMI support check
|
||||||
local use_cmi = minetest.global_exists("cmi")
|
local use_cmi = minetest.global_exists("cmi")
|
||||||
|
|
||||||
|
mobs.can_despawn = function(self)
|
||||||
|
return (not self.tamed and not self.bred and not self.nametag and
|
||||||
|
not mobs.check_for_player_within_area(self, 64));
|
||||||
|
end
|
||||||
|
|
||||||
-- get entity staticdata
|
-- get entity staticdata
|
||||||
mobs.mob_staticdata = function(self)
|
mobs.mob_staticdata = function(self)
|
||||||
--despawn mechanism
|
--despawn mechanism
|
||||||
--don't despawned tamed or bred mobs
|
--don't despawned tamed or bred mobs
|
||||||
if not self.tamed and not self.bred then
|
if mobs.can_despawn(self) then
|
||||||
if not mobs.check_for_player_within_area(self, 64) then
|
self.object:remove()
|
||||||
--print("removing SERIALIZED!")
|
return
|
||||||
self.object:remove()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.remove_ok = true
|
self.remove_ok = true
|
||||||
|
|
|
@ -257,7 +257,7 @@ minetest.register_tool("mcl_farming:hoe_diamond", {
|
||||||
hoey = { speed = 8, level = 5, uses = 1562 }
|
hoey = { speed = 8, level = 5, uses = 1562 }
|
||||||
},
|
},
|
||||||
_mcl_upgradable = true,
|
_mcl_upgradable = true,
|
||||||
_mcl_upgrade_item = "mcl_tools:hoe_netherite"
|
_mcl_upgrade_item = "mcl_farming:hoe_netherite"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
|
Loading…
Reference in New Issue