mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 11:06:08 +00:00
Fix /day /night /sun and /storm aliases to actually set to the current status if used without parameters.
fixes #2365
This commit is contained in:
parent
5c1eea0953
commit
101ae201d6
3 changed files with 54 additions and 15 deletions
|
@ -18,12 +18,27 @@ public class Commandweather extends EssentialsCommand
|
|||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
final boolean isStorm;
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
if (commandLabel.equalsIgnoreCase("sun") || commandLabel.equalsIgnoreCase("esun"))
|
||||
{
|
||||
isStorm = false;
|
||||
}
|
||||
else if (commandLabel.equalsIgnoreCase("storm") || commandLabel.equalsIgnoreCase("estorm")
|
||||
|| commandLabel.equalsIgnoreCase("rain") || commandLabel.equalsIgnoreCase("erain"))
|
||||
{
|
||||
isStorm = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isStorm = args[0].equalsIgnoreCase("storm");
|
||||
}
|
||||
|
||||
final boolean isStorm = args[0].equalsIgnoreCase("storm");
|
||||
final World world = user.getWorld();
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue