Class FluidSpriteCache

java.lang.Object
net.neoforged.neoforge.client.textures.FluidSpriteCache

public final class FluidSpriteCache extends Object
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 Details

  • 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

      public static TextureAtlasSprite getSprite(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()