Record Class SingleFile
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.texture.atlas.sources.SingleFile
- All Implemented Interfaces:
SpriteSource
public record SingleFile(ResourceLocation resourceId, Optional<ResourceLocation> spriteId)
extends Record
implements SpriteSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.renderer.texture.atlas.SpriteSource
SpriteSource.Output, SpriteSource.SpriteSupplier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
static final com.mojang.serialization.MapCodec
<SingleFile> private final ResourceLocation
The field for theresourceId
record component.private final Optional
<ResourceLocation> The field for thespriteId
record component.Fields inherited from interface net.minecraft.client.renderer.texture.atlas.SpriteSource
TEXTURE_ID_CONVERTER
-
Constructor Summary
ConstructorsConstructorDescriptionSingleFile
(ResourceLocation p_400289_) SingleFile
(ResourceLocation resourceId, Optional<ResourceLocation> spriteId) Creates an instance of aSingleFile
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<SingleFile> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theresourceId
record component.void
run
(ResourceManager p_261920_, SpriteSource.Output p_261578_) spriteId()
Returns the value of thespriteId
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
resourceId
The field for theresourceId
record component. -
spriteId
The field for thespriteId
record component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
MAP_CODEC
-
-
Constructor Details
-
SingleFile
-
SingleFile
Creates an instance of aSingleFile
record class.- Parameters:
resourceId
- the value for theresourceId
record componentspriteId
- the value for thespriteId
record component
-
-
Method Details
-
run
- Specified by:
run
in interfaceSpriteSource
-
codec
- Specified by:
codec
in interfaceSpriteSource
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
resourceId
Returns the value of theresourceId
record component.- Returns:
- the value of the
resourceId
record component
-
spriteId
Returns the value of thespriteId
record component.- Returns:
- the value of the
spriteId
record component
-