Package net.minecraftforge.fluids
Class FluidType.Properties
java.lang.Object
net.minecraftforge.fluids.FluidType.Properties
- Enclosing class:
- FluidType
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 Summary
Modifier and TypeFieldDescriptionprivate @Nullable BlockPathTypes
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private int
private String
private float
private int
private double
private @Nullable BlockPathTypes
private Rarity
private final Map<SoundAction,
SoundEvent> private boolean
private int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadjacentPathType
(@Nullable BlockPathTypes adjacentPathType) Sets the path type of the adjacent fluid.canConvertToSource
(boolean canConvertToSource) Sets whether the fluid can create a source.canDrown
(boolean canDrown) Sets whether the fluid can drown something.canExtinguish
(boolean canExtinguish) Sets whether the fluid can extinguish.canHydrate
(boolean canHydrate) Sets whether the fluid can hydrate.canPushEntity
(boolean canPushEntity) Sets whether the fluid can push an entity.canSwim
(boolean canSwim) Sets whether the fluid can be swum in.static FluidType.Properties
create()
Creates a new instance of the properties.density
(int density) Sets the density of the fluid.descriptionId
(String descriptionId) Sets the identifier representing the name of the fluid type.fallDistanceModifier
(float fallDistanceModifier) Sets how much the fluid should scale the damage done when hitting the ground per tick.lightLevel
(int lightLevel) Sets the light level emitted by the fluid.motionScale
(double motionScale) Sets how much the velocity of the fluid should be scaled by.pathType
(@Nullable BlockPathTypes pathType) Sets the path type of this fluid.Sets the rarity of the fluid.sound
(SoundAction action, SoundEvent sound) Sets a sound to play when a certain action is performed.supportsBoating
(boolean supportsBoating) Sets whether the fluid supports boating.temperature
(int temperature) Sets the temperature of the fluid.viscosity
(int viscosity) Sets the viscosity, or thickness, of the fluid.
-
Field Details
-
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
-
adjacentPathType
-
sounds
-
canHydrate
private boolean canHydrate -
lightLevel
private int lightLevel -
density
private int density -
temperature
private int temperature -
viscosity
private int viscosity -
rarity
-
-
Constructor Details
-
Properties
private Properties()
-
-
Method Details
-
create
Creates a new instance of the properties.- Returns:
- the property holder instance
-
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
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
Sets whether the fluid can push an entity.- Parameters:
canPushEntity
- if the fluid can push an entity- Returns:
- the property holder instance
-
canSwim
Sets whether the fluid can be swum in.- Parameters:
canSwim
- if the fluid can be swum in- Returns:
- the property holder instance
-
canDrown
Sets whether the fluid can drown something.- Parameters:
canDrown
- if the fluid can drown something- Returns:
- the property holder instance
-
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
Sets whether the fluid can extinguish.- Parameters:
canExtinguish
- if the fluid can extinguish- Returns:
- the property holder instance
-
canConvertToSource
Sets whether the fluid can create a source.- Parameters:
canConvertToSource
- if the fluid can create a source- Returns:
- the property holder instance
-
supportsBoating
Sets whether the fluid supports boating.- Parameters:
supportsBoating
- if the fluid supports boating- Returns:
- the property holder instance
-
pathType
Sets the path type of this fluid.- Parameters:
pathType
- the path type of this fluid- Returns:
- the property holder instance
-
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
Sets a sound to play when a certain action is performed.- Parameters:
action
- the action being performedsound
- the sound to play when performing the action- Returns:
- the property holder instance
-
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
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
Sets the density of the fluid.- Parameters:
density
- the density of the fluid- Returns:
- the property holder instance
-
temperature
Sets the temperature of the fluid.- Parameters:
temperature
- the temperature of the fluid- Returns:
- the property holder instance
-
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
Sets the rarity of the fluid.- Parameters:
rarity
- the rarity of the fluid- Returns:
- the property holder instance
-