mirror of
https://github.com/essentials/Essentials.git
synced 2025-09-26 14:19:05 +02:00
36 lines
938 B
Java
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")));
|
|
}
|
|
|
|
}
|
|
}
|