Class FluidGuiRendering

java.lang.Object
com.hbm_m.client.gui.FluidGuiRendering

public final class FluidGuiRendering extends Object
Утилиты для отрисовки жидкости в GUI так же, как в 1.7.10 FluidType / FluidTank.renderTank: отдельный PNG под textures/gui/fluids/, тайлинг 16×16.

В оригинале путь задаётся как new ResourceLocation(RefStrings.MODID + ":textures/gui/fluids/" + name.toLowerCase(Locale.US) + ".png"); либо для кастомных — texName без изменения регистра (RefStrings.MODID + ":textures/gui/fluids/" + texName + ".png").

Для Forge 1.20 IClientFluidTypeExtensions#getStillTexture(FluidStack) возвращает id вида hbm_m:gui/fluids/water; соответствующий файл — assets/hbm_m/textures/gui/fluids/water.png. Используйте texturePngFromStillSpriteId(ResourceLocation) или guiTexturePngForStack(FluidStack).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Как в 1.7.10: одна ячейка иконки для тайлинга в баке.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.resources.ResourceLocation
    guiTexturePngForFluid(net.minecraft.world.level.material.Fluid fluid, dev.architectury.fluid.FluidStack stackForStillTexture)
     
    static net.minecraft.resources.ResourceLocation
    guiTexturePngForStack(dev.architectury.fluid.FluidStack stack)
     
    static net.minecraft.resources.ResourceLocation
    hbmGuiFluidPng(String fluidTextureBaseName)
    Эквивалент конструктора FluidType(String name, ...): MODID:textures/gui/fluids/fluidTextureBaseName.toLowerCase(Locale.US).png.
    static net.minecraft.resources.ResourceLocation
    hbmGuiFluidPngCustom(String textureFileBaseName)
    Эквивалент FluidType.setupCustom(..., String texName, ...): MODID:textures/gui/fluids/textureFileBaseName.png без изменения регистра.
    static void
    renderTiledFluid(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.resources.ResourceLocation fluidPng, int x, int y, int width, int height)
    Тайлинг снизу вверх (заполнение снизу) и слева направо, как FluidTank.renderTank в 1.7.10.
    static net.minecraft.resources.ResourceLocation
    texturePngFromStillSpriteId(net.minecraft.resources.ResourceLocation stillId)
    Id стоячей текстуры Forge (namespace:path без textures/ и без .png) → полный ResourceLocation PNG для GuiGraphics.blit(ResourceLocation, int, int, int, int, int, int, int, int).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FLUID_GUI_TILE_SIZE

      public static final int FLUID_GUI_TILE_SIZE
      Как в 1.7.10: одна ячейка иконки для тайлинга в баке.
      See Also:
  • Method Details

    • hbmGuiFluidPng

      public static net.minecraft.resources.ResourceLocation hbmGuiFluidPng(String fluidTextureBaseName)
      Эквивалент конструктора FluidType(String name, ...): MODID:textures/gui/fluids/fluidTextureBaseName.toLowerCase(Locale.US).png.
    • hbmGuiFluidPngCustom

      public static net.minecraft.resources.ResourceLocation hbmGuiFluidPngCustom(String textureFileBaseName)
      Эквивалент FluidType.setupCustom(..., String texName, ...): MODID:textures/gui/fluids/textureFileBaseName.png без изменения регистра.
    • texturePngFromStillSpriteId

      public static net.minecraft.resources.ResourceLocation texturePngFromStillSpriteId(net.minecraft.resources.ResourceLocation stillId)
      Id стоячей текстуры Forge (namespace:path без textures/ и без .png) → полный ResourceLocation PNG для GuiGraphics.blit(ResourceLocation, int, int, int, int, int, int, int, int).
    • guiTexturePngForStack

      @Nullable public static net.minecraft.resources.ResourceLocation guiTexturePngForStack(dev.architectury.fluid.FluidStack stack)
    • guiTexturePngForFluid

      @Nullable public static net.minecraft.resources.ResourceLocation guiTexturePngForFluid(net.minecraft.world.level.material.Fluid fluid, dev.architectury.fluid.FluidStack stackForStillTexture)
    • renderTiledFluid

      public static void renderTiledFluid(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.resources.ResourceLocation fluidPng, int x, int y, int width, int height)
      Тайлинг снизу вверх (заполнение снизу) и слева направо, как FluidTank.renderTank в 1.7.10. Цвет и blend выставляет вызывающий (например RenderSystem.setShaderColor(float, float, float, float)).