<commit_before>package com.publicuhc.uhcaddons.scatter;

import com.publicuhc.scatterlib.DefaultScatterer;
import com.publicuhc.scatterlib.Scatterer;
import com.publicuhc.scatterlib.exceptions.ScatterLocationException;
import com.publicuhc.scatterlib.logic.StandardScatterLogic;
import com.publicuhc.scatterlib.zones.CircularDeadZoneBuilder;
import com.publicuhc.scatterlib.zones.DeadZone;
import com.publicuhc.ultrahardcore.api.Command;
import com.publicuhc.ultrahardcore.framework.configuration.Configurator;
import com.publicuhc.ultrahardcore.framework.routing.annotation.CommandMethod;
import com.publicuhc.ultrahardcore.framework.routing.annotation.CommandOptions;
import com.publicuhc.ultrahardcore.framework.routing.annotation.OptionsMethod;
import com.publicuhc.ultrahardcore.framework.routing.annotation.PermissionRestriction;
import com.publicuhc.ultrahardcore.framework.routing.converters.LocationValueConverter;
import com.publicuhc.ultrahardcore.framework.routing.converters.OnlinePlayerValueConverter;
import com.publicuhc.ultrahardcore.framework.shaded.javax.Inject;
import com.publicuhc.ultrahardcore.framework.shaded.joptsimple.OptionDeclarer;
import com.publicuhc.ultrahardcore.framework.shaded.joptsimple.OptionSet;
import com.publicuhc.ultrahardcore.framework.translate.Translate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginLogger;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

import java.util.*;

public class ScatterCommand implements Command {

    private final List<Material> mats = new ArrayList<Material>();
    private final int maxAttempts;

    private final Translate translate;

    @Inject
    public ScatterCommand(Translate translate, Configurator configurator, PluginLogger logger)
    {
        this.translate = translate;
        FileConfiguration config = configurator.getConfig("main");
        List<String> stringMats = config.getStringList("allowed blocks");
        for(String stringMat : stringMats) {
            Material mat = Material.matchMaterial(stringMat);
            if(null == mat)
                logger.severe("Unknown material " + stringMat);
            else
                mats.add(mat);
        }
        maxAttempts = config.getInt("max attempts per location");
    }

    @CommandMethod("sct")
    @PermissionRestriction("UHC.scatter.command")
    @CommandOptions({"t", "r", "minradius", "min", "c", "[arguments]"})
    public void onScatterCommand(OptionSet set, CommandSender sender, StandardScatterLogic logic, Double r, Double minradius, Double min, Location centre, List<Player[]> args)
    {
        boolean asTeams = set.has("teams");

        Set<Player> toScatter = OnlinePlayerValueConverter.recombinePlayerLists(args);<commit_msg>optional now<commit_after>package com.publicuhc.uhcaddons.scatter;

import com.google.common.base.Optional;
import com.publicuhc.scatterlib.DefaultScatterer;
import com.publicuhc.scatterlib.Scatterer;
import com.publicuhc.scatterlib.exceptions.ScatterLocationException;
import com.publicuhc.scatterlib.logic.StandardScatterLogic;
import com.publicuhc.scatterlib.zones.CircularDeadZoneBuilder;
import com.publicuhc.scatterlib.zones.DeadZone;
import com.publicuhc.ultrahardcore.api.Command;
import com.publicuhc.ultrahardcore.framework.configuration.Configurator;
import com.publicuhc.ultrahardcore.framework.routing.annotation.CommandMethod;
import com.publicuhc.ultrahardcore.framework.routing.annotation.CommandOptions;
import com.publicuhc.ultrahardcore.framework.routing.annotation.OptionsMethod;
import com.publicuhc.ultrahardcore.framework.routing.annotation.PermissionRestriction;
import com.publicuhc.ultrahardcore.framework.routing.converters.LocationValueConverter;
import com.publicuhc.ultrahardcore.framework.routing.converters.OnlinePlayerValueConverter;
import com.publicuhc.ultrahardcore.framework.shaded.javax.Inject;
import com.publicuhc.ultrahardcore.framework.shaded.joptsimple.OptionDeclarer;
import com.publicuhc.ultrahardcore.framework.shaded.joptsimple.OptionSet;
import com.publicuhc.ultrahardcore.framework.translate.Translate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginLogger;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

import java.util.*;

public class ScatterCommand implements Command {

    private final List<Material> mats = new ArrayList<Material>();
    private final int maxAttempts;

    private final Translate translate;

    @Inject
    public ScatterCommand(Translate translate, Configurator configurator, PluginLogger logger)
    {
        this.translate = translate;
        Optional<FileConfiguration> mainConfig = configurator.getConfig("main");
        if(!mainConfig.isPresent()) {
            throw new IllegalStateException("Config file 'main' was not found, cannot find configuration values");
        }
        FileConfiguration config = mainConfig.get();
        List<String> stringMats = config.getStringList("allowed blocks");
        for(String stringMat : stringMats) {
            Material mat = Material.matchMaterial(stringMat);
            if(null == mat)
                logger.severe("Unknown material " + stringMat);
            else
                mats.add(mat);
        }
        maxAttempts = config.getInt("max attempts per location");
    }

    @CommandMethod("sct")
    @PermissionRestriction("UHC.scatter.command")
    @CommandOptions({"t", "r", "minradius", "min", "c", "[arguments]"})
    public void onScatterCommand(OptionSet set, CommandSender sender, StandardScatterLogic logic, Double r, Double minradius, Double min, Location centre, List<Player[]> args)
    {
        boolean asTeams = set.has("teams");

        Set<Player> toScatter = OnlinePlayerValueConverter.recombinePlayerLists(args);
{'fraction_non_alphanumeric': 0.09770395701025891, 'fraction_numerical': 0.0, 'mean_word_length': 4.9921951219512195, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '6543070', 'n_tokens_mistral': 1835, 'n_tokens_neox': 1772, 'n_words': 307}