<commit_before>package com.lothrazar.item;

import java.util.ArrayList;

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

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.tileentity.TileEntitySign;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemWandCopyPaste  extends Item
{
	public ItemWandCopyPaste()
	{  
		super();  
		this.setCreativeTab(ModLoader.tabSamsContent);
    	this.setMaxDamage(99); 
		this.setMaxStackSize(1);
	}
 
	public static void init()
	{
		//if(!ModLoader.configSettings.wandCopy) {return;}//TODO: config
		ItemRegistry.wandCopy = new ItemWandCopyPaste();

		SamsRegistry.registerItem(ItemRegistry.wandCopy, "wand_copy");
  
	}

	public static void copySign(World world, EntityPlayer entityPlayer,	TileEntitySign sign, ItemStack held) 
	{ 
		SamsUtilities.setItemStackNBT(held, "sign_0", sign.signText[0].getUnformattedText());
		SamsUtilities.setItemStackNBT(held, "sign_1", sign.signText[1].getUnformattedText());
		SamsUtilities.setItemStackNBT(held, "sign_2", sign.signText[2].getUnformattedText());
		SamsUtilities.setItemStackNBT(held, "sign_3", sign.signText[3].getUnformattedText());

		entityPlayer.swingItem();
	}

	public static void pasteSign(World world, EntityPlayer entityPlayer,	TileEntitySign sign, ItemStack held) 
	{

		sign.signText[0] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_0"));
		sign.signText[1] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_1"));
		sign.signText[2] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_2"));
		sign.signText[3] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_3"));

		entityPlayer.swingItem();
	 
		
	}
 
	 
	 
}<commit_msg>wand copy paste: read write sign updated with a block update<commit_after>package com.lothrazar.item;

import java.util.ArrayList;

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

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.tileentity.TileEntitySign;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemWandCopyPaste  extends Item
{
	public ItemWandCopyPaste()
	{  
		super();  
		this.setCreativeTab(ModLoader.tabSamsContent);
    	this.setMaxDamage(99); 
		this.setMaxStackSize(1);
	}
 
	public static void init()
	{
		//if(!ModLoader.configSettings.wandCopy) {return;}//TODO: config
		ItemRegistry.wandCopy = new ItemWandCopyPaste();

		SamsRegistry.registerItem(ItemRegistry.wandCopy, "wand_copy");
  
	}

	public static void copySign(World world, EntityPlayer entityPlayer,	TileEntitySign sign, ItemStack held) 
	{  
		SamsUtilities.setItemStackNBT(held, "sign_0", sign.signText[0].getUnformattedText());
		SamsUtilities.setItemStackNBT(held, "sign_1", sign.signText[1].getUnformattedText());
		SamsUtilities.setItemStackNBT(held, "sign_2", sign.signText[2].getUnformattedText());
		SamsUtilities.setItemStackNBT(held, "sign_3", sign.signText[3].getUnformattedText());

		entityPlayer.swingItem();
		 
	}

	public static void pasteSign(World world, EntityPlayer entityPlayer,	TileEntitySign sign, ItemStack held) 
	{ 
 
		//sign.setPlayer(entityPlayer);
		sign.signText[0] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_0"));
		sign.signText[1] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_1"));
		sign.signText[2] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_2"));
		sign.signText[3] = new ChatComponentText(SamsUtilities.getItemStackNBT(held, "sign_3"));

		//sign.setEditable(false);
		entityPlayer.swingItem();
	 
		world.markBlockForUpdate(sign.getPos());//so update is refreshed on client side
 
	}
 
	 
	 
}
{'fraction_non_alphanumeric': 0.11633767324653507, 'fraction_numerical': 0.007979840403191937, 'mean_word_length': 6.151651651651652, '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': '4112050', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1622, 'n_words': 249}