<commit_before>package com.simplyian.superplots.actions;

import java.util.List;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;

import com.google.common.base.Joiner;
import com.simplyian.superplots.MsgColor;
import com.simplyian.superplots.SuperPlots;
import com.simplyian.superplots.plot.Plot;

public class ActionCreate extends BaseAction {

    public ActionCreate(SuperPlots main) {
        super(main);
    }

    @Override
    public void perform(Player player, List<String> args) {
        Plot closest = main.getPlotManager().getClosestPlotAt(
                player.getLocation());
        double dist = closest.influenceEdgeDistance(player.getLocation());

        double minDist = main.getSettings().getInitialPlotSize();

        if (dist < minDist) {
            player.sendMessage(MsgColor.ERROR
                    + "Cannot create a plot here; the plot '"
                    + MsgColor.ERROR_HILIGHT + closest.getName()
                    + MsgColor.ERROR + "' is too close.");
            return;
        }

        String name = Joiner.on(' ').join(args);
        Plot existing = main.getPlotManager().getPlotByName(name);
        if (existing != null) {
            player.sendMessage(MsgColor.ERROR
                    + "Sorry, that name is already taken.");
            return;
        }

        if (name.length() < 1) {
            player.sendMessage(MsgColor.ERROR + "You must enter a name.");
            return;
        }

        if (!name.matches("[A-Za-z0-9 '!]+")) {
            player.sendMessage(MsgColor.ERROR
                    + "The name you have given is invalid.");
            player.sendMessage(MsgColor.ERROR
                    + "Names can only contain letters, numbers, spaces, apostrophes, and exclamation points.");
            return;
        }

        int multiplier = 1;
        for (Plot plot : main.getPlotManager().getPlots()) {
            if (plot.isOwner(player.getName())) {
                multiplier++;
            }
        }

        int requiredMoney = multiplier * 1000;
        double money = main.getEconomy().getBalance(player.getName());
        if (money < requiredMoney) {
            player.sendMessage(MsgColor.ERROR
                    + "You don't have enough money to buy a plot! (Need "
                    + requiredMoney + ")");
            return;
        }

        PlayerInventory inventory = player.getInventory();
        ItemStack[] itemStacks = inventory.getContents();
        int diamondCount = 0;
        for (int i = 0; i < itemStacks.length; i++) {<commit_msg>Exponential growth for multiplier<commit_after>package com.simplyian.superplots.actions;

import java.util.List;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;

import com.google.common.base.Joiner;
import com.simplyian.superplots.MsgColor;
import com.simplyian.superplots.SuperPlots;
import com.simplyian.superplots.plot.Plot;

public class ActionCreate extends BaseAction {

    public ActionCreate(SuperPlots main) {
        super(main);
    }

    @Override
    public void perform(Player player, List<String> args) {
        Plot closest = main.getPlotManager().getClosestPlotAt(
                player.getLocation());
        double dist = closest.influenceEdgeDistance(player.getLocation());

        double minDist = main.getSettings().getInitialPlotSize();

        if (dist < minDist) {
            player.sendMessage(MsgColor.ERROR
                    + "Cannot create a plot here; the plot '"
                    + MsgColor.ERROR_HILIGHT + closest.getName()
                    + MsgColor.ERROR + "' is too close.");
            return;
        }

        String name = Joiner.on(' ').join(args);
        Plot existing = main.getPlotManager().getPlotByName(name);
        if (existing != null) {
            player.sendMessage(MsgColor.ERROR
                    + "Sorry, that name is already taken.");
            return;
        }

        if (name.length() < 1) {
            player.sendMessage(MsgColor.ERROR + "You must enter a name.");
            return;
        }

        if (!name.matches("[A-Za-z0-9 '!]+")) {
            player.sendMessage(MsgColor.ERROR
                    + "The name you have given is invalid.");
            player.sendMessage(MsgColor.ERROR
                    + "Names can only contain letters, numbers, spaces, apostrophes, and exclamation points.");
            return;
        }

        int multiplier = 1;
        for (Plot plot : main.getPlotManager().getPlots()) {
            if (plot.isOwner(player.getName())) {
                multiplier++;
            }
        }
        multiplier = (int) Math.pow(2.0, multiplier);

        int requiredMoney = multiplier * 1000;
        double money = main.getEconomy().getBalance(player.getName());
        if (money < requiredMoney) {
            player.sendMessage(MsgColor.ERROR
                    + "You don't have enough money to buy a plot! (Need "
                    + requiredMoney + ")");
            return;
        }

        PlayerInventory inventory = player.getInventory();
        ItemStack[] itemStacks = inventory.getContents();
        int diamondCount = 0;
        for (int i = 0; i < itemStacks.length; i++) {
{'fraction_non_alphanumeric': 0.11096654275092936, 'fraction_numerical': 0.004089219330855019, 'mean_word_length': 2.05218377765173, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, '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': '1372326', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1429, 'n_words': 337}