package trinity.proxy;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;

import com.google.common.collect.Ordering;

import nc.radiation.RadSources;
import nc.recipe.NCRecipes;
import nc.recipe.ingredient.OreIngredient;
import trinity.Trinity;
import trinity.fluid.TrinityFluids;
import trinity.gui.GuiHandlerRegistry;
import trinity.gui.GuiHandlerTrinity;
//import trinity.fluid.TrinityFluids;
import trinity.handler.OredictHandler;
import trinity.init.ModBlocks;
import trinity.init.ModItems;
import trinity.init.TrinityEntities;
import trinity.init.TrinityRecipes;
import trinity.radiation.RadiationHandler;
import trinity.tiles.TileEntityShieldedContainer;
import trinity.world.TrinityBiomes;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLModIdMappingEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.IGuiHandler;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class CommonProxy {

	public void preInit(FMLPreInitializationEvent preEvent) {
		ModItems.init();
		TrinityFluids.registerFluids();
		TrinityFluids.init();
		TrinityFluids.register();
		ModBlocks.init();	
		ModItems.register();
		ModBlocks.register();
		OredictHandler.registerOres();
		MinecraftForge.EVENT_BUS.register(new TrinityRecipes());
		GuiHandlerRegistry.getInstance().registerGuiHandler(new GuiHandlerTrinity(), GuiHandlerTrinity.getGuiID());
		GameRegistry.registerTileEntity(TileEntityShieldedContainer.class, "trinity:tile_inventory_basic");
		//TrinityRecipes.init();
	}

	public void registerRenderInfo()
	{
		
	}

	public void init(FMLInitializationEvent event) {
		RadiationHandler.radiation();
		//TrinityRecipes.init();
		TrinityEntities.register();
		TrinityBiomes.initBiomeManagerAndDictionary();
	}

	public void postInit(FMLPostInitializationEvent postEvent) {
		
	}
	
	public void onIdMapping(FMLModIdMappingEvent idMappingEvent) 
	{
		//QMDRecipes.refreshRecipeCaches();
		RadiationHandler.radiation();
	}

	public void registerRenders() {

	}
	
	public void registerFluidBlockRendering(Block block, String name) 
	{
		name = name.toLowerCase(Locale.ROOT);
	}
}