package moe.hazu.tinkeringabnormally.data.sprite;

import moe.hazu.tinkeringabnormally.data.material.MaterialIds;
import slimeknights.tconstruct.library.client.data.material.AbstractMaterialSpriteProvider;
import slimeknights.tconstruct.library.client.data.spritetransformer.GreyToColorMapping;
import slimeknights.tconstruct.library.materials.definition.MaterialVariantId;

import static slimeknights.tconstruct.tools.data.sprite.TinkerPartSpriteProvider.WOOD;

public class TinkerMaterialSpriteProvider extends AbstractMaterialSpriteProvider {

    @Override
    public String getName() {
        return "Tinkers' Construct Materials";
    }

    @Override
    protected void addAllMaterials() {
        buildPlanks(MaterialIds.willow).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF323926).addARGB(102, 0xFF3C472B).addARGB(140, 0xFF4D593A).addARGB(178, 0xFF59633F).addARGB(216, 0xFF586645).addARGB(234, 0xFF657751).addARGB(255, 0xFF698450).build());
        buildPlanks(MaterialIds.pine).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF6A5041).addARGB(102, 0xFF755646).addARGB(140, 0xFF7F5D4B).addARGB(178, 0xFF8E7253).addARGB(216, 0xFF9A7C5E).addARGB(234, 0xFFB4956C).addARGB(255,0xFFC6A175).build());
        buildPlanks(MaterialIds.cherry).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF2C1411).addARGB(102, 0xFF351713).addARGB(140, 0xFF3D1A16).addARGB(178, 0xFF421D17).addARGB(216, 0xFF4F221B).addARGB(234, 0xFF602822).addARGB(255, 0xFF6B2C26).build());
        buildPlanks(MaterialIds.wisteria).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF806850).addARGB(102, 0xFF957863).addARGB(140, 0xFF9C816D).addARGB(178, 0xFFAC9872).addARGB(216, 0xFFB8A784).addARGB(234, 0xFFD9D1B6).addARGB(255, 0xFFE0DCBD).build());
        buildPlanks(MaterialIds.rosewood).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF363130).addARGB(102, 0xFF443835).addARGB(140, 0xFF4A4340).addARGB(178, 0xFF5A4443).addARGB(216, 0xFF604B4B).addARGB(234, 0xFF765D60).addARGB(255, 0xFF876569).build());
        buildPlanks(MaterialIds.morado).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF261719).addARGB(102, 0xFF31191C).addARGB(140, 0xFF382023).addARGB(178, 0xFF462724).addARGB(216, 0xFF542F33).addARGB(234, 0xFF6A3E47).addARGB(255, 0xFF7E474D).build());
        buildPlanks(MaterialIds.yucca).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF412B25).addARGB(102, 0xFF4C2E25).addARGB(140, 0xFF5B382D).addARGB(178, 0xFF6D4336).addARGB(216, 0xFF7F4B3D).addARGB(234, 0xFF996458).addARGB(255, 0xFFAF735F).build());
        buildPlanks(MaterialIds.aspen).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF5F4239).addARGB(102, 0xFF6A4133).addARGB(140, 0xFF775746).addARGB(178, 0xFF8F673F).addARGB(216, 0xFF967751).addARGB(234, 0xFFC19F5B).addARGB(255, 0xFFE8AF4E).build());
        buildPlanks(MaterialIds.laurel).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF442F22).addARGB(102, 0xFF4F4031).addARGB(140, 0xFF584530).addARGB(178, 0xFF634F3D).addARGB(216, 0xFF715B45).addARGB(234, 0xFF94794F).addARGB(255, 0xFFA7864E).build());
        buildPlanks(MaterialIds.kousa).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF3B4C46).addARGB(102, 0xFF485450).addARGB(140, 0xFF505654).addARGB(178, 0xFF4F6059).addARGB(216, 0xFF596B62).addARGB(234, 0xFF6E8277).addARGB(255, 0xFF789283).build());
        buildPlanks(MaterialIds.grimwood).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF030102).addARGB(102, 0xFF0B0405).addARGB(140, 0xFF0f0406).addARGB(178, 0xFF160B0F).addARGB(216, 0xFF1B1112).addARGB(234, 0xFF281918).addARGB(255, 0xFF2E201E).build());
        buildPlanks(MaterialIds.driftwood).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF272825).addARGB(102, 0xFF30302C).addARGB(140, 0xFF393A34).addARGB(178, 0xFF4A463C).addARGB(216, 0xFF555048).addARGB(234, 0xFF676057).addARGB(255, 0xFF756D60).build());
        buildPlanks(MaterialIds.river).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF3E3423).addARGB(102, 0xFF423221).addARGB(140, 0xFF443327).addARGB(178, 0xFF543d24).addARGB(216, 0xFF5E4832).addARGB(234, 0xFF6D5446).addARGB(255, 0xFF7F5E4B).build());
        buildPlanks(MaterialIds.azalea).colorMapper(GreyToColorMapping.builderFromBlack().addARGB(63, 0xFF1A1D2C).addARGB(102, 0xFF16202C).addARGB(140, 0xFF1E2338).addARGB(178, 0xFF1F2E3A).addARGB(216, 0xFF273538).addARGB(234, 0xFF374051).addARGB(255, 0xFF41476B).build());
    }

    private MaterialSpriteInfoBuilder buildPlanks(MaterialVariantId material) {
        return buildMaterial(material)
                .meleeHarvest().ranged().shieldCore().statType(WOOD)
                .fallbacks("wood", "stick", "primitive");
    }
}
