package net.minecraft.client.renderer;

import net.minecraft.Util;
import com.google.common.collect.Maps;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.material.Fluids;
import java.util.HashMap;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.block.Block;
import java.util.Map;

public class ItemBlockRenderTypes {
    private static final Map<Block, RenderType> TYPE_BY_BLOCK;
    private static final Map<Fluid, RenderType> TYPE_BY_FLUID;
    private static boolean renderCutout;
    
    public static RenderType getChunkRenderType(final BlockState byj) {
        final Block bph2 = byj.getBlock();
        if (bph2 instanceof LeavesBlock) {
            return ItemBlockRenderTypes.renderCutout ? RenderType.cutoutMipped() : RenderType.solid();
        }
        final RenderType drb3 = ItemBlockRenderTypes.TYPE_BY_BLOCK.get(bph2);
        if (drb3 != null) {
            return drb3;
        }
        return RenderType.solid();
    }
    
    public static RenderType getRenderType(final BlockState byj) {
        final RenderType drb2 = getChunkRenderType(byj);
        if (drb2 == RenderType.translucent()) {
            return Sheets.translucentBlockSheet();
        }
        return Sheets.cutoutBlockSheet();
    }
    
    public static RenderType getRenderType(final ItemStack ben) {
        final Item bei2 = ben.getItem();
        if (bei2 instanceof BlockItem) {
            final Block bph3 = ((BlockItem)bei2).getBlock();
            return getRenderType(bph3.defaultBlockState());
        }
        return Sheets.translucentBlockSheet();
    }
    
    public static RenderType getRenderLayer(final FluidState coj) {
        final RenderType drb2 = ItemBlockRenderTypes.TYPE_BY_FLUID.get(coj.getType());
        if (drb2 != null) {
            return drb2;
        }
        return RenderType.solid();
    }
    
    public static void setFancy(final boolean boolean1) {
        ItemBlockRenderTypes.renderCutout = boolean1;
    }
    
