Interface FluidRenderHandlerRegistry
public interface FluidRenderHandlerRegistry
Registry for
FluidRenderHandler instances.
Notably, this supports querying, overriding and wrapping vanilla fluid rendering.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet aFluidRenderHandlerfor a given Fluid.booleanisBlockTransparent(Block block) Looks up whether a block is transparent and gets a fluid overlay texture instead of a falling fluid texture.voidregister(Fluid fluid, FluidRenderHandler renderer) Register aFluidRenderHandlerfor a given Fluid.default voidregister(Fluid still, Fluid flow, FluidRenderHandler renderer) Register aFluidRenderHandlerfor two given Fluids, usually a pair of a still and a flowing fluid type that use the same fluid renderer.voidsetBlockTransparency(Block block, boolean transparent) Registers whether a block is transparent or not.
-
Field Details
-
INSTANCE
-
-
Method Details
-
get
Get aFluidRenderHandlerfor a given Fluid. Supports vanilla and Fabric fluids.- Parameters:
fluid- The Fluid.- Returns:
- The FluidRenderHandler.
-
register
Register aFluidRenderHandlerfor a given Fluid.Note that most fluids have a still and a flowing type, and a FluidRenderHandler must be registered for each type separately. To easily register a render handler for a pair of still and flowing fluids, use
register(Fluid, Fluid, FluidRenderHandler).- Parameters:
fluid- The Fluid.renderer- The FluidRenderHandler.
-
register
Register aFluidRenderHandlerfor two given Fluids, usually a pair of a still and a flowing fluid type that use the same fluid renderer.- Parameters:
still- The still Fluid.flow- The flowing Fluid.renderer- The FluidRenderHandler.
-
setBlockTransparency
Registers whether a block is transparent or not. When a block is transparent, the flowing fluid texture to the sides of that block is replaced by a special overlay texture. This happens by default with glass and leaves, and hence blocks inheritingTransparentBlockandLeavesBlockare by default transparent. Use this method to override the default behavior for a block.- Parameters:
block- The block to register transparency for.transparent- Whether the block is transparent (e.g. gets the overlay textures) or not.
-
isBlockTransparent
Looks up whether a block is transparent and gets a fluid overlay texture instead of a falling fluid texture. If transparency is registered for a block (viasetBlockTransparency(net.minecraft.block.Block, boolean)), this method returns that registered transparency. Otherwise, this method returns whether the block is a subclass ofTransparentBlockorLeavesBlock.- Parameters:
block- The block to get transparency for.- Returns:
- Whether the block is transparent (e.g. gets the overlay textures) or not.
-