Class FluidProperties
java.lang.Object
com.stereowalker.unionlib.world.level.material.FluidProperties
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<net.minecraft.world.level.material.Fluid, FluidProperties> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDrownIn(net.minecraft.world.entity.LivingEntity entity) Returns whether the entity can drown in the fluid.booleancanExtinguish(net.minecraft.world.entity.Entity entity) Returns whether the entity can be extinguished by this fluid.booleancanPushEntity(net.minecraft.world.entity.Entity entity) Returns whether the fluid can push an entity.booleancanSwim(net.minecraft.world.entity.Entity entity) Returns whether the entity can swim in the fluid.static FluidProperties.Buildercreate(net.minecraft.resources.Identifier name) floatfallDistanceModifier(net.minecraft.world.entity.Entity entity) Returns how much the fluid should scale the damage done to a falling entity when hitting the ground per tick.net.minecraft.resources.Identifierstatic FluidPropertiesfromFluid(net.minecraft.world.level.material.Fluid fluid) voiditemMovement(net.minecraft.world.entity.item.ItemEntity entity) Performs what to do when an item is in a fluid.doublemotionScale(net.minecraft.world.entity.Entity entity) Returns how much the velocity of the fluid should be scaled by when applied to an entity.booleanmove(net.minecraft.world.level.material.FluidState state, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.phys.Vec3 movementVector, double gravity) Performs how an entity moves when within the fluid.abstract net.minecraft.resources.Identifiername()static <T> Tor(net.minecraft.world.level.material.Fluid fluid, Function<FluidProperties, T> func, T or) net.minecraft.resources.Identifiernet.minecraft.resources.IdentifierbooleansupportsBoats(net.minecraft.world.entity.vehicle.boat.AbstractBoat boat) Returns whether the boat can be used on the fluid.booleansupportsBoats(net.minecraft.world.level.material.FluidState state, net.minecraft.world.entity.vehicle.boat.AbstractBoat boat) Returns whether the boat can be used on the fluid.intinttintColor(net.minecraft.world.level.material.FluidState state, net.minecraft.client.renderer.block.BlockAndTintGetter getter, net.minecraft.core.BlockPos pos)
-
Field Details
-
fluidProps
-
-
Constructor Details
-
FluidProperties
public FluidProperties()
-
-
Method Details
-
fromFluid
-
or
public static <T> T or(net.minecraft.world.level.material.Fluid fluid, Function<FluidProperties, T> func, T or) -
create
-
name
public abstract net.minecraft.resources.Identifier name() -
stillTexture
public net.minecraft.resources.Identifier stillTexture() -
flowingTexture
public net.minecraft.resources.Identifier flowingTexture() -
overlayTexture
public net.minecraft.resources.Identifier overlayTexture() -
tintColor
public int tintColor() -
tintColor
public int tintColor(net.minecraft.world.level.material.FluidState state, net.minecraft.client.renderer.block.BlockAndTintGetter getter, net.minecraft.core.BlockPos pos) -
motionScale
public double motionScale(net.minecraft.world.entity.Entity entity) Returns how much the velocity of the fluid should be scaled by when applied to an entity.- Parameters:
entity- the entity in the fluid- Returns:
- a scalar to multiply to the fluid velocity
-
canPushEntity
public boolean canPushEntity(net.minecraft.world.entity.Entity entity) Returns whether the fluid can push an entity.- Parameters:
entity- the entity in the fluid- Returns:
trueif the entity can be pushed by the fluid,falseotherwise
-
canSwim
public boolean canSwim(net.minecraft.world.entity.Entity entity) Returns whether the entity can swim in the fluid.- Parameters:
entity- the entity in the fluid- Returns:
trueif the entity can swim in the fluid,falseotherwise
-
fallDistanceModifier
public float fallDistanceModifier(net.minecraft.world.entity.Entity entity) Returns how much the fluid should scale the damage done to a falling entity when hitting the ground per tick.Implementation: If the entity is in many fluids, the smallest modifier is applied.
- Parameters:
entity- the entity in the fluid- Returns:
- a scalar to multiply to the fall damage
-
canExtinguish
public boolean canExtinguish(net.minecraft.world.entity.Entity entity) Returns whether the entity can be extinguished by this fluid.- Parameters:
entity- the entity in the fluid- Returns:
trueif the entity can be extinguished,falseotherwise
-
move
public boolean move(net.minecraft.world.level.material.FluidState state, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.phys.Vec3 movementVector, double gravity) Performs how an entity moves when within the fluid. If using custom movement logic, the method should returntrue. Otherwise, the movement logic will default to water.- Parameters:
state- the state of the fluidentity- the entity moving within the fluidmovementVector- the velocity of how the entity wants to movegravity- the gravity to apply to the entity- Returns:
trueif custom movement logic is performed,falseotherwise
-
canDrownIn
public boolean canDrownIn(net.minecraft.world.entity.LivingEntity entity) Returns whether the entity can drown in the fluid.- Parameters:
entity- the entity in the fluid- Returns:
trueif the entity can drown in the fluid,falseotherwise
-
itemMovement
public void itemMovement(net.minecraft.world.entity.item.ItemEntity entity) Performs what to do when an item is in a fluid.- Parameters:
entity- the item in the fluid
-
supportsBoats
public boolean supportsBoats(net.minecraft.world.entity.vehicle.boat.AbstractBoat boat) Returns whether the boat can be used on the fluid.- Parameters:
boat- the boat trying to be used on the fluid- Returns:
trueif the boat can be used,falseotherwise
-
supportsBoats
public boolean supportsBoats(net.minecraft.world.level.material.FluidState state, net.minecraft.world.entity.vehicle.boat.AbstractBoat boat) Returns whether the boat can be used on the fluid.- Parameters:
state- the state of the fluidboat- the boat trying to be used on the fluid- Returns:
trueif the boat can be used,falseotherwise
-