1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-26 14:19:05 +02:00
Files
Essentials/Essentials/src/net/ess3/commands/Commandthunder.java
snowleo fd1c7f4fcc Moving all default messages back to the code, where they should be
Also tweaking I18n class and YamlStorageWriter a bit
2013-04-06 04:05:37 +02:00

36 lines
938 B
Java

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")));
}
}
}