package dev.halbear1.supernova.custom.fluid;

import dev.halbear1.supernova.registry.blocks.ModBlocks;
import jdk.nashorn.internal.ir.Block;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Rarity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.fluids.FluidAttributes;

import java.util.function.BiFunction;

public class SupernovaFluidAttributes {

    private final boolean flammable;
    private final boolean ExpandsGas;
    private final ResourceLocation OverlayTexture;

    protected SupernovaFluidAttributes(SupernovaFluidBuilder ExtendedBuilder, Fluid fluid) {
        this.flammable = ExtendedBuilder.flammable;
        this.ExpandsGas = ExtendedBuilder.ExpandsGas;
        this.OverlayTexture = ExtendedBuilder.OverlayTexture;
    }

    public static SupernovaFluidBuilder Supernovabuilder(ResourceLocation OVERLAY_TEXTURE) {
        return new SupernovaFluidBuilder(OVERLAY_TEXTURE, SupernovaFluidAttributes::new);
    }

    public static class SupernovaFluidBuilder {

        private ResourceLocation OverlayTexture;
        private boolean flammable;
        private boolean ExpandsGas;

        private BiFunction<SupernovaFluidBuilder, Fluid, SupernovaFluidAttributes> factory;

        protected SupernovaFluidBuilder(ResourceLocation OVERLAY_TEXTURE, BiFunction<SupernovaFluidBuilder, Fluid, SupernovaFluidAttributes> factory) {
            this.factory = factory;
            this.OverlayTexture = OVERLAY_TEXTURE;
        }

        public final SupernovaFluidBuilder Flammable() {
            this.flammable = true;
            return this;
        }

        public final SupernovaFluidBuilder GasExpands() {
            this.ExpandsGas = true;
            return this;
        }
    }

}
