mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-08 14:58:06 +00:00
Use user object to send messages when possible.
This commit is contained in:
parent
ff41588c3b
commit
ffae86dd42
5 changed files with 9 additions and 8 deletions
|
@ -51,17 +51,18 @@ public class Commandlightning extends EssentialsCommand
|
|||
final List<Player> matchedPlayers = server.matchPlayer(args[0]);
|
||||
for (Player matchPlayer : matchedPlayers)
|
||||
{
|
||||
User matchUser = ess.getUser(matchPlayer);
|
||||
sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName()));
|
||||
|
||||
final LightningStrike strike = matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
|
||||
|
||||
if (!ess.getUser(matchPlayer).isGodModeEnabled())
|
||||
if (!matchUser.isGodModeEnabled())
|
||||
{
|
||||
matchPlayer.damage(power, strike);
|
||||
}
|
||||
if (ess.getSettings().warnOnSmite())
|
||||
{
|
||||
matchPlayer.sendMessage(_("lightningSmited"));
|
||||
matchUser.sendMessage(_("lightningSmited"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue