mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-30 00:27:26 +02:00
Minor fixes. Basic testing shows all works.
This commit is contained in:
parent
6ab30159fa
commit
82b225a261
@ -76,7 +76,11 @@ public class Commandmail extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new Exception(Util.format("onlyPlayers", commandLabel+" read"));
|
throw new Exception(Util.format("onlyPlayers", commandLabel+" read"));
|
||||||
}
|
}
|
||||||
if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
|
else if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
|
||||||
|
{
|
||||||
|
throw new Exception(Util.format("onlyPlayers", commandLabel+" clear"));
|
||||||
|
}
|
||||||
|
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
|
||||||
{
|
{
|
||||||
Player player = server.getPlayer(args[1]);
|
Player player = server.getPlayer(args[1]);
|
||||||
User u;
|
User u;
|
||||||
@ -95,10 +99,26 @@ public class Commandmail extends EssentialsCommand
|
|||||||
u.addMail("Server: " + getFinalArg(args, 2));
|
u.addMail("Server: " + getFinalArg(args, 2));
|
||||||
sender.sendMessage(Util.i18n("mailSent"));
|
sender.sendMessage(Util.i18n("mailSent"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
|
else if (args.length >= 2)
|
||||||
{
|
{ //allow sending from console without "send" argument, since it's the only thing the console can do
|
||||||
throw new Exception(Util.format("onlyPlayers", commandLabel+" clear"));
|
Player player = server.getPlayer(args[0]);
|
||||||
|
User u;
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
u = ess.getUser(player);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
u = ess.getOfflineUser(args[0]);
|
||||||
|
}
|
||||||
|
if (u == null)
|
||||||
|
{
|
||||||
|
throw new Exception(Util.format("playerNeverOnServer", args[0]));
|
||||||
|
}
|
||||||
|
u.addMail("Server: " + getFinalArg(args, 1));
|
||||||
|
sender.sendMessage(Util.i18n("mailSent"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class Commandweather extends EssentialsCommand
|
|||||||
@Override protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception {
|
@Override protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception {
|
||||||
if (args.length < 2) //running from console means inserting a world arg before other args
|
if (args.length < 2) //running from console means inserting a world arg before other args
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new Exception("When running from console, usage is: /"+commandLabel+" <world> <storm/sun> [duration]");
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isStorm = args[1].equalsIgnoreCase("storm");
|
boolean isStorm = args[1].equalsIgnoreCase("storm");
|
||||||
|
Loading…
Reference in New Issue
Block a user