<commit_before>package com.simplyian.superplots;

import java.util.logging.Level;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;

public class EconHook {
    private final SuperPlotsPlugin main;
    private Economy economy = null;

    public EconHook(SuperPlotsPlugin main) {
        this.main = main;
    }

    public void setupEconomy() {
        RegisteredServiceProvider<Economy> economyProvider = main.getServer()
                .getServicesManager().getRegistration(Economy.class);
        if (economyProvider != null) {
            economy = economyProvider.getProvider();
        }

        if (economy == null) {
            main.getLogger()
                    .log(Level.SEVERE,
                            "No supported economy by Vault detected! Things WILL go wrong!");
        }
    }

    /**
     * Gets the balance of a player.
     * 
     * @param player
     * @return
     */
    public double getBalance(String player) {
        return economy.getBalance(player);
    }

    /**
     * Sets the balance of a player.
     * 
     * @param player
     * @param amt
     */
    public void setBalance(String player, double amt) {
        economy.depositPlayer(player, amt);
    }

    public void addBalance(String player, int dubloons) {
        // TODO Auto-generated method stub

    }

    public void subtractBalance(String name, int cost) {
        // TODO Auto-generated method stub
        
    }
}
<commit_msg>Implemented logic for money<commit_after>package com.simplyian.superplots;

import java.util.logging.Level;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;

public class EconHook {
    private final SuperPlotsPlugin main;
    private Economy economy = null;

    public EconHook(SuperPlotsPlugin main) {
        this.main = main;
    }

    public void setupEconomy() {
        RegisteredServiceProvider<Economy> economyProvider = main.getServer()
                .getServicesManager().getRegistration(Economy.class);
        if (economyProvider != null) {
            economy = economyProvider.getProvider();
        }

        if (economy == null) {
            main.getLogger()
                    .log(Level.SEVERE,
                            "No supported economy by Vault detected! Things WILL go wrong!");
        }
    }

    /**
     * Gets the balance of a player.
     * 
     * @param player
     * @return
     */
    public double getBalance(String player) {
        return economy.getBalance(player);
    }

    /**
     * Sets the balance of a player.
     * 
     * @param player
     * @param amt
     */
    public void setBalance(String player, double amt) {
        economy.depositPlayer(player, amt);
    }

    /**
     * Adds money to a player's account.
     * 
     * @param player
     * @param cost
     */
    public void addBalance(String name, int cost) {
        setBalance(name, getBalance(name) + cost);
    }

    /**
     * Subtracts an amount of money from a player's account.
     * 
     * @param name
     * @param cost
     */
    public void subtractBalance(String name, int cost) {
        setBalance(name, getBalance(name) - cost);
    }
}

{'fraction_non_alphanumeric': 0.0959902794653706, 'fraction_numerical': 0.0, 'mean_word_length': 2.1007532956685497, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6075631', 'n_tokens_mistral': 968, 'n_tokens_neox': 944, 'n_words': 236}