Interface IClientFluidTypeExtensions
FluidType
.- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ResourceLocation
Returns the reference of the texture to apply to a flowing fluid.default ResourceLocation
getFlowingTexture
(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a flowing fluid.default ResourceLocation
getFlowingTexture
(FluidStack stack) Returns the reference of the texture to apply to a flowing fluid.default @Nullable ResourceLocation
Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air.default ResourceLocation
getOverlayTexture
(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air.default ResourceLocation
getOverlayTexture
(FluidStack stack) Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air.default @Nullable ResourceLocation
Returns the location of the texture to apply to the camera when it is within the fluid.default ResourceLocation
Returns the reference of the texture to apply to a source fluid.default ResourceLocation
getStillTexture
(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a source fluid.default ResourceLocation
getStillTexture
(FluidStack stack) Returns the reference of the texture to apply to a source fluid.default int
Returns the tint applied to the fluid's textures.default int
getTintColor
(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the tint applied to the fluid's textures.default int
getTintColor
(FluidStack stack) Returns the tint applied to the fluid's textures.default @NotNull org.joml.Vector3f
modifyFogColor
(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, org.joml.Vector3f fluidFogColor) Modifies the color of the fog when the camera is within the fluid.default void
modifyFogRender
(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) Modifies how the fog is currently being rendered when the camera is within a fluid.static IClientFluidTypeExtensions
static IClientFluidTypeExtensions
of
(FluidState state) static IClientFluidTypeExtensions
default void
renderOverlay
(Minecraft mc, PoseStack poseStack) Renders#getRenderOverlayTexture
onto the camera when within the fluid.
-
Field Details
-
DEFAULT
-
-
Method Details
-
of
-
of
-
of
-
getTintColor
default int getTintColor()Returns the tint applied to the fluid's textures.The result represents a 32-bit integer where each 8-bits represent the alpha, red, green, and blue channel respectively.
- Returns:
- the tint applied to the fluid's textures in ARGB format
-
getStillTexture
Returns the reference of the texture to apply to a source fluid.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_still
will point toassets/minecraft/textures/block/water_still.png
).Important: This method should only return
null
forFluids.EMPTY
. All other implementations must define this property.- Returns:
- the reference of the texture to apply to a source fluid
-
getFlowingTexture
Returns the reference of the texture to apply to a flowing fluid.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_flow
will point toassets/minecraft/textures/block/water_flow.png
).Important: This method should only return
null
forFluids.EMPTY
. All other implementations must define this property.- Returns:
- the reference of the texture to apply to a flowing fluid
-
getOverlayTexture
Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air. If no reference is specified, either#getStillTexture
or#getFlowingTexture
will be applied instead.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_overlay
will point toassets/minecraft/textures/block/water_overlay.png
).- Returns:
- the reference of the texture to apply to a fluid directly touching a non-opaque block
-
getRenderOverlayTexture
Returns the location of the texture to apply to the camera when it is within the fluid. If no location is specified, no overlay will be applied.This should return a location to the texture and not a reference (e.g.
minecraft:textures/misc/underwater.png
will use the texture atassets/minecraft/textures/misc/underwater.png
).- Parameters:
mc
- the client instance- Returns:
- the location of the texture to apply to the camera when it is within the fluid
-
renderOverlay
Renders#getRenderOverlayTexture
onto the camera when within the fluid.- Parameters:
mc
- the client instanceposeStack
- the transformations representing the current rendering position
-
modifyFogColor
@NotNull default @NotNull org.joml.Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, org.joml.Vector3f fluidFogColor) Modifies the color of the fog when the camera is within the fluid.The result expects a three float vector representing the red, green, and blue channels respectively. Each channel should be between [0,1].
- Parameters:
camera
- the camera instancepartialTick
- the delta time of where the current frame is within a ticklevel
- the level the camera is located inrenderDistance
- the render distance of the clientdarkenWorldAmount
- the amount to darken the world byfluidFogColor
- the current color of the fog- Returns:
- the color of the fog
-
modifyFogRender
default void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) Modifies how the fog is currently being rendered when the camera is within a fluid.- Parameters:
camera
- the camera instancemode
- the type of fog being renderedrenderDistance
- the render distance of the clientpartialTick
- the delta time of where the current frame is within a ticknearDistance
- the near plane of where the fog starts to renderfarDistance
- the far plane of where the fog ends renderingshape
- the shape of the fog being rendered
-
getStillTexture
Returns the reference of the texture to apply to a source fluid.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_still
will point toassets/minecraft/textures/block/water_still.png
).Important: This method should only return
null
forFluids.EMPTY
. All other implementations must define this property.- Parameters:
state
- the state of the fluidgetter
- the getter the fluid can be obtained frompos
- the position of the fluid- Returns:
- the reference of the texture to apply to a source fluid
-
getFlowingTexture
default ResourceLocation getFlowingTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a flowing fluid.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_flow
will point toassets/minecraft/textures/block/water_flow.png
).Important: This method should only return
null
forFluids.EMPTY
. All other implementations must define this property.- Parameters:
state
- the state of the fluidgetter
- the getter the fluid can be obtained frompos
- the position of the fluid- Returns:
- the reference of the texture to apply to a flowing fluid
-
getOverlayTexture
default ResourceLocation getOverlayTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air. If no reference is specified, either#getStillTexture
or#getFlowingTexture
will be applied instead.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_overlay
will point toassets/minecraft/textures/block/water_overlay.png
).- Parameters:
state
- the state of the fluidgetter
- the getter the fluid can be obtained frompos
- the position of the fluid- Returns:
- the reference of the texture to apply to a fluid directly touching a non-opaque block
-
getTintColor
Returns the tint applied to the fluid's textures.The result represents a 32-bit integer where each 8-bits represent the alpha, red, green, and blue channel respectively.
- Parameters:
state
- the state of the fluidgetter
- the getter the fluid can be obtained frompos
- the position of the fluid- Returns:
- the tint applied to the fluid's textures in ARGB format
-
getTintColor
Returns the tint applied to the fluid's textures.The result represents a 32-bit integer where each 8-bits represent the alpha, red, green, and blue channel respectively.
- Parameters:
stack
- the stack the fluid is in- Returns:
- the tint applied to the fluid's textures in ARGB format
-
getStillTexture
Returns the reference of the texture to apply to a source fluid.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_still
will point toassets/minecraft/textures/block/water_still.png
).Important: This method should only return
null
forFluids.EMPTY
. All other implementations must define this property.- Parameters:
stack
- the stack the fluid is in- Returns:
- the reference of the texture to apply to a source fluid
-
getFlowingTexture
Returns the reference of the texture to apply to a flowing fluid.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_flow
will point toassets/minecraft/textures/block/water_flow.png
).Important: This method should only return
null
forFluids.EMPTY
. All other implementations must define this property.- Parameters:
stack
- the stack the fluid is in- Returns:
- the reference of the texture to apply to a flowing fluid
-
getOverlayTexture
Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air. If no reference is specified, either#getStillTexture
or#getFlowingTexture
will be applied instead.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_overlay
will point toassets/minecraft/textures/block/water_overlay.png
).- Parameters:
stack
- the stack the fluid is in- Returns:
- the reference of the texture to apply to a fluid directly touching a non-opaque block
-