package com.acethewildfire.acesbs;

import com.acethewildfire.acesbs.block.FireOakBlocks;
import com.acethewildfire.acesbs.block.LemonWoodBlocks;
import com.acethewildfire.acesbs.block.ModBlocks;
import com.acethewildfire.acesbs.entity.ModEntities;
import com.acethewildfire.acesbs.entity.client.CombustibleLemonModel;
import com.acethewildfire.acesbs.entity.client.CombustibleLemonRenderer;
import com.acethewildfire.acesbs.entity.client.FrenModel;
import com.acethewildfire.acesbs.entity.client.FrenRenderer;
import com.acethewildfire.acesbs.particle.GreenFlame;
import com.acethewildfire.acesbs.particle.ModParticles;
import com.acethewildfire.acesbs.particle.PurpleFlame;
import com.acethewildfire.acesbs.screen.ModScreenHandlers;
import com.acethewildfire.acesbs.screen.custom.EntropicEntanglerScreen;
import com.acethewildfire.acesbs.screen.custom.EntropicEvisceratorScreen;
import com.acethewildfire.acesbs.screen.custom.EntropicStabilizerScreen;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.client.render.BlockRenderLayer;
import net.minecraft.client.render.entity.SkeletonEntityRenderer;

public class AcesBSClient implements ClientModInitializer {
    @Override
    public void onInitializeClient() {
        BlockRenderLayerMap.putBlock(LemonWoodBlocks.LEMONWOOD_DOOR, BlockRenderLayer.TRANSLUCENT);
        BlockRenderLayerMap.putBlock(LemonWoodBlocks.LEMONWOOD_TRAPDOOR, BlockRenderLayer.TRANSLUCENT);
        BlockRenderLayerMap.putBlock(ModBlocks.CRYSTAL_ENTROPY, BlockRenderLayer.TRANSLUCENT);
        BlockRenderLayerMap.putBlock(ModBlocks.CRYSTAL_ENTROPY_PANE, BlockRenderLayer.TRANSLUCENT);
        BlockRenderLayerMap.putBlock(ModBlocks.TOBACCO_CROP, BlockRenderLayer.CUTOUT);
        BlockRenderLayerMap.putBlock(LemonWoodBlocks.LEMONWOOD_SAPLING, BlockRenderLayer.CUTOUT);
        BlockRenderLayerMap.putBlock(LemonWoodBlocks.POTTED_LEMONWOOD_SAPLING, BlockRenderLayer.CUTOUT);
        BlockRenderLayerMap.putBlock(FireOakBlocks.FIRE_OAK_SAPLING, BlockRenderLayer.CUTOUT);
        BlockRenderLayerMap.putBlock(FireOakBlocks.POTTED_FIRE_OAK_SAPLING, BlockRenderLayer.CUTOUT);

        EntityModelLayerRegistry.registerModelLayer(FrenModel.FREN, FrenModel::getTexturedModelData);
        EntityRendererRegistry.register(ModEntities.FREN, FrenRenderer::new);
        EntityRendererRegistry.register(ModEntities.VULGAR_BONES, SkeletonEntityRenderer::new);

        EntityModelLayerRegistry.registerModelLayer(CombustibleLemonModel.C_LEMON, CombustibleLemonModel::getTexturedModelData);
        EntityRendererRegistry.register(ModEntities.C_LEMON, CombustibleLemonRenderer::new);

        HandledScreens.register(ModScreenHandlers.ENTROPIC_STABILIZER_SCREEN_HANDLER, EntropicStabilizerScreen::new);
        HandledScreens.register(ModScreenHandlers.ENTROPIC_EVISCERATOR_SCREEN_HANDLER, EntropicEvisceratorScreen::new);
        HandledScreens.register(ModScreenHandlers.ENTROPIC_ENTANGLER_SCREEN_HANDLER, EntropicEntanglerScreen::new);

        ParticleFactoryRegistry.getInstance().register(ModParticles.PURPLE_FLAME, PurpleFlame.Factory::new);
        ParticleFactoryRegistry.getInstance().register(ModParticles.GREEN_FLAME, GreenFlame.Factory::new);
    }
}