    static {
        final RenderType drb2;
        final RenderType drb3;
        final RenderType drb4;
        TYPE_BY_BLOCK = Util.<Map<Block, RenderType>>make(Maps.newHashMap(), hashMap -> {
            drb2 = RenderType.cutoutMipped();
            hashMap.put(Blocks.GRASS_BLOCK, drb2);
            hashMap.put(Blocks.IRON_BARS, drb2);
            hashMap.put(Blocks.GLASS_PANE, drb2);
            hashMap.put(Blocks.TRIPWIRE_HOOK, drb2);
            hashMap.put(Blocks.HOPPER, drb2);
            hashMap.put(Blocks.JUNGLE_LEAVES, drb2);
            hashMap.put(Blocks.OAK_LEAVES, drb2);
            hashMap.put(Blocks.SPRUCE_LEAVES, drb2);
            hashMap.put(Blocks.ACACIA_LEAVES, drb2);
            hashMap.put(Blocks.BIRCH_LEAVES, drb2);
            hashMap.put(Blocks.DARK_OAK_LEAVES, drb2);
            drb3 = RenderType.cutout();
            hashMap.put(Blocks.OAK_SAPLING, drb3);
            hashMap.put(Blocks.SPRUCE_SAPLING, drb3);
            hashMap.put(Blocks.BIRCH_SAPLING, drb3);
            hashMap.put(Blocks.JUNGLE_SAPLING, drb3);
            hashMap.put(Blocks.ACACIA_SAPLING, drb3);
            hashMap.put(Blocks.DARK_OAK_SAPLING, drb3);
            hashMap.put(Blocks.GLASS, drb3);
            hashMap.put(Blocks.WHITE_BED, drb3);
            hashMap.put(Blocks.ORANGE_BED, drb3);
            hashMap.put(Blocks.MAGENTA_BED, drb3);
            hashMap.put(Blocks.LIGHT_BLUE_BED, drb3);
            hashMap.put(Blocks.YELLOW_BED, drb3);
            hashMap.put(Blocks.LIME_BED, drb3);
            hashMap.put(Blocks.PINK_BED, drb3);
            hashMap.put(Blocks.GRAY_BED, drb3);
            hashMap.put(Blocks.LIGHT_GRAY_BED, drb3);
            hashMap.put(Blocks.CYAN_BED, drb3);
            hashMap.put(Blocks.PURPLE_BED, drb3);
            hashMap.put(Blocks.BLUE_BED, drb3);
            hashMap.put(Blocks.BROWN_BED, drb3);
            hashMap.put(Blocks.GREEN_BED, drb3);
            hashMap.put(Blocks.RED_BED, drb3);
            hashMap.put(Blocks.BLACK_BED, drb3);
            hashMap.put(Blocks.POWERED_RAIL, drb3);
            hashMap.put(Blocks.DETECTOR_RAIL, drb3);
            hashMap.put(Blocks.COBWEB, drb3);
            hashMap.put(Blocks.GRASS, drb3);
            hashMap.put(Blocks.FERN, drb3);
            hashMap.put(Blocks.DEAD_BUSH, drb3);
            hashMap.put(Blocks.SEAGRASS, drb3);
            hashMap.put(Blocks.TALL_SEAGRASS, drb3);
            hashMap.put(Blocks.DANDELION, drb3);
            hashMap.put(Blocks.POPPY, drb3);
            hashMap.put(Blocks.BLUE_ORCHID, drb3);
            hashMap.put(Blocks.ALLIUM, drb3);
            hashMap.put(Blocks.AZURE_BLUET, drb3);
            hashMap.put(Blocks.RED_TULIP, drb3);
            hashMap.put(Blocks.ORANGE_TULIP, drb3);
            hashMap.put(Blocks.WHITE_TULIP, drb3);
            hashMap.put(Blocks.PINK_TULIP, drb3);
            hashMap.put(Blocks.OXEYE_DAISY, drb3);
            hashMap.put(Blocks.CORNFLOWER, drb3);
            hashMap.put(Blocks.WITHER_ROSE, drb3);
            hashMap.put(Blocks.LILY_OF_THE_VALLEY, drb3);
            hashMap.put(Blocks.BROWN_MUSHROOM, drb3);
            hashMap.put(Blocks.RED_MUSHROOM, drb3);
            hashMap.put(Blocks.TORCH, drb3);
            hashMap.put(Blocks.WALL_TORCH, drb3);
            hashMap.put(Blocks.FIRE, drb3);
            hashMap.put(Blocks.SPAWNER, drb3);
            hashMap.put(Blocks.REDSTONE_WIRE, drb3);
            hashMap.put(Blocks.WHEAT, drb3);
            hashMap.put(Blocks.OAK_DOOR, drb3);
            hashMap.put(Blocks.LADDER, drb3);
            hashMap.put(Blocks.RAIL, drb3);
            hashMap.put(Blocks.IRON_DOOR, drb3);
            hashMap.put(Blocks.REDSTONE_TORCH, drb3);
            hashMap.put(Blocks.REDSTONE_WALL_TORCH, drb3);
            hashMap.put(Blocks.CACTUS, drb3);
            hashMap.put(Blocks.SUGAR_CANE, drb3);
            hashMap.put(Blocks.REPEATER, drb3);
            hashMap.put(Blocks.OAK_TRAPDOOR, drb3);
            hashMap.put(Blocks.SPRUCE_TRAPDOOR, drb3);
            hashMap.put(Blocks.BIRCH_TRAPDOOR, drb3);
            hashMap.put(Blocks.JUNGLE_TRAPDOOR, drb3);
            hashMap.put(Blocks.ACACIA_TRAPDOOR, drb3);
            hashMap.put(Blocks.DARK_OAK_TRAPDOOR, drb3);
            hashMap.put(Blocks.ATTACHED_PUMPKIN_STEM, drb3);
            hashMap.put(Blocks.ATTACHED_MELON_STEM, drb3);
            hashMap.put(Blocks.PUMPKIN_STEM, drb3);
            hashMap.put(Blocks.MELON_STEM, drb3);
            hashMap.put(Blocks.VINE, drb3);
            hashMap.put(Blocks.LILY_PAD, drb3);
            hashMap.put(Blocks.NETHER_WART, drb3);
            hashMap.put(Blocks.BREWING_STAND, drb3);
            hashMap.put(Blocks.COCOA, drb3);
            hashMap.put(Blocks.BEACON, drb3);
            hashMap.put(Blocks.FLOWER_POT, drb3);
            hashMap.put(Blocks.POTTED_OAK_SAPLING, drb3);
            hashMap.put(Blocks.POTTED_SPRUCE_SAPLING, drb3);
            hashMap.put(Blocks.POTTED_BIRCH_SAPLING, drb3);
            hashMap.put(Blocks.POTTED_JUNGLE_SAPLING, drb3);
            hashMap.put(Blocks.POTTED_ACACIA_SAPLING, drb3);
            hashMap.put(Blocks.POTTED_DARK_OAK_SAPLING, drb3);
            hashMap.put(Blocks.POTTED_FERN, drb3);
            hashMap.put(Blocks.POTTED_DANDELION, drb3);
            hashMap.put(Blocks.POTTED_POPPY, drb3);
            hashMap.put(Blocks.POTTED_BLUE_ORCHID, drb3);
            hashMap.put(Blocks.POTTED_ALLIUM, drb3);
            hashMap.put(Blocks.POTTED_AZURE_BLUET, drb3);
            hashMap.put(Blocks.POTTED_RED_TULIP, drb3);
            hashMap.put(Blocks.POTTED_ORANGE_TULIP, drb3);
            hashMap.put(Blocks.POTTED_WHITE_TULIP, drb3);
            hashMap.put(Blocks.POTTED_PINK_TULIP, drb3);
            hashMap.put(Blocks.POTTED_OXEYE_DAISY, drb3);
            hashMap.put(Blocks.POTTED_CORNFLOWER, drb3);
            hashMap.put(Blocks.POTTED_LILY_OF_THE_VALLEY, drb3);
            hashMap.put(Blocks.POTTED_WITHER_ROSE, drb3);
            hashMap.put(Blocks.POTTED_RED_MUSHROOM, drb3);
            hashMap.put(Blocks.POTTED_BROWN_MUSHROOM, drb3);
            hashMap.put(Blocks.POTTED_DEAD_BUSH, drb3);
            hashMap.put(Blocks.POTTED_CACTUS, drb3);
            hashMap.put(Blocks.CARROTS, drb3);
            hashMap.put(Blocks.POTATOES, drb3);
            hashMap.put(Blocks.COMPARATOR, drb3);
            hashMap.put(Blocks.ACTIVATOR_RAIL, drb3);
            hashMap.put(Blocks.IRON_TRAPDOOR, drb3);
            hashMap.put(Blocks.SUNFLOWER, drb3);
            hashMap.put(Blocks.LILAC, drb3);
            hashMap.put(Blocks.ROSE_BUSH, drb3);
            hashMap.put(Blocks.PEONY, drb3);
            hashMap.put(Blocks.TALL_GRASS, drb3);
            hashMap.put(Blocks.LARGE_FERN, drb3);
            hashMap.put(Blocks.SPRUCE_DOOR, drb3);
            hashMap.put(Blocks.BIRCH_DOOR, drb3);
            hashMap.put(Blocks.JUNGLE_DOOR, drb3);
            hashMap.put(Blocks.ACACIA_DOOR, drb3);
            hashMap.put(Blocks.DARK_OAK_DOOR, drb3);
            hashMap.put(Blocks.END_ROD, drb3);
            hashMap.put(Blocks.CHORUS_PLANT, drb3);
            hashMap.put(Blocks.CHORUS_FLOWER, drb3);
            hashMap.put(Blocks.BEETROOTS, drb3);
            hashMap.put(Blocks.KELP, drb3);
            hashMap.put(Blocks.KELP_PLANT, drb3);
            hashMap.put(Blocks.TURTLE_EGG, drb3);
            hashMap.put(Blocks.DEAD_TUBE_CORAL, drb3);
            hashMap.put(Blocks.DEAD_BRAIN_CORAL, drb3);
            hashMap.put(Blocks.DEAD_BUBBLE_CORAL, drb3);
            hashMap.put(Blocks.DEAD_FIRE_CORAL, drb3);
            hashMap.put(Blocks.DEAD_HORN_CORAL, drb3);
            hashMap.put(Blocks.TUBE_CORAL, drb3);
            hashMap.put(Blocks.BRAIN_CORAL, drb3);
            hashMap.put(Blocks.BUBBLE_CORAL, drb3);
            hashMap.put(Blocks.FIRE_CORAL, drb3);
            hashMap.put(Blocks.HORN_CORAL, drb3);
            hashMap.put(Blocks.DEAD_TUBE_CORAL_FAN, drb3);
            hashMap.put(Blocks.DEAD_BRAIN_CORAL_FAN, drb3);
            hashMap.put(Blocks.DEAD_BUBBLE_CORAL_FAN, drb3);
            hashMap.put(Blocks.DEAD_FIRE_CORAL_FAN, drb3);
            hashMap.put(Blocks.DEAD_HORN_CORAL_FAN, drb3);
            hashMap.put(Blocks.TUBE_CORAL_FAN, drb3);
            hashMap.put(Blocks.BRAIN_CORAL_FAN, drb3);
            hashMap.put(Blocks.BUBBLE_CORAL_FAN, drb3);
            hashMap.put(Blocks.FIRE_CORAL_FAN, drb3);
            hashMap.put(Blocks.HORN_CORAL_FAN, drb3);
            hashMap.put(Blocks.DEAD_TUBE_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.DEAD_BRAIN_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.DEAD_BUBBLE_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.DEAD_FIRE_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.DEAD_HORN_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.TUBE_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.BRAIN_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.BUBBLE_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.FIRE_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.HORN_CORAL_WALL_FAN, drb3);
            hashMap.put(Blocks.SEA_PICKLE, drb3);
            hashMap.put(Blocks.CONDUIT, drb3);
            hashMap.put(Blocks.BAMBOO_SAPLING, drb3);
            hashMap.put(Blocks.BAMBOO, drb3);
            hashMap.put(Blocks.POTTED_BAMBOO, drb3);
            hashMap.put(Blocks.SCAFFOLDING, drb3);
            hashMap.put(Blocks.STONECUTTER, drb3);
            hashMap.put(Blocks.LANTERN, drb3);
            hashMap.put(Blocks.CAMPFIRE, drb3);
            hashMap.put(Blocks.SWEET_BERRY_BUSH, drb3);
            drb4 = RenderType.translucent();
            hashMap.put(Blocks.ICE, drb4);
            hashMap.put(Blocks.NETHER_PORTAL, drb4);
            hashMap.put(Blocks.WHITE_STAINED_GLASS, drb4);
            hashMap.put(Blocks.ORANGE_STAINED_GLASS, drb4);
            hashMap.put(Blocks.MAGENTA_STAINED_GLASS, drb4);
            hashMap.put(Blocks.LIGHT_BLUE_STAINED_GLASS, drb4);
            hashMap.put(Blocks.YELLOW_STAINED_GLASS, drb4);
            hashMap.put(Blocks.LIME_STAINED_GLASS, drb4);
            hashMap.put(Blocks.PINK_STAINED_GLASS, drb4);
            hashMap.put(Blocks.GRAY_STAINED_GLASS, drb4);
            hashMap.put(Blocks.LIGHT_GRAY_STAINED_GLASS, drb4);
            hashMap.put(Blocks.CYAN_STAINED_GLASS, drb4);
            hashMap.put(Blocks.PURPLE_STAINED_GLASS, drb4);
            hashMap.put(Blocks.BLUE_STAINED_GLASS, drb4);
            hashMap.put(Blocks.BROWN_STAINED_GLASS, drb4);
            hashMap.put(Blocks.GREEN_STAINED_GLASS, drb4);
            hashMap.put(Blocks.RED_STAINED_GLASS, drb4);
            hashMap.put(Blocks.BLACK_STAINED_GLASS, drb4);
            hashMap.put(Blocks.TRIPWIRE, drb4);
            hashMap.put(Blocks.WHITE_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.ORANGE_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.MAGENTA_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.LIGHT_BLUE_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.YELLOW_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.LIME_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.PINK_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.GRAY_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.LIGHT_GRAY_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.CYAN_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.PURPLE_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.BLUE_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.BROWN_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.GREEN_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.RED_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.BLACK_STAINED_GLASS_PANE, drb4);
            hashMap.put(Blocks.SLIME_BLOCK, drb4);
            hashMap.put(Blocks.HONEY_BLOCK, drb4);
            hashMap.put(Blocks.FROSTED_ICE, drb4);
            hashMap.put(Blocks.BUBBLE_COLUMN, drb4);
            return;
        });
        final RenderType drb5;
        TYPE_BY_FLUID = Util.<Map<Fluid, RenderType>>make(Maps.newHashMap(), hashMap -> {
            drb5 = RenderType.translucent();
            hashMap.put(Fluids.FLOWING_WATER, drb5);
            hashMap.put(Fluids.WATER, drb5);
        });
    }
}
