<commit_before>package com.lothrazar.samscontent.item;

import java.util.ArrayList;

import com.lothrazar.samscontent.ModLoader;
import com.lothrazar.util.SamsRegistry;
import com.lothrazar.util.SamsUtilities;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemWandLightning  extends Item
{
	public static int durability = 99;//TODO: config 
	public ItemWandLightning()
	{  
		super();  
		this.setCreativeTab(ModLoader.tabSamsContent);
    	this.setMaxDamage(durability);
		this.setMaxStackSize(1);
	}
 
	public static void addRecipe() 
	{
		GameRegistry.addShapelessRecipe(new ItemStack(ItemRegistry.wandLightning),
			ItemRegistry.baseWand, 
			Items.ghast_tear  );
	}
	 
	@SubscribeEvent
	public void onPlayerInteract(PlayerInteractEvent event)
  	{      
		if(event.world.isRemote){ return ;}//server side only!
		
		ItemStack held = event.entityPlayer.getCurrentEquippedItem();  
		if(held == null) { return; }//empty hand so do nothing
		
		if(ModLoader.configSettings.wandLightning == false ) {return;}
		if(held.getItem() != ItemRegistry.wandLightning ) {return;}
		 
		if( event.action.RIGHT_CLICK_BLOCK == event.action )
		{    
			if(event.entityPlayer.isSneaking() == false)
			{ 
				EntityLightningBolt lb = new EntityLightningBolt(event.world, event.pos.getX(), event.pos.getY(), event.pos.getZ());
			//TODO: do a circle or radius, or random spots
			    event.world.spawnEntityInWorld(lb);

				SamsUtilities.damageOrBreakHeld(event.entityPlayer); 
			} 
		} 
  	}
}<commit_msg>lightning wand hit multiple locations<commit_after>package com.lothrazar.samscontent.item;

import java.util.ArrayList;

import com.lothrazar.samscontent.ModLoader;
import com.lothrazar.util.SamsRegistry;
import com.lothrazar.util.SamsUtilities;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemWandLightning  extends Item
{
	public static int durability = 99;//TODO: config 
	public ItemWandLightning()
	{  
		super();  
		this.setCreativeTab(ModLoader.tabSamsContent);
    	this.setMaxDamage(durability);
		this.setMaxStackSize(1);
	}
 
	public static void addRecipe() 
	{
		GameRegistry.addShapelessRecipe(new ItemStack(ItemRegistry.wandLightning),
			ItemRegistry.baseWand, 
			Items.ghast_tear  );
	}
	 
	public int range = 6;
	@SubscribeEvent
	public void onPlayerInteract(PlayerInteractEvent event)
  	{      
		if(event.world.isRemote){ return ;}//server side only!
		
		ItemStack held = event.entityPlayer.getCurrentEquippedItem();  
		if(held == null) { return; }//empty hand so do nothing
		
		if(ModLoader.configSettings.wandLightning == false ) {return;}
		if(held.getItem() != ItemRegistry.wandLightning ) {return;}
		 
		ArrayList<BlockPos> hits = new ArrayList<BlockPos>();
		hits.add(event.pos.east(range));
		hits.add(event.pos.west(range));
		hits.add(event.pos.north(range));
		hits.add(event.pos.south(range));//TODO: do a circle or radius, or random spots??
		if( event.action.RIGHT_CLICK_BLOCK == event.action )
		{    
			if(event.entityPlayer.isSneaking() == false)
			{ 
				for(BlockPos hit : hits)
				{
					//EntityLightningBolt lb = ;
				
				    event.world.spawnEntityInWorld(new EntityLightningBolt(event.world, hit.getX(), hit.getY(), hit.getZ()));
				}
				
				SamsUtilities.damageOrBreakHeld(event.entityPlayer); 
			} 
		} 
  	}
}
{'fraction_non_alphanumeric': 0.11407179035454745, 'fraction_numerical': 0.0015415106804668576, 'mean_word_length': 4.6633416458852865, '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': '3956841', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1520, 'n_words': 247}