Class FluidType.Properties

java.lang.Object
net.minecraftforge.fluids.FluidType.Properties
Enclosing class:
FluidType

public static final class FluidType.Properties extends Object
The properties of the fluid. The simple forms of each property can be specified while more complex logic can be overridden in the FluidType.
  • Field Details

    • descriptionId

      private String descriptionId
    • motionScale

      private double motionScale
    • canPushEntity

      private boolean canPushEntity
    • canSwim

      private boolean canSwim
    • canDrown

      private boolean canDrown
    • fallDistanceModifier

      private float fallDistanceModifier
    • canExtinguish

      private boolean canExtinguish
    • canConvertToSource

      private boolean canConvertToSource
    • supportsBoating

      private boolean supportsBoating
    • pathType

      @Nullable private @Nullable BlockPathTypes pathType
    • adjacentPathType

      @Nullable private @Nullable BlockPathTypes adjacentPathType
    • sounds

      private final Map<SoundAction,SoundEvent> sounds
    • canHydrate

      private boolean canHydrate
    • lightLevel

      private int lightLevel
    • density

      private int density
    • temperature

      private int temperature
    • viscosity

      private int viscosity
    • rarity

      private Rarity rarity
  • Constructor Details

    • Properties

      private Properties()
  • Method Details

    • create

      public static FluidType.Properties create()
      Creates a new instance of the properties.
      Returns:
      the property holder instance
    • descriptionId

      public FluidType.Properties descriptionId(String descriptionId)
      Sets the identifier representing the name of the fluid type.
      Parameters:
      descriptionId - the identifier representing the name of the fluid type
      Returns:
      the property holder instance
    • motionScale

      public FluidType.Properties motionScale(double motionScale)
      Sets how much the velocity of the fluid should be scaled by.
      Parameters:
      motionScale - a scalar to multiply to the fluid velocity
      Returns:
      the property holder instance
    • canPushEntity

      public FluidType.Properties canPushEntity(boolean canPushEntity)
      Sets whether the fluid can push an entity.
      Parameters:
      canPushEntity - if the fluid can push an entity
      Returns:
      the property holder instance
    • canSwim

      public FluidType.Properties canSwim(boolean canSwim)
      Sets whether the fluid can be swum in.
      Parameters:
      canSwim - if the fluid can be swum in
      Returns:
      the property holder instance
    • canDrown

      public FluidType.Properties canDrown(boolean canDrown)
      Sets whether the fluid can drown something.
      Parameters:
      canDrown - if the fluid can drown something
      Returns:
      the property holder instance
    • fallDistanceModifier

      public FluidType.Properties fallDistanceModifier(float fallDistanceModifier)
      Sets how much the fluid should scale the damage done when hitting the ground per tick.
      Parameters:
      fallDistanceModifier - a scalar to multiply to the fall damage
      Returns:
      the property holder instance
    • canExtinguish

      public FluidType.Properties canExtinguish(boolean canExtinguish)
      Sets whether the fluid can extinguish.
      Parameters:
      canExtinguish - if the fluid can extinguish
      Returns:
      the property holder instance
    • canConvertToSource

      public FluidType.Properties canConvertToSource(boolean canConvertToSource)
      Sets whether the fluid can create a source.
      Parameters:
      canConvertToSource - if the fluid can create a source
      Returns:
      the property holder instance
    • supportsBoating

      public FluidType.Properties supportsBoating(boolean supportsBoating)
      Sets whether the fluid supports boating.
      Parameters:
      supportsBoating - if the fluid supports boating
      Returns:
      the property holder instance
    • pathType

      public FluidType.Properties pathType(@Nullable @Nullable BlockPathTypes pathType)
      Sets the path type of this fluid.
      Parameters:
      pathType - the path type of this fluid
      Returns:
      the property holder instance
    • adjacentPathType

      public FluidType.Properties adjacentPathType(@Nullable @Nullable BlockPathTypes adjacentPathType)
      Sets the path type of the adjacent fluid. Path types with a negative malus are not traversable. Pathfinding will favor paths consisting of a lower malus.
      Parameters:
      adjacentPathType - the path type of this fluid
      Returns:
      the property holder instance
    • sound

      public FluidType.Properties sound(SoundAction action, SoundEvent sound)
      Sets a sound to play when a certain action is performed.
      Parameters:
      action - the action being performed
      sound - the sound to play when performing the action
      Returns:
      the property holder instance
    • canHydrate

      public FluidType.Properties canHydrate(boolean canHydrate)
      Sets whether the fluid can hydrate.

      Hydration is an arbitrary word which depends on the implementation.

      Parameters:
      canHydrate - if the fluid can hydrate
      Returns:
      the property holder instance
    • lightLevel

      public FluidType.Properties lightLevel(int lightLevel)
      Sets the light level emitted by the fluid.
      Parameters:
      lightLevel - the light level emitted by the fluid
      Returns:
      the property holder instance
      Throws:
      IllegalArgumentException - if light level is not between [0,15]
    • density

      public FluidType.Properties density(int density)
      Sets the density of the fluid.
      Parameters:
      density - the density of the fluid
      Returns:
      the property holder instance
    • temperature

      public FluidType.Properties temperature(int temperature)
      Sets the temperature of the fluid.
      Parameters:
      temperature - the temperature of the fluid
      Returns:
      the property holder instance
    • viscosity

      public FluidType.Properties viscosity(int viscosity)
      Sets the viscosity, or thickness, of the fluid.
      Parameters:
      viscosity - the viscosity of the fluid
      Returns:
      the property holder instance
      Throws:
      IllegalArgumentException - if viscosity is negative
    • rarity

      public FluidType.Properties rarity(Rarity rarity)
      Sets the rarity of the fluid.
      Parameters:
      rarity - the rarity of the fluid
      Returns:
      the property holder instance