Interface IClientFluidTypeExtensions
FluidType.- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ResourceLocationReturns the reference of the texture to apply to a flowing fluid.default ResourceLocationgetFlowingTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a flowing fluid.default ResourceLocationgetFlowingTexture(FluidStack stack) Returns the reference of the texture to apply to a flowing fluid.default @Nullable ResourceLocationReturns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air.default ResourceLocationgetOverlayTexture(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 ResourceLocationgetOverlayTexture(FluidStack stack) Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air.default @Nullable ResourceLocationReturns the location of the texture to apply to the camera when it is within the fluid.default ResourceLocationReturns the reference of the texture to apply to a source fluid.default ResourceLocationgetStillTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the reference of the texture to apply to a source fluid.default ResourceLocationgetStillTexture(FluidStack stack) Returns the reference of the texture to apply to a source fluid.default intReturns the tint applied to the fluid's textures.default intgetTintColor(FluidState state, BlockAndTintGetter getter, BlockPos pos) Returns the tint applied to the fluid's textures.default intgetTintColor(FluidStack stack) Returns the tint applied to the fluid's textures.default Vector4fmodifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector4f fluidFogColor) Modifies the color of the fog when the camera is within the fluid.default voidmodifyFogRender(Camera camera, @Nullable FogEnvironment environment, float renderDistance, float partialTick, FogData fogData) Modifies how the fog is currently being rendered when the camera is within a fluid.static IClientFluidTypeExtensionsstatic IClientFluidTypeExtensionsof(FluidState state) static IClientFluidTypeExtensionsdefault booleanrenderFluid(FluidState fluidState, BlockAndTintGetter getter, BlockPos pos, VertexConsumer vertexConsumer, BlockState blockState) Called to allow rendering custom quads for a fluid during chunk meshing.default voidrenderOverlay(Minecraft mc, PoseStack poseStack, MultiBufferSource buffers) Renders#getRenderOverlayTextureonto 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_stillwill point toassets/minecraft/textures/block/water_still.png).Important: This method should only return
nullforFluids.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_flowwill point toassets/minecraft/textures/block/water_flow.png).Important: This method should only return
nullforFluids.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#getStillTextureor#getFlowingTexturewill be applied instead.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_overlaywill 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.pngwill 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#getRenderOverlayTextureonto the camera when within the fluid.- Parameters:
mc- the client instanceposeStack- the transformations representing the current rendering position
-
modifyFogColor
default Vector4f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector4f 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 RGBA color of the fog- Returns:
- the color of the fog
-
modifyFogRender
default void modifyFogRender(Camera camera, @Nullable @Nullable FogEnvironment environment, float renderDistance, float partialTick, FogData fogData) Modifies how the fog is currently being rendered when the camera is within a fluid.- Parameters:
camera- the camera instanceenvironment- the type of fog being renderedrenderDistance- the render distance of the clientpartialTick- the delta time of where the current frame is within a tickfogData- the parameters to use for rendering the fog, this object can be modified.
-
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_stillwill point toassets/minecraft/textures/block/water_still.png).Important: This method should only return
nullforFluids.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_flowwill point toassets/minecraft/textures/block/water_flow.png).Important: This method should only return
nullforFluids.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#getStillTextureor#getFlowingTexturewill be applied instead.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_overlaywill 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_stillwill point toassets/minecraft/textures/block/water_still.png).Important: This method should only return
nullforFluids.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_flowwill point toassets/minecraft/textures/block/water_flow.png).Important: This method should only return
nullforFluids.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#getStillTextureor#getFlowingTexturewill be applied instead.This should return a reference to the texture and not the actual texture itself (e.g.
minecraft:block/water_overlaywill 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
-
renderFluid
default boolean renderFluid(FluidState fluidState, BlockAndTintGetter getter, BlockPos pos, VertexConsumer vertexConsumer, BlockState blockState) Called to allow rendering custom quads for a fluid during chunk meshing. You may replace the fluid rendering entirely, or return false to allow vanilla's fluid rendering to also run.Note: this method will be called once for every fluid block during chunk meshing, so any logic here needs to be performant.
- Parameters:
fluidState- the state of the fluidgetter- the getter the fluid can be obtained frompos- the position of the fluidvertexConsumer- the vertex consumer to emit quads toblockState- the blockstate at the position of the fluid- Returns:
- true if vanilla fluid rendering should be skipped
-