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
FieldsModifier and TypeFieldDescriptionprivate static net.minecraft.client.renderer.texture.TextureAtlasSprite
private static Map
<net.minecraft.resources.ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.client.renderer.texture.TextureAtlasSprite[]
getFluidSprites
(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.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 net.minecraft.client.renderer.texture.TextureAtlasSprite
getSprite
(net.minecraft.resources.ResourceLocation texture) Returns a specified sprite or a missing sprite texture if sprite is not found.static void
reload()
-
Field Details
-
textureLookup
private static Map<net.minecraft.resources.ResourceLocation,net.minecraft.client.renderer.texture.TextureAtlasSprite> textureLookup -
missingSprite
private static net.minecraft.client.renderer.texture.TextureAtlasSprite missingSprite
-
-
Constructor Details
-
FluidSpriteCache
private FluidSpriteCache()
-
-
Method Details
-
getFluidSprites
public static net.minecraft.client.renderer.texture.TextureAtlasSprite[] getFluidSprites(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.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
public static net.minecraft.client.renderer.texture.TextureAtlasSprite getSprite(net.minecraft.resources.ResourceLocation texture) 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()
-