<commit_before>package eu.fireblade.fireffa.ability;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import eu.fireblade.fireffa.Main;
import eu.fireblade.fireffa.Var;
import eu.fireblade.fireffa.events.PlayerRightClickInteractEvent;
import eu.fireblade.fireffa.items.Kits;
import net.minecraft.server.v1_8_R3.EnumParticle;
import net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles;

public class Invocation implements Listener {

	public static ArrayList<Player> cooldown = new ArrayList<Player>();
	public static Map<Player, List<Block>> Oblocks = new HashMap<Player, List<Block>>();
	public static Map<Player, List<Block>> Nblocks = new HashMap<Player, List<Block>>();
	
	
	@EventHandler
	public void OnInteract(PlayerRightClickInteractEvent e) {
		Player p = e.getPlayer();
		ItemStack i = e.getItem();
		
		if(Var.invocation.contains(p) && i.equals(Kits.ItemGen1(Material.STICK, Enchantment.DAMAGE_ALL, 1, "fInvocation Stick", 
				Kits.LoreCreator("9Clique Droit - invoque un bouclier pendant 10s", "945 secondes de rcupration"), 1))) {
			if(cooldown.contains(p)) {
				p.sendMessage(ChatColor.GOLD+"6[eFireFFA6] "+ChatColor.RED+"Vous tes en cooldown pour cette attaque !");
				p.playSound(p.getLocation(), Sound.ITEM_BREAK, 30, 30);
				
				return;
			}else {					
				getBlockAtPlayer(p);
			}
		}
		
		if(Var.invocation.contains(p) && i.equals(Kits.ItemGen1(Material.STICK, Enchantment.DAMAGE_ALL, 1, "fInvocation Stick", 
				Kits.LoreCreator("9Clique Droit - invoque un bouclier pendant 10s", "945 secondes de rcupration"), 1))) {
			if(cooldown.contains(p)) {
				return;
			}else {
				p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0));	
			}
		}
	}
	
	private static void getBlockAtPlayer(Player p) {	
		getBlockRelative(p, 5, -1, 0);
		getBlockRelative(p, 5, -1, -1);
		getBlockRelative(p, 5, -1, -2);
		getBlockRelative(p, 5, -1, 1);
		getBlockRelative(p, 5, -1, 2);
		getBlockRelative(p, 5, 0, 0);
		getBlockRelative(p, 5, 0, -1);
		getBlockRelative(p, 5, 0, -2);<commit_msg>bug fix<commit_after>package eu.fireblade.fireffa.ability;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import eu.fireblade.fireffa.Main;
import eu.fireblade.fireffa.Var;
import eu.fireblade.fireffa.events.PlayerRightClickInteractEvent;
import eu.fireblade.fireffa.items.Kits;
import fr.glowstoner.api.bukkit.title.GlowstoneTitle;
import net.minecraft.server.v1_8_R3.EnumParticle;
import net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles;

public class Invocation implements Listener {

	public static ArrayList<Player> cooldown = new ArrayList<Player>();
	public static Map<Player, List<Block>> Oblocks = new HashMap<Player, List<Block>>();
	public static Map<Player, List<Block>> Nblocks = new HashMap<Player, List<Block>>();
	
	
	@EventHandler
	public void OnInteract(PlayerRightClickInteractEvent e) {
		Player p = e.getPlayer();
		ItemStack i = e.getItem();
		
		if(Var.invocation.contains(p) && i.equals(Kits.ItemGen1(Material.STICK, Enchantment.DAMAGE_ALL, 1, "fInvocation Stick", 
				Kits.LoreCreator("9Clique Droit - invoque un bouclier pendant 10s", "945 secondes de rcupration"), 1))) {
			if(cooldown.contains(p)) {
				p.sendMessage(ChatColor.GOLD+"6[eFireFFA6] "+ChatColor.RED+"Vous tes en cooldown pour cette attaque !");
				p.playSound(p.getLocation(), Sound.ITEM_BREAK, 30, 30);
				
				return;
			}else {					
				getBlockAtPlayer(p);
				cooldown.add(p);
				
				Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.plugin, new Runnable() {
					
					@Override
					public void run() {
						cooldown.remove(p);
						GlowstoneTitle gt = new GlowstoneTitle(p, "", "9Vous pouvez utiliser votre dme de glace !", 20, 30, 20);
						gt.send();
						
						p.playSound(p.getLocation(), Sound.ORB_PICKUP, 30, 30);
					}
				}, 900L);
			}
		}
		
		if(Var.invocation.contains(p) && i.equals(Kits.ItemGen1(Material.STICK, Enchantment.DAMAGE_ALL, 1, "fInvocation Stick", 
				Kits.LoreCreator("9Clique Droit - invoque un bouclier pendant 10s", "945 secondes de rcupration"), 1))) {
			if(cooldown.contains(p)) {
				return;
			}else {
				p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0));	
			}
		}
	}
	
	private static void getBlockAtPlayer(Player p) {	
		getBlockRelative(p, 5, -1, 0);
		getBlockRelative(p, 5, -1, -1);
		getBlockRelative(p, 5, -1, -2);
		getBlockRelative(p, 5, -1, 1);
		getBlockRelative(p, 5, -1, 2);
		getBlockRelative(p, 5, 0, 0);
		getBlockRelative(p, 5, 0, -1);
		getBlockRelative(p, 5, 0, -2);
{'fraction_non_alphanumeric': 0.13239486813970064, 'fraction_numerical': 0.024233784746970778, 'mean_word_length': 4.681174089068826, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '4035968', 'n_tokens_mistral': 2353, 'n_tokens_neox': 2048, 'n_words': 399}