mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-04 08:43:45 +01:00
Stop wither from shooting itself
This commit is contained in:
parent
e20da5d2d4
commit
3da82d89b7
@ -413,8 +413,10 @@ function mcl_mobs.register_arrow(name, def)
|
|||||||
ignore_gravity = true,
|
ignore_gravity = true,
|
||||||
damages_players = true,
|
damages_players = true,
|
||||||
allow_punching = function(self, entity_def, projectile_def, object)
|
allow_punching = function(self, entity_def, projectile_def, object)
|
||||||
|
if def.allow_punching and not def.allow_punching(self, entity_def, projectile_def, object) then return false end
|
||||||
if self.timer > 2 then return true end
|
if self.timer > 2 then return true end
|
||||||
if self._owner and object == self._owner.object then return false end
|
if self._owner and object == self._owner.object then return false end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
on_collide_with_solid = function(self, pos, node, nodedef)
|
on_collide_with_solid = function(self, pos, node, nodedef)
|
||||||
|
@ -466,6 +466,9 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", {
|
|||||||
rotate = 90,
|
rotate = 90,
|
||||||
_lifetime = 15,
|
_lifetime = 15,
|
||||||
on_punch = function(self) end,
|
on_punch = function(self) end,
|
||||||
|
allow_punching = function(self, _, _, object)
|
||||||
|
return object:get_luaentity().name ~= "mobs_mc:wither"
|
||||||
|
end,
|
||||||
|
|
||||||
-- direct hit
|
-- direct hit
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
@ -519,6 +522,9 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull_strong", {
|
|||||||
rotate = 90,
|
rotate = 90,
|
||||||
_lifetime = 25,
|
_lifetime = 25,
|
||||||
on_punch = function(self) end,
|
on_punch = function(self) end,
|
||||||
|
allow_punching = function(self, _, _, object)
|
||||||
|
return object:get_luaentity().name ~= "mobs_mc:wither"
|
||||||
|
end,
|
||||||
|
|
||||||
-- direct hit
|
-- direct hit
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
|
Loading…
Reference in New Issue
Block a user