类 FluidType.Properties

java.lang.Object
net.neoforged.neoforge.fluids.FluidType.Properties
封闭类:
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.
  • 字段详细资料

    • 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 PathType pathType
    • adjacentPathType

      @Nullable private @Nullable PathType 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
    • dripInfo

      @Nullable private @Nullable FluidType.DripstoneDripInfo dripInfo
  • 构造器详细资料

    • Properties

      private Properties()
  • 方法详细资料

    • create

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

      public FluidType.Properties descriptionId(String descriptionId)
      Sets the identifier representing the name of the fluid type.
      参数:
      descriptionId - the identifier representing the name of the fluid type
      返回:
      the property holder instance
    • motionScale

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

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

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

      public FluidType.Properties canDrown(boolean canDrown)
      Sets whether the fluid can drown something.
      参数:
      canDrown - if the fluid can drown something
      返回:
      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.
      参数:
      fallDistanceModifier - a scalar to multiply to the fall damage
      返回:
      the property holder instance
    • canExtinguish

      public FluidType.Properties canExtinguish(boolean canExtinguish)
      Sets whether the fluid can extinguish.
      参数:
      canExtinguish - if the fluid can extinguish
      返回:
      the property holder instance
    • canConvertToSource

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

      public FluidType.Properties supportsBoating(boolean supportsBoating)
      Sets whether the fluid supports boating.
      参数:
      supportsBoating - if the fluid supports boating
      返回:
      the property holder instance
    • pathType

      public FluidType.Properties pathType(@Nullable @Nullable PathType pathType)
      Sets the path type of this fluid.
      参数:
      pathType - the path type of this fluid
      返回:
      the property holder instance
    • adjacentPathType

      public FluidType.Properties adjacentPathType(@Nullable @Nullable PathType 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.
      参数:
      adjacentPathType - the path type of this fluid
      返回:
      the property holder instance
    • sound

      public FluidType.Properties sound(SoundAction action, SoundEvent sound)
      Sets a sound to play when a certain action is performed.
      参数:
      action - the action being performed
      sound - the sound to play when performing the action
      返回:
      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.

      参数:
      canHydrate - if the fluid can hydrate
      返回:
      the property holder instance
    • lightLevel

      public FluidType.Properties lightLevel(int lightLevel)
      Sets the light level emitted by the fluid.
      参数:
      lightLevel - the light level emitted by the fluid
      返回:
      the property holder instance
      抛出:
      IllegalArgumentException - if light level is not between [0,15]
    • density

      public FluidType.Properties density(int density)
      Sets the density of the fluid.
      参数:
      density - the density of the fluid
      返回:
      the property holder instance
    • temperature

      public FluidType.Properties temperature(int temperature)
      Sets the temperature of the fluid.
      参数:
      temperature - the temperature of the fluid
      返回:
      the property holder instance
    • viscosity

      public FluidType.Properties viscosity(int viscosity)
      Sets the viscosity, or thickness, of the fluid.
      参数:
      viscosity - the viscosity of the fluid
      返回:
      the property holder instance
      抛出:
      IllegalArgumentException - if viscosity is negative
    • rarity

      public FluidType.Properties rarity(Rarity rarity)
      Sets the rarity of the fluid.
      参数:
      rarity - the rarity of the fluid
      返回:
      the property holder instance
    • addDripstoneDripping

      public FluidType.Properties addDripstoneDripping(float chance, ParticleOptions dripParticle, Block cauldron, @Nullable @Nullable SoundEvent fillSound)
      Allows this fluid to drip from Pointed Dripstone stalactites and fill cauldrons below.
      参数:
      chance - the chance that the cauldron below will be filled every time the Pointed Dripstone is randomly ticked
      dripParticle - the particle that spawns randomly from the tip of the Pointed Dripstone when this fluid is above it
      cauldron - the block the Pointed Dripstone should replace an empty cauldron with when it successfully tries to fill the cauldron
      fillSound - the sound that plays when the Pointed Dripstone successfully tries to fill an empty cauldron. If null, no sound will play. Note that if your block class does not extend CauldronBlock, this sound will not play regardless.
      返回:
      the property holder instance