Merge pull request 'Fix endermite and bats' (#1604) from jordan4ibanez/MineClone2:mineclone5 into mineclone5

Reviewed-on: MineClone2/MineClone2#1604
This commit is contained in:
jordan4ibanez 2021-04-23 01:46:55 +00:00
commit f00652f050
3 changed files with 5 additions and 40 deletions

View File

@ -2758,45 +2758,7 @@ function do_states(self)
end end
mobs.death_effect = function(pos, yaw, collisionbox, rotate)
local min, max
if collisionbox then
min = {x=collisionbox[1], y=collisionbox[2], z=collisionbox[3]}
max = {x=collisionbox[4], y=collisionbox[5], z=collisionbox[6]}
else
min = { x = -0.5, y = 0, z = -0.5 }
max = { x = 0.5, y = 0.5, z = 0.5 }
end
if rotate then
min = vector.rotate(min, {x=0, y=yaw, z=math_pi/2})
max = vector.rotate(max, {x=0, y=yaw, z=math_pi/2})
min, max = vector.sort(min, max)
min = vector.multiply(min, 0.5)
max = vector.multiply(max, 0.5)
end
minetest_add_particlespawner({
amount = 50,
time = 0.001,
minpos = vector.add(pos, min),
maxpos = vector.add(pos, max),
minvel = vector.new(-5,-5,-5),
maxvel = vector.new(5,5,5),
minexptime = 1.1,
maxexptime = 1.5,
minsize = 1,
maxsize = 2,
collisiondetection = false,
vertical = false,
texture = "mcl_particles_mob_death.png^[colorize:#000000:255",
})
minetest_sound_play("mcl_mobs_mob_poof", {
pos = pos,
gain = 1.0,
max_hear_distance = 8,
}, true)
end
-- above function exported for mount.lua -- above function exported for mount.lua
function mobs:set_animation(self, anim) function mobs:set_animation(self, anim)

View File

@ -7,6 +7,9 @@ mobs:register_mob("mobs_mc:bat", {
spawn_class = "ambient", spawn_class = "ambient",
can_despawn = true, can_despawn = true,
passive = true, passive = true,
rotate = 270,
tilt_fly = true,
fly = true,
hp_min = 6, hp_min = 6,
hp_max = 6, hp_max = 6,
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25}, collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
@ -44,9 +47,7 @@ mobs:register_mob("mobs_mc:bat", {
fall_damage = 0, fall_damage = 0,
view_range = 16, view_range = 16,
fear_height = 0, fear_height = 0,
jump = false, jump = false,
fly = true,
makes_footstep_sound = false, makes_footstep_sound = false,
}) })

View File

@ -8,6 +8,8 @@ mobs:register_mob("mobs_mc:endermite", {
type = "monster", type = "monster",
spawn_class = "hostile", spawn_class = "hostile",
passive = false, passive = false,
rotate = 270,
hostile = true,
hp_min = 8, hp_min = 8,
hp_max = 8, hp_max = 8,
xp_min = 3, xp_min = 3,