
package net.mcreator.sebmod.fluid;

import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.fluids.ForgeFlowingFluid;

import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.core.particles.ParticleOptions;

import net.mcreator.sebmod.init.SebModModItems;
import net.mcreator.sebmod.init.SebModModFluids;
import net.mcreator.sebmod.init.SebModModBlocks;
import net.mcreator.sebmod.fluid.attributes.DirtyWaterFluidAttributes;

public abstract class DirtyWaterFluid extends ForgeFlowingFluid {
	public static final ForgeFlowingFluid.Properties PROPERTIES = new ForgeFlowingFluid.Properties(SebModModFluids.DIRTY_WATER,
			SebModModFluids.FLOWING_DIRTY_WATER,
			DirtyWaterFluidAttributes
					.builder(new ResourceLocation("seb_mod:blocks/dirtywaterstill"), new ResourceLocation("seb_mod:blocks/dirtywaterflowing"))

					.viscosity(196)

					.sound(ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("item.bucket.empty_powder_snow"))).color(-13083194))
			.explosionResistance(100f).canMultiply()

			.bucket(SebModModItems.DIRTY_WATER_BUCKET).block(() -> (LiquidBlock) SebModModBlocks.DIRTY_WATER.get());

	private DirtyWaterFluid() {
		super(PROPERTIES);
	}

	@Override
	public ParticleOptions getDripParticle() {
		return ParticleTypes.FALLING_WATER;
	}

	public static class Source extends DirtyWaterFluid {
		public Source() {
			super();
		}

		public int getAmount(FluidState state) {
			return 8;
		}

		public boolean isSource(FluidState state) {
			return true;
		}
	}

	public static class Flowing extends DirtyWaterFluid {
		public Flowing() {
			super();
		}

		protected void createFluidStateDefinition(StateDefinition.Builder<Fluid, FluidState> builder) {
			super.createFluidStateDefinition(builder);
			builder.add(LEVEL);
		}

		public int getAmount(FluidState state) {
			return state.getValue(LEVEL);
		}

		public boolean isSource(FluidState state) {
			return false;
		}
	}
}
