Record Class BitmapProvider.Definition

java.lang.Object
java.lang.Record
net.minecraft.client.gui.font.providers.BitmapProvider.Definition
All Implemented Interfaces:
GlyphProviderDefinition
Enclosing class:
BitmapProvider

public static record BitmapProvider.Definition(ResourceLocation file, int height, int ascent, int[][] codepointGrid) extends Record implements GlyphProviderDefinition
  • Field Details

    • file

      private final ResourceLocation file
      The field for the file record component.
    • height

      private final int height
      The field for the height record component.
    • ascent

      private final int ascent
      The field for the ascent record component.
    • codepointGrid

      private final int[][] codepointGrid
      The field for the codepointGrid record component.
    • CODEPOINT_GRID_CODEC

      private static final com.mojang.serialization.Codec<int[][]> CODEPOINT_GRID_CODEC
    • CODEC

      public static final com.mojang.serialization.MapCodec<BitmapProvider.Definition> CODEC
  • Constructor Details

    • Definition

      public Definition(ResourceLocation file, int height, int ascent, int[][] codepointGrid)
      Creates an instance of a Definition record class.
      Parameters:
      file - the value for the file record component
      height - the value for the height record component
      ascent - the value for the ascent record component
      codepointGrid - the value for the codepointGrid record component
  • Method Details

    • validateDimensions

      private static com.mojang.serialization.DataResult<int[][]> validateDimensions(int[][] p_286348_)
    • validate

      private static com.mojang.serialization.DataResult<BitmapProvider.Definition> validate(BitmapProvider.Definition p_286662_)
    • type

      public GlyphProviderType type()
      Specified by:
      type in interface GlyphProviderDefinition
    • unpack

      public com.mojang.datafixers.util.Either<GlyphProviderDefinition.Loader,GlyphProviderDefinition.Reference> unpack()
      Specified by:
      unpack in interface GlyphProviderDefinition
    • load

      private GlyphProvider load(ResourceManager p_286694_) throws IOException
      Throws:
      IOException
    • getActualGlyphWidth

      private int getActualGlyphWidth(NativeImage p_286449_, int p_286656_, int p_286554_, int p_286657_, int p_286307_)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • file

      public ResourceLocation file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • ascent

      public int ascent()
      Returns the value of the ascent record component.
      Returns:
      the value of the ascent record component
    • codepointGrid

      public int[][] codepointGrid()
      Returns the value of the codepointGrid record component.
      Returns:
      the value of the codepointGrid record component