mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-03 20:41:37 +00:00
Continuing code cleanup
This commit is contained in:
parent
fc00ff471d
commit
cd9ea163e4
28 changed files with 223 additions and 229 deletions
|
@ -13,17 +13,19 @@ public class Commandweather extends EssentialsCommand
|
|||
{
|
||||
super("weather");
|
||||
}
|
||||
|
||||
//TODO: Remove duplication
|
||||
|
||||
@Override
|
||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
boolean isStorm = args[0].equalsIgnoreCase("storm");
|
||||
World world = user.getWorld();
|
||||
final boolean isStorm = args[0].equalsIgnoreCase("storm");
|
||||
final World world = user.getWorld();
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
||||
|
@ -43,15 +45,15 @@ public class Commandweather extends EssentialsCommand
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2) //running from console means inserting a world arg before other args
|
||||
{
|
||||
throw new Exception("When running from console, usage is: /" + commandLabel + " <world> <storm/sun> [duration]");
|
||||
}
|
||||
|
||||
boolean isStorm = args[1].equalsIgnoreCase("storm");
|
||||
World world = server.getWorld(args[0]);
|
||||
final boolean isStorm = args[1].equalsIgnoreCase("storm");
|
||||
final World world = server.getWorld(args[0]);
|
||||
if (world == null)
|
||||
{
|
||||
throw new Exception("World named " + args[0] + " not found!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue