Record Class SingleFile
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.texture.atlas.sources.SingleFile
- All Implemented Interfaces:
SpriteSource,SpriteSourceExtension
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.Loggerstatic final com.mojang.serialization.MapCodec<SingleFile> private final ResourceLocationThe field for theresourceIdrecord component.private final Optional<ResourceLocation> The field for thespriteIdrecord 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 aSingleFilerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SingleFile> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theresourceIdrecord component.voidrun(ResourceManager p_261920_, SpriteSource.Output p_261578_) spriteId()Returns the value of thespriteIdrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.client.extensions.SpriteSourceExtension
run
-
Field Details
-
resourceId
The field for theresourceIdrecord component. -
spriteId
The field for thespriteIdrecord component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
MAP_CODEC
-
-
Constructor Details
-
SingleFile
-
SingleFile
Creates an instance of aSingleFilerecord class.- Parameters:
resourceId- the value for theresourceIdrecord componentspriteId- the value for thespriteIdrecord component
-
-
Method Details
-
run
- Specified by:
runin interfaceSpriteSource
-
codec
- Specified by:
codecin 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 theresourceIdrecord component.- Returns:
- the value of the
resourceIdrecord component
-
spriteId
Returns the value of thespriteIdrecord component.- Returns:
- the value of the
spriteIdrecord component
-