Fix clan-mates and allies being able to force despawn mounts
This commit is contained in:
parent
953ad66aca
commit
460cc29c04
@ -396,7 +396,7 @@ public class MountManager extends MiniDbClientPlugin<MountOwnerData>
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void handleHorseHits(CustomDamageEvent event)
|
||||
public void redirectHorseDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetDamageeEntity() == null || !(event.GetDamageeEntity() instanceof Horse))
|
||||
{
|
||||
@ -413,14 +413,16 @@ public class MountManager extends MiniDbClientPlugin<MountOwnerData>
|
||||
mount.despawn(false);
|
||||
return;
|
||||
}
|
||||
event.setDamagee(mount.getOwner());
|
||||
if (event.GetCause() != DamageCause.FALL)
|
||||
if (mount.getEntity().getPassenger() == null)
|
||||
{
|
||||
mount.handleHit();
|
||||
event.SetCancelled("Killing riderless mount");
|
||||
mount.despawn(true);
|
||||
return;
|
||||
}
|
||||
event.setDamagee(mount.getOwner());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void handleRiderHits(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetDamageePlayer() == null || event.GetDamageePlayer().getVehicle() == null || !(event.GetDamageePlayer().getVehicle() instanceof Horse))
|
||||
|
Loading…
Reference in New Issue
Block a user