package redpandaka.aquaticraft.client.render;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import redpandaka.aquaticraft.blocks.ModBlocks;

import static redpandaka.aquaticraft.ModInfo.ID;

public final class BlockRenderRegister {

    private static RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();

    public static void registerBlockRenderer() {
        for (final ModBlocks block : ModBlocks.values()) {
            register(block);
        }
    }

    private static void register(final ModBlocks block) {
        renderItem.getItemModelMesher().register(Item.getItemFromBlock(block.getInstance()), 0,
                new ModelResourceLocation(ID + ":" + block.getUnlocalizedName(), "inventory"));
    }

}