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
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.font.providers.GlyphProviderDefinition
GlyphProviderDefinition.Conditional, GlyphProviderDefinition.Loader, GlyphProviderDefinition.Reference -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theascentrecord component.static final com.mojang.serialization.MapCodec<BitmapProvider.Definition> private static final com.mojang.serialization.Codec<int[][]> private final int[][]The field for thecodepointGridrecord component.private final ResourceLocationThe field for thefilerecord component.private final intThe field for theheightrecord component.Fields inherited from interface net.minecraft.client.gui.font.providers.GlyphProviderDefinition
MAP_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionDefinition(ResourceLocation file, int height, int ascent, int[][] codepointGrid) Creates an instance of aDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintascent()Returns the value of theascentrecord component.int[][]Returns the value of thecodepointGridrecord component.final booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.private intgetActualGlyphWidth(NativeImage p_286449_, int p_286656_, int p_286554_, int p_286657_, int p_286307_) final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.private GlyphProviderload(ResourceManager p_286694_) final StringtoString()Returns a string representation of this record class.type()com.mojang.datafixers.util.Either<GlyphProviderDefinition.Loader, GlyphProviderDefinition.Reference> unpack()private static com.mojang.serialization.DataResult<BitmapProvider.Definition> validate(BitmapProvider.Definition p_286662_) private static com.mojang.serialization.DataResult<int[][]> validateDimensions(int[][] p_286348_)
-
Field Details
-
file
The field for thefilerecord component. -
height
private final int heightThe field for theheightrecord component. -
ascent
private final int ascentThe field for theascentrecord component. -
codepointGrid
private final int[][] codepointGridThe field for thecodepointGridrecord component. -
CODEPOINT_GRID_CODEC
private static final com.mojang.serialization.Codec<int[][]> CODEPOINT_GRID_CODEC -
CODEC
-
-
Constructor Details
-
Definition
Creates an instance of aDefinitionrecord class.- Parameters:
file- the value for thefilerecord componentheight- the value for theheightrecord componentascent- the value for theascentrecord componentcodepointGrid- the value for thecodepointGridrecord 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
- Specified by:
typein interfaceGlyphProviderDefinition
-
unpack
public com.mojang.datafixers.util.Either<GlyphProviderDefinition.Loader,GlyphProviderDefinition.Reference> unpack()- Specified by:
unpackin interfaceGlyphProviderDefinition
-
load
- Throws:
IOException
-
getActualGlyphWidth
private int getActualGlyphWidth(NativeImage p_286449_, int p_286656_, int p_286554_, int p_286657_, int p_286307_) -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
file
Returns the value of thefilerecord component.- Returns:
- the value of the
filerecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
ascent
public int ascent()Returns the value of theascentrecord component.- Returns:
- the value of the
ascentrecord component
-
codepointGrid
public int[][] codepointGrid()Returns the value of thecodepointGridrecord component.- Returns:
- the value of the
codepointGridrecord component
-