forked from VoxeLibre/VoxeLibre
Balance player velocity added knockbacks from catapulting mobs
This commit is contained in:
parent
0fbfe99c1d
commit
e0bd5e7f33
|
@ -725,7 +725,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
||||||
local mob_mag = math.sqrt((v.x * v.x) + (v.z * v.z))
|
local mob_mag = math.sqrt((v.x * v.x) + (v.z * v.z))
|
||||||
kb = kb + 9 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
kb = kb + 9 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||||
-- add player velocity to mob knockback
|
-- add player velocity to mob knockback
|
||||||
if dir_dot > 0 and mob_mag <= player_mag * 0.8 then
|
if dir_dot > 0 and mob_mag <= player_mag * 0.625 then
|
||||||
kb = kb + ((math.abs(hv.x) + math.abs(hv.z)) * r)
|
kb = kb + ((math.abs(hv.x) + math.abs(hv.z)) * r)
|
||||||
end
|
end
|
||||||
elseif luaentity and luaentity._knockback then
|
elseif luaentity and luaentity._knockback then
|
||||||
|
|
Loading…
Reference in New Issue