* @see com.sijobe.spc.wrapper.CommandBase#execute(com.sijobe.spc.wrapper.CommandSender, java.util.List)
*/
@Override
public void execute(CommandSender sender, List<?> params) throws CommandException {
String argument = (String)params.get(0);
Player player = super.getSenderAsPlayer(sender);
World world = player.getWorld();
if (argument.equalsIgnoreCase("rain")) {
// Toggles rain on/off
boolean rain = !world.isRaining();
if (params.size() > 1) {
rain = (Boolean)params.get(1);
}
world.setRaining(rain);
sender.sendMessageToPlayer("Rain was " + FontColour.AQUA + (rain ? "enabled" : "disabled"));
} else if (argument.equalsIgnoreCase("thunder")) {
// Toggles thunder storms on/off (changes rain too)
boolean thunder = !world.isThunder();
if (params.size() > 1) {
thunder = (Boolean)params.get(1);
}
world.setThunder(thunder);
world.setRaining(thunder);
sender.sendMessageToPlayer("Thunder was " + FontColour.AQUA + (thunder ? "enabled" : "disabled"));
} else if (argument.equalsIgnoreCase("lightning")) {
Coordinate coordinate = player.trace(128.0);
if (coordinate == null) {
return;
}
world.useLightning(coordinate);
} else {