package totemic_commons.pokefenn;

import static totemic_commons.pokefenn.Totemic.logger;

import java.util.Random;

import org.apache.logging.log4j.Level;
import org.lwjgl.opengl.Display;

import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import totemic_commons.pokefenn.client.rendering.entity.BaykokRendering;
import totemic_commons.pokefenn.client.rendering.entity.BuffaloRendering;
import totemic_commons.pokefenn.client.rendering.entity.InvisArrowRendering;
import totemic_commons.pokefenn.client.rendering.tileentity.TileWindChimeRenderer;
import totemic_commons.pokefenn.entity.animal.EntityBuffalo;
import totemic_commons.pokefenn.entity.boss.EntityBaykok;
import totemic_commons.pokefenn.entity.projectile.EntityInvisArrow;
import totemic_commons.pokefenn.event.GameOverlay;
import totemic_commons.pokefenn.tileentity.music.TileWindChime;
import totemic_commons.pokefenn.totempedia.LexiconData;

public class ClientProxy extends CommonProxy
{
    @Override
    public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);
        RenderingRegistry.registerEntityRenderingHandler(EntityBuffalo.class, BuffaloRendering::new);
        RenderingRegistry.registerEntityRenderingHandler(EntityInvisArrow.class, InvisArrowRendering::new);
        RenderingRegistry.registerEntityRenderingHandler(EntityBaykok.class, BaykokRendering::new);
        ModBlocks.setStateMappers();
        ModBlocks.setItemModels();
        ModItems.setItemModels();
        OBJLoader.INSTANCE.addDomain(Totemic.MOD_ID);
    }

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

    @Override
    public void postInit(FMLPostInitializationEvent event)
    {
        super.postInit(event);
        try
        {
            if(Loader.isModLoaded("Botania") && new Random().nextInt(8) == 0)
                Display.setTitle(Display.getTitle().replace("Minecraft", "Floweycraft")); //HAHAHAHAHAHAHAHAHAHAHA...
        }
        catch(Exception e)
        {
            logger.catching(Level.WARN, e);
        }
    }

    @Override
    protected void registerEventHandlers()
    {
        super.registerEventHandlers();
        MinecraftForge.EVENT_BUS.register(new GameOverlay());
    }

    private void initTESRs()
    {
        ClientRegistry.bindTileEntitySpecialRenderer(TileWindChime.class, new TileWindChimeRenderer());
    }
}

@@ -183,16 +183,284 @@
 splay;%0A%0A
+import net.minecraft.block.state.IBlockState;%0Aimport net.minecraft.client.Minecraft;%0Aimport net.minecraft.client.renderer.color.IBlockColor;%0Aimport net.minecraft.util.math.BlockPos;%0Aimport net.minecraft.world.ColorizerFoliage;%0Aimport net.minecraft.world.IBlockAccess;%0A
 import n
@@ -2374,24 +2374,55 @@
 ata.init();%0A
+        registerBlockColors();%0A
     %7D%0A%0A    @
@@ -3019,24 +3019,435 @@
 ());%0A    %7D%0A%0A
+    private void registerBlockColors()%0A    %7B%0A        Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new IBlockColor()%0A        %7B%0A            @Override%0A            public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex)%0A            %7B%0A                return ColorizerFoliage.getFoliageColorPine();%0A            %7D%0A        %7D, ModBlocks.totemLeaves);%0A    %7D%0A%0A
     private 

Fix pale leaves color