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.Loader, GlyphProviderDefinition.Reference
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for theascent
record component.static final com.mojang.serialization.MapCodec<BitmapProvider.Definition>
private static final com.mojang.serialization.Codec<int[][]>
private final int[][]
The field for thecodepointGrid
record component.private final ResourceLocation
The field for thefile
record component.private final int
The field for theheight
record component. -
Constructor Summary
ConstructorDescriptionDefinition
(ResourceLocation file, int height, int ascent, int[][] codepointGrid) Creates an instance of aDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
ascent()
Returns the value of theascent
record component.int[][]
Returns the value of thecodepointGrid
record component.final boolean
Indicates whether some other object is "equal to" this one.file()
Returns the value of thefile
record component.private int
getActualGlyphWidth
(NativeImage p_286449_, int p_286656_, int p_286554_, int p_286657_, int p_286307_) final int
hashCode()
Returns a hash code value for this object.int
height()
Returns the value of theheight
record component.private GlyphProvider
load
(ResourceManager p_286694_) final String
toString()
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 thefile
record component. -
height
private final int heightThe field for theheight
record component. -
ascent
private final int ascentThe field for theascent
record component. -
codepointGrid
private final int[][] codepointGridThe field for thecodepointGrid
record component. -
CODEPOINT_GRID_CODEC
private static final com.mojang.serialization.Codec<int[][]> CODEPOINT_GRID_CODEC -
CODEC
-
-
Constructor Details
-
Definition
Creates an instance of aDefinition
record class.- Parameters:
file
- the value for thefile
record componentheight
- the value for theheight
record componentascent
- the value for theascent
record componentcodepointGrid
- the value for thecodepointGrid
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
- Specified by:
type
in interfaceGlyphProviderDefinition
-
unpack
public com.mojang.datafixers.util.Either<GlyphProviderDefinition.Loader,GlyphProviderDefinition.Reference> unpack()- Specified by:
unpack
in 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 thefile
record component.- Returns:
- the value of the
file
record component
-
height
public int height()Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-
ascent
public int ascent()Returns the value of theascent
record component.- Returns:
- the value of the
ascent
record component
-
codepointGrid
public int[][] codepointGrid()Returns the value of thecodepointGrid
record component.- Returns:
- the value of the
codepointGrid
record component
-