<commit_before>package me.TehGoldyLockz.OlympicHeroes.tasks;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import me.TehGoldyLockz.OlympicHeroes.item.OHItems;
import me.TehGoldyLockz.OlympicHeroes.player.OHPlayer;

public class EffectsTask implements Runnable {
	
	@Override
	public void run() {
	
		for(Player p : Bukkit.getServer().getOnlinePlayers()) {
			OHPlayer ohPlayer = new OHPlayer(p);
			
			if(ohPlayer.getLevel("Zeus") >= 3) {
				int jumpLevel = Math.min(ohPlayer.getLevel("Zeus") - 3, 1);
				p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 20, jumpLevel), true);

			}
			
			if(ohPlayer.getLevel("Artemis") >= 2 ) {
				long time = p.getWorld().getTime();
				if(time >= 13500 && time <= 23000) {
					p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 0), true);
				}
			}
			
			if(ohPlayer.getLevel("Artemis") >= 5) {
				long time = p.getWorld().getTime();
				if(time >= 13500 && time <= 23000) {
					p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20, 0), true);
				}
			}
			
			if(ohPlayer.getLevel("Apollo") >= 5) {
				long time = p.getWorld().getTime();
				if(time <= 13500 || time >= 23000) {
					p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20, 0), true);
				}
			}
			
			if(ohPlayer.getLevel("Athena") >= 3) {
				ItemStack item = p.getInventory().getItemInMainHand();
				if(item.getType() == Material.DIAMOND_SWORD || item.getType() == Material.GOLD_SWORD || 
				   item.getType() == Material.IRON_SWORD || item.getType() == Material.STONE_SWORD ||
				   item.getType() == Material.WOOD_SWORD) {
					int hasteLevel = Math.min(ohPlayer.getLevel("Athena")-3, 2);
					p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20, hasteLevel), true);
				}
			}
			
	//		if(ohPlayer.getLevel("Athena") >= 5) {
	//			ItemStack item = p.getInventory().getItemInMainHand();
				//ItemStack prevOffHand = p.getInventory().getItemInOffHand();
	//			if(p.getInventory().getItemInOffHand() != OHItems.AEGIS_SHIELD) {
	//			if(item.getType() == Material.DIAMOND_SWORD || item.getType() == Material.GOLD_SWORD || 
	//			   item.getType() == Material.IRON_SWORD || item.getType() == Material.STONE_SWORD ||
	//			   item.getType() == Material.WOOD_SWORD) {
	//				p.getInventory().setItemInOffHand(OHItems.AEGIS_SHIELD);
	//				
	//				}
	//			}
	//		}<commit_msg>Fix logans shit<commit_after>package me.TehGoldyLockz.OlympicHeroes.tasks;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import me.TehGoldyLockz.OlympicHeroes.item.OHItems;
import me.TehGoldyLockz.OlympicHeroes.player.OHPlayer;

public class EffectsTask implements Runnable {
	
	@Override
	public void run() {
	
		for(Player p : Bukkit.getServer().getOnlinePlayers()) {
			OHPlayer ohPlayer = new OHPlayer(p);
			
			if(ohPlayer.getLevel("Zeus") >= 3) {
				int jumpLevel = Math.min(ohPlayer.getLevel("Zeus") - 3, 1);
				p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 20, jumpLevel), true);

			}
			
			if(ohPlayer.getLevel("Artemis") >= 2 ) {
				long time = p.getWorld().getTime();
				if(time >= 13500 && time <= 23000) {
					p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 0), true);
				}
			}
			
			if(ohPlayer.getLevel("Artemis") >= 5) {
				long time = p.getWorld().getTime();
				if(time >= 13500 && time <= 23000) {
					p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20, 0), true);
				}
			}
			
			if(ohPlayer.getLevel("Apollo") >= 5) {
				long time = p.getWorld().getTime();
				if(time <= 13500 || time >= 23000) {
					p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20, 0), true);
				}
			}
			
			if(ohPlayer.getLevel("Aphrodite") >= 3) {
				boolean hasAbsorption = false;
				for(PotionEffect e : p.getActivePotionEffects()) {
					if(e.getType() == PotionEffectType.ABSORPTION) {
						hasAbsorption = true;
					}
				}
				
				if(!hasAbsorption) {
					int absLevel = Math.min(ohPlayer.getLevel("Aphrodite") - 3, 1);
					p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 2400, absLevel), true);
				}
			}
			
			if(ohPlayer.getLevel("Athena") >= 3) {
				ItemStack item = p.getInventory().getItemInMainHand();
				if(item.getType() == Material.DIAMOND_SWORD || item.getType() == Material.GOLD_SWORD || 
				   item.getType() == Material.IRON_SWORD || item.getType() == Material.STONE_SWORD ||
				   item.getType() == Material.WOOD_SWORD) {
					int hasteLevel = Math.min(ohPlayer.getLevel("Athena")-3, 2);
					p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20, hasteLevel), true);
				}
			}
			
	//		if(ohPlayer.getLevel("Athena") >= 5) {
	//			ItemStack item = p.getInventory().getItemInMainHand();
				//ItemStack prevOffHand = p.getInventory().getItemInOffHand();
	//			if(p.getInventory().getItemInOffHand() != OHItems.AEGIS_SHIELD) {
	//			if(item.getType() == Material.DIAMOND_SWORD || item.getType() == Material.GOLD_SWORD || 
	//			   item.getType() == Material.IRON_SWORD || item.getType() == Material.STONE_SWORD ||
	//			   item.getType() == Material.WOOD_SWORD) {
	//				p.getInventory().setItemInOffHand(OHItems.AEGIS_SHIELD);
	//				
	//				}
	//			}
	//		}
{'fraction_non_alphanumeric': 0.15798075177047394, 'fraction_numerical': 0.020519339023061557, 'mean_word_length': 3.624685138539043, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 22, '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': '1558581', 'n_tokens_mistral': 2483, 'n_tokens_neox': 2020, 'n_words': 291}