<commit_before>package com.tehbeard.enchancedadv.items;

import net.minecraft.item.Item;

public class ItemLocationEncoder extends Item{

	public ItemLocationEncoder(int par1) {
		super(par1);
		setUnlocalizedName("locationencoder");
		// TODO Auto-generated constructor stub
	}
	
	

}<commit_msg>work on getting location, either the block we click or relative to side we clicked.<commit_after>package com.tehbeard.enchancedadv.items;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;

/**
 * Encodes location information to apply to a command block
 * @author James
 *
 */
public class ItemLocationEncoder extends Item{

	public ItemLocationEncoder(int par1) {
		super(par1);
		setUnlocalizedName("locationencoder");
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public void onCreated(ItemStack par1ItemStack, World par2World,
			EntityPlayer par3EntityPlayer) {
		initTag(par1ItemStack);
		super.onCreated(par1ItemStack, par2World, par3EntityPlayer);
	}
	
	@Override
	public boolean onItemUseFirst(ItemStack stack, EntityPlayer player,
			World world, int x, int y, int z, int side, float hitX, float hitY,
			float hitZ) {
		initTag(stack);
		if(player.isSneaking()){
			ForgeDirection direction = ForgeDirection.getOrientation(side);
		}
		return true;
	}
	
	public NBTTagCompound getLocTag(ItemStack stack){
		return stack.stackTagCompound.getCompoundTag("loc");
	}
	
	public void initTag(ItemStack stack){
		if(stack.stackTagCompound==null){
	        stack.stackTagCompound = new NBTTagCompound();
	        stack.stackTagCompound.setCompoundTag("loc", new NBTTagCompound());
	        stack.stackTagCompound.getCompoundTag("loc").setInteger("x",0);
	        stack.stackTagCompound.getCompoundTag("loc").setInteger("y",0);
	        stack.stackTagCompound.getCompoundTag("loc").setInteger("z",0);
	        }
	}

}
{'fraction_non_alphanumeric': 0.10385756676557864, 'fraction_numerical': 0.006923837784371909, 'mean_word_length': 4.8979591836734695, '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': '4556660', 'n_tokens_mistral': 663, 'n_tokens_neox': 625, 'n_words': 134}