Use attack name for Snowballs and Eggs

This commit is contained in:
Sam 2016-08-08 22:48:13 +01:00
parent 93e49bc8a6
commit 3bab7ffe44

View File

@ -985,18 +985,9 @@ public abstract class Skywars extends Game
return;
}
if (this instanceof TeamSkywars && event.GetDamagerPlayer(true) instanceof Player && event.GetDamageeEntity() instanceof Player)
{
if (GetTeam(event.GetDamagerPlayer(true)).equals(GetTeam(event.GetDamageePlayer())))
{
event.SetCancelled("Team Damage");
return;
}
}
if (event.GetProjectile() instanceof Egg || event.GetProjectile() instanceof Snowball)
{
event.AddMod(event.GetDamagerPlayer(true).getName(), (event.GetProjectile() instanceof Egg ? "Egg" : "Snowball"), 2, false);
event.AddMod(event.GetDamagerPlayer(true).getName(), (event.GetProjectile() instanceof Egg ? "Egg" : "Snowball"), 2, true);
}
}