
package net.mcreator.sebmod.fluid;

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

import net.minecraft.world.phys.Vec3;
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.world.level.BlockGetter;
import net.minecraft.world.item.Rarity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.BlockPos;

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

public abstract class SusFuelFluid extends ForgeFlowingFluid {
	public static final ForgeFlowingFluid.Properties PROPERTIES = new ForgeFlowingFluid.Properties(SebModModFluids.SUS_FUEL,
			SebModModFluids.FLOWING_SUS_FUEL,
			SusFuelFluidAttributes
					.builder(new ResourceLocation("seb_mod:blocks/sussyportalblock"), new ResourceLocation("seb_mod:blocks/sussyportalblock"))

					.viscosity(500)

					.rarity(Rarity.UNCOMMON).sound(ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("seb_mod:susbucketempty")))
					.color(-13083194))
			.explosionResistance(100f).canMultiply().tickRate(11)

			.slopeFindDistance(12).bucket(SebModModItems.SUS_FUEL_BUCKET).block(() -> (LiquidBlock) SebModModBlocks.SUS_FUEL.get());

	private SusFuelFluid() {
		super(PROPERTIES);
	}

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

	@Override
	public Vec3 getFlow(BlockGetter world, BlockPos pos, FluidState fluidstate) {
		return super.getFlow(world, pos, fluidstate).scale(2);
	}

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

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

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

	public static class Flowing extends SusFuelFluid {
		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;
		}
	}
}
