<commit_before>package talecraft.proxy;

import java.util.concurrent.ConcurrentLinkedDeque;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMerchant;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.client.event.RenderHandEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
import talecraft.TaleCraft;
import talecraft.TaleCraftItems;
import talecraft.client.ClientKeyboardHandler;
import talecraft.client.ClientNetworkHandler;
import talecraft.client.ClientRenderer;
import talecraft.client.ClientSettings;
import talecraft.client.InfoBar;
import talecraft.client.InvokeTracker;
import talecraft.client.commands.TaleCraftClientCommands;
import talecraft.client.gui.entity.npc.GuiNPCMerchant;
import talecraft.client.render.metaworld.CustomPaintingRender;
import talecraft.client.render.metaworld.PasteItemRender;
import talecraft.client.render.renderables.SelectionBoxRenderer;
import talecraft.client.render.renderers.ItemMetaWorldRenderer;
import talecraft.clipboard.ClipboardItem;
import talecraft.entity.NPC.NPCShop;

public class ClientProxy extends CommonProxy {
	// All the singletons!
	public static final Minecraft mc = Minecraft.getMinecraft();
	public static final ClientSettings settings = new ClientSettings();
	public static ClientProxy proxy = (ClientProxy) TaleCraft.proxy;

	// tc internals
	private ClipboardItem currentClipboardItem;
	private InfoBar infoBarInstance;
	private InvokeTracker invokeTracker;
	private ClientNetworkHandler clientNetworkHandler;
	private ClientKeyboardHandler clientKeyboardHandler;
	private ClientRenderer clientRenderer;
	private ConcurrentLinkedDeque<Runnable> clientTickQeue;
	
	//Client settings
	public GameRules gamerules;

	@Override
	public void preInit(FMLPreInitializationEvent event) {
		super.preInit(event);

		settings.init();

		MinecraftForge.EVENT_BUS.register(this);

		clientKeyboardHandler = new ClientKeyboardHandler(this);
		TaleCraftClientCommands.init();

		clientTickQeue = new ConcurrentLinkedDeque<Runnable>();
		clientRenderer = new ClientRenderer(this);
		clientRenderer.preInit();
	}

	@Override
	public void init(FMLInitializationEvent event) {
		super.init(event);

		// create client network'er
		clientNetworkHandler = new ClientNetworkHandler(this);

		// create client renderer
		clientRenderer.init();
		// add all static renderers
		clientRenderer.addStaticRenderer(new SelectionBoxRenderer());
		
	} // init(..){}

	@Override
	public void postInit(FMLPostInitializationEvent event) {
		super.postInit(event);

		// Create the InfoBar Instance
		infoBarInstance = new InfoBar();

		// Create the invoke tracker instance
		invokeTracker = new InvokeTracker();
		
		ItemMetaWorldRenderer.ITEM_RENDERS.put(TaleCraftItems.paste, new PasteItemRender());
		ItemMetaWorldRenderer.ITEM_RENDERS.put(TaleCraftItems.custompainting, new CustomPaintingRender());
		
		gamerules = new GameRules();
	}

	@SubscribeEvent
	public void worldPass(RenderWorldLastEvent event) {
		clientRenderer.on_render_world_post(event);
	}
	
	private NPCShop lastOpened;
	
	
	@SubscribeEvent<commit_msg>Added resource-reload listener to ClientProxy.<commit_after>package talecraft.proxy;

import java.util.concurrent.ConcurrentLinkedDeque;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMerchant;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.resources.IReloadableResourceManager;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.resources.IResourceManagerReloadListener;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.client.event.RenderHandEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
import talecraft.TaleCraft;
import talecraft.TaleCraftItems;
import talecraft.client.ClientKeyboardHandler;
import talecraft.client.ClientNetworkHandler;
import talecraft.client.ClientRenderer;
import talecraft.client.ClientSettings;
import talecraft.client.InfoBar;
import talecraft.client.InvokeTracker;
import talecraft.client.commands.TaleCraftClientCommands;
import talecraft.client.environment.Environments;
import talecraft.client.gui.entity.npc.GuiNPCMerchant;
import talecraft.client.render.metaworld.CustomPaintingRender;
import talecraft.client.render.metaworld.PasteItemRender;
import talecraft.client.render.renderables.SelectionBoxRenderer;
import talecraft.client.render.renderers.ItemMetaWorldRenderer;
import talecraft.clipboard.ClipboardItem;
import talecraft.entity.NPC.NPCShop;

public class ClientProxy extends CommonProxy implements IResourceManagerReloadListener {
	// All the singletons!
	public static final Minecraft mc = Minecraft.getMinecraft();
	public static final ClientSettings settings = new ClientSettings();
	public static ClientProxy proxy = (ClientProxy) TaleCraft.proxy;

	// tc internals
	private ClipboardItem currentClipboardItem;
	private InfoBar infoBarInstance;
	private InvokeTracker invokeTracker;
	private ClientNetworkHandler clientNetworkHandler;
	private ClientKeyboardHandler clientKeyboardHandler;
	private ClientRenderer clientRenderer;
	private ConcurrentLinkedDeque<Runnable> clientTickQeue;
	
	//Client settings
	public GameRules gamerules;

	@Override
	public void preInit(FMLPreInitializationEvent event) {
		super.preInit(event);

		settings.init();

		MinecraftForge.EVENT_BUS.register(this);

		clientKeyboardHandler = new ClientKeyboardHandler(this);
		TaleCraftClientCommands.init();

		IReloadableResourceManager resManager = (IReloadableResourceManager) mc.getResourceManager();
		resManager.registerReloadListener(this);
		
		clientTickQeue = new ConcurrentLinkedDeque<Runnable>();
		clientRenderer = new ClientRenderer(this);
		clientRenderer.preInit();
	}

	@Override
	public void init(FMLInitializationEvent event) {
		super.init(event);

		// create client network'er
		clientNetworkHandler = new ClientNetworkHandler(this);

		// create client renderer
		clientRenderer.init();
		// add all static renderers
		clientRenderer.addStaticRenderer(new SelectionBoxRenderer());
		
	} // init(..){}

	@Override
	public void postInit(FMLPostInitializationEvent event) {
		super.postInit(event);

		// Create the InfoBar Instance
		infoBarInstance = new InfoBar();

		// Create the invoke tracker instance
		invokeTracker = new InvokeTracker();
		
		ItemMetaWorldRenderer.ITEM_RENDERS.put(TaleCraftItems.paste, new PasteItemRender());
		ItemMetaWorldRenderer.ITEM_RENDERS.put(TaleCraftItems.custompainting, new CustomPaintingRender());
		
		gamerules = new GameRules();
	}

	@Override
	public void onResourceManagerReload(IResourceManager resourceManager) {
		// Environments.reload(resourceManager);
	}

	@SubscribeEvent
	public void worldPass(RenderWorldLastEvent event) {
		clientRenderer.on_render_world_post(event);
	}
	
	private NPCShop lastOpened;
	
	
	@SubscribeEvent
{'fraction_non_alphanumeric': 0.08372697213037317, 'fraction_numerical': 0.0, 'mean_word_length': 6.7483989021043005, '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': '7142106', 'n_tokens_mistral': 2586, 'n_tokens_neox': 2477, 'n_words': 446}