mirror of
https://github.com/essentials/Essentials.git
synced 2025-01-18 13:56:29 +01:00
Minor fixes. Basic testing shows all works.
This commit is contained in:
parent
e96d33cb8b
commit
35121d9c4b
@ -76,7 +76,11 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
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]);
|
||||
User u;
|
||||
@ -95,10 +99,26 @@ public class Commandmail extends EssentialsCommand
|
||||
u.addMail("Server: " + getFinalArg(args, 2));
|
||||
sender.sendMessage(Util.i18n("mailSent"));
|
||||
return;
|
||||
}
|
||||
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
throw new Exception(Util.format("onlyPlayers", commandLabel+" clear"));
|
||||
}
|
||||
else if (args.length >= 2)
|
||||
{ //allow sending from console without "send" argument, since it's the only thing the console can do
|
||||
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();
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class Commandweather extends EssentialsCommand
|
||||
@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
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
throw new Exception("When running from console, usage is: /"+commandLabel+" <world> <storm/sun> [duration]");
|
||||
}
|
||||
|
||||
boolean isStorm = args[1].equalsIgnoreCase("storm");
|
||||
|
Loading…
x
Reference in New Issue
Block a user