blob: e39481f81acc9bf99a78f3d22e30a4c8fa993bd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package net.ess3.commands;
import static net.ess3.I18n._;
import net.ess3.api.IUser;
import org.bukkit.World;
public class Commandthunder extends EssentialsCommand
{
@Override
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
final World world = user.getPlayer().getWorld();
final boolean setThunder = args[0].equalsIgnoreCase("true");
if (args.length > 1)
{
world.setThundering(setThunder ? true : false);
world.setThunderDuration(Integer.parseInt(args[1]) * 20);
user.sendMessage(_("You {0} thunder in your world for {1} seconds.", (setThunder ? _("enabled") : _("disabled")), Integer.parseInt(args[1])));
}
else
{
world.setThundering(setThunder ? true : false);
user.sendMessage(_("You {0} thunder in your world.", setThunder ? _("enabled") : _("disabled")));
}
}
}
|