<commit_before>/*
 * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT).
 *
 * Copyright (c) OreCruncher
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package org.blockartistry.mod.DynSurround.commands;

import java.text.DecimalFormat;
import java.util.List;

import org.blockartistry.mod.DynSurround.data.BiomeRegistry;
import org.blockartistry.mod.DynSurround.data.BlockRegistry;
import org.blockartistry.mod.DynSurround.data.DimensionEffectData;

import com.google.common.collect.ImmutableList;

import net.minecraft.client.resources.I18n;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;

public final class CommandRain extends CommandBase {

	private static final String COMMAND = "ds";
	private static final String COMMAND_OPTION_RAIN = "rain";
	private static final String COMMAND_OPTION_THUNDER = "thunder";
	private static final String COMMAND_OPTION_STATUS = "status";
	private static final String COMMAND_OPTION_RESET = "reset";
	private static final String COMMAND_OPTION_RELOAD = "reload";
	private static final String COMMAND_OPTION_SETMIN = "setmin";
	private static final String COMMAND_OPTION_SETMAX = "setmax";
	private static final String COMMAND_OPTION_SETSTRENGTH = "setstr";
	private static final String COMMAND_OPTION_SETTIME = "settime";
	private static final String COMMAND_OPTION_SETTHRESHOLD = "setthreshold";
	private static final String COMMAND_OPTION_CONFIG = "config";

	private static final List<String> ALIAS = ImmutableList.<String> builder().add("dsurround", "rain").build();
	private static final DecimalFormat FORMATTER = new DecimalFormat("0.0");

	private static final List<String> HELP = ImmutableList.<String> builder()
			.add(TextFormatting.GOLD + "Dynamic Surroundings command help:").add(TextFormatting.YELLOW + "/ds reset")
			.add(TextFormatting.YELLOW + "/ds reload").add(TextFormatting.YELLOW + "/ds config")
			.add(TextFormatting.YELLOW + "/ds status <rain|thunder>")
			.add(TextFormatting.YELLOW + "/ds settime <rain|thunder> 0-100")
			.add(TextFormatting.YELLOW + "/ds setstr rain 0-100").add(TextFormatting.YELLOW + "/ds setmin rain 0-100")
			.add(TextFormatting.YELLOW + "/ds setmax rain 0-100")
			.add(TextFormatting.YELLOW + "/ds setthreshold thunder 0-100").build();

	public static String rainStatusOutput(final World world, final DimensionEffectData data) {
		final StringBuilder builder = new StringBuilder();
		final float minutes = (world.getWorldInfo().getRainTime() / 20.0F) / 60.0F;
		builder.append(data.toString());
		builder.append("; isRaining: ").append(Boolean.toString(world.isRaining()));
		builder.append("; isSurface: ").append(Boolean.toString(world.provider.isSurfaceWorld()));
		builder.append("; strength: ").append(FORMATTER.format(world.getRainStrength(1.0F) * 100));
		builder.append("; timer: ").append(FORMATTER.format(minutes)).append(" minutes");
		return builder.toString();
	}

	public static String thunderStatusOutput(final World world, final DimensionEffectData data) {<commit_msg>Fix type in command help<commit_after>/*
 * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT).
 *
 * Copyright (c) OreCruncher
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package org.blockartistry.mod.DynSurround.commands;

import java.text.DecimalFormat;
import java.util.List;

import org.blockartistry.mod.DynSurround.data.BiomeRegistry;
import org.blockartistry.mod.DynSurround.data.BlockRegistry;
import org.blockartistry.mod.DynSurround.data.DimensionEffectData;

import com.google.common.collect.ImmutableList;

import net.minecraft.client.resources.I18n;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;

public final class CommandRain extends CommandBase {

	private static final String COMMAND = "ds";
	private static final String COMMAND_OPTION_RAIN = "rain";
	private static final String COMMAND_OPTION_THUNDER = "thunder";
	private static final String COMMAND_OPTION_STATUS = "status";
	private static final String COMMAND_OPTION_RESET = "reset";
	private static final String COMMAND_OPTION_RELOAD = "reload";
	private static final String COMMAND_OPTION_SETMIN = "setmin";
	private static final String COMMAND_OPTION_SETMAX = "setmax";
	private static final String COMMAND_OPTION_SETSTRENGTH = "setstr";
	private static final String COMMAND_OPTION_SETTIME = "settime";
	private static final String COMMAND_OPTION_SETTHRESHOLD = "setthreshold";
	private static final String COMMAND_OPTION_CONFIG = "config";

	private static final List<String> ALIAS = ImmutableList.<String> builder().add("dsurround", "rain").build();
	private static final DecimalFormat FORMATTER = new DecimalFormat("0.0");

	private static final List<String> HELP = ImmutableList.<String> builder()
			.add(TextFormatting.GOLD + "Dynamic Surroundings command help:").add(TextFormatting.YELLOW + "/ds reset")
			.add(TextFormatting.YELLOW + "/ds reload").add(TextFormatting.YELLOW + "/ds config")
			.add(TextFormatting.YELLOW + "/ds status <rain|thunder>")
			.add(TextFormatting.YELLOW + "/ds settime <rain|thunder> 0-1000")
			.add(TextFormatting.YELLOW + "/ds setstr rain 0-100").add(TextFormatting.YELLOW + "/ds setmin rain 0-100")
			.add(TextFormatting.YELLOW + "/ds setmax rain 0-100")
			.add(TextFormatting.YELLOW + "/ds setthreshold thunder 0-100").build();

	public static String rainStatusOutput(final World world, final DimensionEffectData data) {
		final StringBuilder builder = new StringBuilder();
		final float minutes = (world.getWorldInfo().getRainTime() / 20.0F) / 60.0F;
		builder.append(data.toString());
		builder.append("; isRaining: ").append(Boolean.toString(world.isRaining()));
		builder.append("; isSurface: ").append(Boolean.toString(world.provider.isSurfaceWorld()));
		builder.append("; strength: ").append(FORMATTER.format(world.getRainStrength(1.0F) * 100));
		builder.append("; timer: ").append(FORMATTER.format(minutes)).append(" minutes");
		return builder.toString();
	}

	public static String thunderStatusOutput(final World world, final DimensionEffectData data) {
{'fraction_non_alphanumeric': 0.09885321100917431, 'fraction_numerical': 0.008142201834862386, 'mean_word_length': 5.464788732394366, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5833657', 'n_tokens_mistral': 2610, 'n_tokens_neox': 2430, 'n_words': 798}