mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-26 15:33:56 +00:00
Try to unify player matching for hidden users:
kill, lightning and ptime still need cleanup
This commit is contained in:
parent
1d6ac42311
commit
8f6c61fa99
13 changed files with 119 additions and 81 deletions
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
|||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.LightningStrike;
|
||||
|
@ -30,11 +31,6 @@ public class Commandlightning extends EssentialsCommand
|
|||
}
|
||||
}
|
||||
|
||||
if (server.matchPlayer(args[0]).isEmpty())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
|
||||
int power = 5;
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
@ -47,12 +43,13 @@ public class Commandlightning extends EssentialsCommand
|
|||
}
|
||||
}
|
||||
|
||||
for (Player matchPlayer : server.matchPlayer(args[0]))
|
||||
final List<Player> matchedPlayers = server.matchPlayer(args[0]);
|
||||
for (Player matchPlayer : matchedPlayers)
|
||||
{
|
||||
sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName()));
|
||||
|
||||
final LightningStrike strike = matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
|
||||
|
||||
|
||||
if (!ess.getUser(matchPlayer).isGodModeEnabled())
|
||||
{
|
||||
matchPlayer.damage(power, strike);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue