<commit_before>package org.gestern.gringotts;

import java.util.Date;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.gestern.gringotts.api.Eco;
import org.gestern.gringotts.api.PlayerAccount;
import org.gestern.gringotts.api.TransactionResult;
import org.gestern.gringotts.api.impl.GringottsEco;

public class InterestModule implements Runnable {
	private final Eco eco = new GringottsEco();
	private final double rate = 1.0 / 100.0;
	private final long period = 20 * 60 * 60;

	@SuppressWarnings("deprecation")
	protected void start() {
		Date date = new Date(System.currentTimeMillis());
		int minutes = date.getMinutes();
		int seconds = date.getSeconds();
		long delay = 20 * (60 - seconds) * (60 - minutes);

		Bukkit.getScheduler().runTaskTimer(Gringotts.G, this, delay, period);
	}

	@Override
	public void run() {
		for (Player p : Bukkit.getServer().getOnlinePlayers()) {
			PlayerAccount acc = eco.player(p.getUniqueId());

			if (!acc.exists())
				continue;

			if (acc.vaultBalance() == 0.0)
				continue;

			double balance = acc.balance();
			double interest = Math.floor(balance * rate);
			TransactionResult result = acc.add(interest);

			switch (result) {
			case SUCCESS:
				String success = ChatColor.GREEN + "You earned " + interest
						+ " interest of your " + balance
						+ " balance at a rate of " + rate
						+ "%, which was added to your vault.";
				p.sendMessage(success);<commit_msg>fixed delay to represent the period time minus the already taken minutes and seconds<commit_after>package org.gestern.gringotts;

import java.util.Date;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.gestern.gringotts.api.Eco;
import org.gestern.gringotts.api.PlayerAccount;
import org.gestern.gringotts.api.TransactionResult;
import org.gestern.gringotts.api.impl.GringottsEco;

public class InterestModule implements Runnable {
	private final Eco eco = new GringottsEco();
	private final double rate = 1.0 / 100.0;
	private final long period = 20 * 60 * 60;

	@SuppressWarnings("deprecation")
	protected void start() {
		Date date = new Date(System.currentTimeMillis());
		int minutes = date.getMinutes();
		int seconds = date.getSeconds();
		long delay = period - (minutes * 60) - (seconds * 20);

		Bukkit.getScheduler().runTaskTimer(Gringotts.G, this, delay, period);
	}

	@Override
	public void run() {
		for (Player p : Bukkit.getServer().getOnlinePlayers()) {
			PlayerAccount acc = eco.player(p.getUniqueId());

			if (!acc.exists())
				continue;

			if (acc.vaultBalance() == 0.0)
				continue;

			double balance = acc.balance();
			double interest = Math.floor(balance * rate);
			TransactionResult result = acc.add(interest);

			switch (result) {
			case SUCCESS:
				String success = ChatColor.GREEN + "You earned " + interest
						+ " interest of your " + balance
						+ " balance at a rate of " + rate
						+ "%, which was added to your vault.";
				p.sendMessage(success);
{'fraction_non_alphanumeric': 0.12189466710831401, 'fraction_numerical': 0.012586949320967208, 'mean_word_length': 3.8867313915857604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3824311', 'n_tokens_mistral': 1120, 'n_tokens_neox': 949, 'n_words': 256}