package org.cyclops.cyclopscore.config.extendedconfig;

import net.minecraft.fluid.Fluid;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.IForgeRegistry;
import org.cyclops.cyclopscore.config.ConfigurableType;
import org.cyclops.cyclopscore.init.ModBase;

import javax.annotation.Nullable;
import java.util.function.Function;

/**
 * Config for fluids.
 * @author rubensworks
 * @see ExtendedConfig
 */
public abstract class FluidConfig extends ExtendedConfigForge<FluidConfig, Fluid> {

    /**
     * Make a new instance.
     * @param mod     The mod instance.
     * @param namedId The unique name ID for the configurable.
     * @param elementConstructor The element constructor.
     */
    public FluidConfig(ModBase mod, String namedId, Function<FluidConfig, ? extends Fluid> elementConstructor) {
        super(mod, namedId, elementConstructor);
    }

    @Override
	public String getTranslationKey() {
		return "fluid.fluids." + getMod().getModId() + "." + getNamedId();
	}
    
    @Override
	public ConfigurableType getConfigurableType() {
		return ConfigurableType.FLUID;
	}

    /**
     * Get the still icon location.
     * @return The icon location.
     */
    public ResourceLocation getIconLocationStill() {
        return new ResourceLocation(getMod().getModId(), "blocks/" + getNamedId() + "_still");
    }

    /**
     * Get the flow icon location.
     * @return The icon location.
     */
    public ResourceLocation getIconLocationFlow() {
        return new ResourceLocation(getMod().getModId(), "blocks/" + getNamedId() + "_flow");
    }

    @Nullable
    @Override
    public IForgeRegistry<Fluid> getRegistry() {
        return ForgeRegistries.FLUIDS;
    }
}

@@ -127,16 +127,118 @@
 cation;%0A
+import net.minecraftforge.fluids.FluidAttributes;%0Aimport net.minecraftforge.fluids.ForgeFlowingFluid;%0A
 import n
@@ -279,24 +279,24 @@
 Registries;%0A
-
 import net.m
@@ -392,16 +392,70 @@
 leType;%0A
+import org.cyclops.cyclopscore.datastructure.Wrapper;%0A
 import o
@@ -526,16 +526,52 @@
 llable;%0A
+import java.util.function.Consumer;%0A
 import j
@@ -1074,24 +1074,24 @@
 structor) %7B%0A
-
         supe
@@ -1130,24 +1130,952 @@
 or);%0A    %7D%0A%0A
+    protected static ForgeFlowingFluid.Properties getDefaultFluidProperties(ModBase mod, String texturePrefixPath,%0A                                                                            Consumer%3CFluidAttributes.Builder%3E fluidAttributesConsumer) %7B%0A        FluidAttributes.Builder fluidAttributes = FluidAttributes.builder(%0A                new ResourceLocation(mod.getModId(), texturePrefixPath + %22_still.png%22),%0A                new ResourceLocation(mod.getModId(), texturePrefixPath + %22_flow.png%22)%0A        );%0A        fluidAttributesConsumer.accept(fluidAttributes);%0A%0A        Wrapper%3CForgeFlowingFluid.Properties%3E properties = new Wrapper%3C%3E();%0A        properties.set(new ForgeFlowingFluid.Properties(%0A                () -%3E new ForgeFlowingFluid.Source(properties.get()),%0A                () -%3E new ForgeFlowingFluid.Flowing(properties.get()),%0A                fluidAttributes%0A        ));%0A        return properties.get();%0A    %7D%0A%0A
     @Overrid

Add default fluid properties helper in FluidConfig