mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 12:02:53 +00:00
Throw warning when using /kill without valid player.
This commit is contained in:
parent
ed411ee217
commit
a92eb4dee6
2 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,12 @@ public class Commandkill extends EssentialsCommand
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: TL this
|
||||||
|
if (args[0].trim().length() < 3)
|
||||||
|
{
|
||||||
|
throw new NotEnoughArgumentsException("You need to specify a player to kill.");
|
||||||
|
}
|
||||||
|
|
||||||
for (Player matchPlayer : server.matchPlayer(args[0]))
|
for (Player matchPlayer : server.matchPlayer(args[0]))
|
||||||
{
|
{
|
||||||
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
|
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
|
||||||
|
|
|
@ -22,6 +22,7 @@ public class Commandpay extends EssentialsCommand
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: TL this
|
||||||
if (args[0].trim().length() < 3)
|
if (args[0].trim().length() < 3)
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException("You need to specify a player to pay.");
|
throw new NotEnoughArgumentsException("You need to specify a player to pay.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue