Class FluidSpriteCache
java.lang.Object
net.neoforged.neoforge.client.textures.FluidSpriteCache
Helper class for safely accessing fluid textures on a render worker (such as in
LiquidBlockRenderer
)
to avoid potential issues when a chunk gets re-batched while resources are being reloaded.-
Field Summary
Modifier and TypeFieldDescriptionprivate static TextureAtlasSprite
private static Map
<ResourceLocation, TextureAtlasSprite> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TextureAtlasSprite[]
getFluidSprites
(BlockAndTintGetter level, BlockPos pos, FluidState fluid) Returns an array holding the still sprite, the flowing sprite and the overlay sprite (if specified, otherwise null) of the given fluid at the given position.static TextureAtlasSprite
getSprite
(ResourceLocation texture) Returns a specified sprite or a missing sprite texture if sprite is not found.static void
reload()
-
Field Details
-
textureLookup
-
missingSprite
-
-
Constructor Details
-
FluidSpriteCache
private FluidSpriteCache()
-
-
Method Details
-
getFluidSprites
public static TextureAtlasSprite[] getFluidSprites(BlockAndTintGetter level, BlockPos pos, FluidState fluid) Returns an array holding the still sprite, the flowing sprite and the overlay sprite (if specified, otherwise null) of the given fluid at the given position.- Returns:
- an array holding the still sprite, the flowing sprite and the overlay sprite (if specified, otherwise null) of the given fluid at the given position
-
getSprite
Returns a specified sprite or a missing sprite texture if sprite is not found.- Returns:
- a specified sprite or a missing sprite texture if sprite is not found
-
reload
@Internal public static void reload()
-