Fix weather command

This commit is contained in:
Josh Roy 2023-07-27 19:38:32 -04:00
parent 1a108b5e2e
commit d4ebaf61d4
No known key found for this signature in database
GPG Key ID: 86A69D08540BC29A

View File

@ -31,6 +31,7 @@ public class Commandweather extends EssentialsCommand {
isStorm = args[0].equalsIgnoreCase("storm");
}
ess.scheduleEntityDelayedTask(user.getBase(), () -> {
final World world = user.getWorld();
if (args.length > 1) {
@ -41,6 +42,7 @@ public class Commandweather extends EssentialsCommand {
}
world.setStorm(isStorm);
user.sendMessage(isStorm ? tl("weatherStorm", world.getName()) : tl("weatherSun", world.getName()));
});
}
@Override
@ -55,6 +57,7 @@ public class Commandweather extends EssentialsCommand {
throw new Exception(tl("weatherInvalidWorld", args[0]));
}
ess.scheduleLocationDelayedTask(world.getSpawnLocation(), () -> {
if (args.length > 2) {
world.setStorm(isStorm);
world.setWeatherDuration(Integer.parseInt(args[2]) * 20);
@ -63,6 +66,7 @@ public class Commandweather extends EssentialsCommand {
}
world.setStorm(isStorm);
sender.sendMessage(isStorm ? tl("weatherStorm", world.getName()) : tl("weatherSun", world.getName()));
});
}
@Override