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

import java.util.ArrayList;

import com.lothrazar.samscontent.ModLoader;
import com.lothrazar.util.*;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
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 ItemWandFire  extends Item
{
	public ItemWandFire()
	{  
		super();  
		this.setCreativeTab(ModLoader.tabSamsContent);
    	this.setMaxDamage(DURABILITY); 
		this.setMaxStackSize(1);
	}
 
	public static void addRecipe() 
	{
		GameRegistry.addShapelessRecipe(new ItemStack(ItemRegistry.wandFire),
			ItemRegistry.baseWand, 
			Items.flint_and_steel  );
	}
	
	public static int RADIUS;
	public static int DURABILITY;

	public static void castFire(World world, EntityPlayer entityPlayer,	ItemStack held) 
	{ 
		for(int i = 2; i < RADIUS; i++)
		{
			BlockPos fr = entityPlayer.getPosition().offset(entityPlayer.getHorizontalFacing(), i);
			
			if(world.isAirBlock(fr))
			{
				world.setBlockState(fr, Blocks.fire.getDefaultState());
			}
		}
		 
		SamsUtilities.playSoundAt(entityPlayer, "fire.ignite");
	}

	public void castExtinguish(World world, EntityPlayer entityPlayer,	ItemStack held) 
	{ 
		ArrayList<BlockPos> fires = SamsUtilities.findBlocks(entityPlayer, Blocks.fire, RADIUS);
		
		for(BlockPos p : fires)
		{ 
			world.extinguishFire(entityPlayer, p.down(), EnumFacing.UP);//from above
			SamsUtilities.spawnParticle(world, EnumParticleTypes.DRIP_WATER, p);
		}
		
		if(fires.size() > 0)
		{
			SamsUtilities.playSoundAt(entityPlayer, "liquid.water");
		} 
	}
	  
	@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
		  
		Block blockClicked = event.entityPlayer.worldObj.getBlockState(event.pos).getBlock();
		
		if(held.getItem() == ItemRegistry.wandFire && 
				event.action.RIGHT_CLICK_BLOCK == event.action)
		{  
			if(event.entityPlayer.isSneaking())
			{ 
				ItemWandFire.castFire(event.world,event.entityPlayer,held); 
			}
			else
			{
				castExtinguish(event.world,event.entityPlayer,held); 
			} 
		}
  	}
}<commit_msg>fire wand: fixing direction based on face hit.  also swapped shift function<commit_after>package com.lothrazar.samscontent.item;

import java.util.ArrayList;

import com.lothrazar.samscontent.ModLoader;
import com.lothrazar.util.*;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
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 ItemWandFire  extends Item
{
	public ItemWandFire()
	{  
		super();  
		this.setCreativeTab(ModLoader.tabSamsContent);
    	this.setMaxDamage(DURABILITY); 
		this.setMaxStackSize(1);
	}
 
	public static void addRecipe() 
	{
		GameRegistry.addShapelessRecipe(new ItemStack(ItemRegistry.wandFire),
			ItemRegistry.baseWand, 
			Items.flint_and_steel  );
	}
	
	public static int RADIUS;
	public static int DURABILITY;

	public static void castFire(World world, EntityPlayer entityPlayer,	ItemStack held, EnumFacing face) 
	{ 
		for(int i = 2; i < RADIUS; i++)
		{
			//previously used entityPlayer.getHorizontalFacing()
			BlockPos fr = entityPlayer.getPosition().offset(face, i);
			
			if(world.isAirBlock(fr))
			{
				world.setBlockState(fr, Blocks.fire.getDefaultState());
			}
		}
		 
		SamsUtilities.playSoundAt(entityPlayer, "fire.ignite");
	}

	public void castExtinguish(World world, EntityPlayer entityPlayer,	ItemStack held) 
	{ 
		ArrayList<BlockPos> fires = SamsUtilities.findBlocks(entityPlayer, Blocks.fire, RADIUS);
		
		for(BlockPos p : fires)
		{ 
			world.extinguishFire(entityPlayer, p.down(), EnumFacing.UP);//from above
			SamsUtilities.spawnParticle(world, EnumParticleTypes.DRIP_WATER, p);
		}
		
		if(fires.size() > 0)
		{
			SamsUtilities.playSoundAt(entityPlayer, "liquid.water");
		} 
	}
	  
	@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
		  
		Block blockClicked = event.entityPlayer.worldObj.getBlockState(event.pos).getBlock();
		
		if(held.getItem() == ItemRegistry.wandFire && 
				event.action.RIGHT_CLICK_BLOCK == event.action)
		{  
			if(event.entityPlayer.isSneaking() == false)
			{ 
				ItemWandFire.castFire(event.world,event.entityPlayer,held,event.face); 
			}
			else
			{
				castExtinguish(event.world,event.entityPlayer,held); 
			} 
		}
  	}
}
{'fraction_non_alphanumeric': 0.11273374888691007, 'fraction_numerical': 0.0010685663401602849, 'mean_word_length': 4.468354430379747, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2768020', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1890, 'n_words': 309}