Record Class NamespacedDirectoryLister
java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.textures.NamespacedDirectoryLister
- All Implemented Interfaces:
SpriteSource
public record NamespacedDirectoryLister(String namespace, String sourcePath, String idPrefix)
extends Record
implements SpriteSource
Namespace-aware version of
DirectoryLister
. This version should be preferred when several textures from
high-traffic directories should be stitched to an atlas without adding assets from other mods that should not be
stitched to this atlas-
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 com.mojang.serialization.MapCodec
<NamespacedDirectoryLister> static final ResourceLocation
private final String
The field for theidPrefix
record component.private final String
The field for thenamespace
record component.private final String
The field for thesourcePath
record component.static final SpriteSourceType
Fields inherited from interface net.minecraft.client.renderer.texture.atlas.SpriteSource
TEXTURE_ID_CONVERTER
-
Constructor Summary
ConstructorsConstructorDescriptionNamespacedDirectoryLister
(String namespace, String sourcePath, String idPrefix) Creates an instance of aNamespacedDirectoryLister
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.idPrefix()
Returns the value of theidPrefix
record component.Returns the value of thenamespace
record component.void
run
(ResourceManager resourceManager, SpriteSource.Output output) Returns the value of thesourcePath
record component.final String
toString()
Returns a string representation of this record class.type()
-
Field Details
-
namespace
The field for thenamespace
record component. -
sourcePath
The field for thesourcePath
record component. -
idPrefix
The field for theidPrefix
record component. -
CODEC
-
ID
-
TYPE
-
-
Constructor Details
-
NamespacedDirectoryLister
Creates an instance of aNamespacedDirectoryLister
record class.- Parameters:
namespace
- the value for thenamespace
record componentsourcePath
- the value for thesourcePath
record componentidPrefix
- the value for theidPrefix
record component
-
-
Method Details
-
run
- Specified by:
run
in interfaceSpriteSource
-
type
- Specified by:
type
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)
. -
namespace
Returns the value of thenamespace
record component.- Returns:
- the value of the
namespace
record component
-
sourcePath
Returns the value of thesourcePath
record component.- Returns:
- the value of the
sourcePath
record component
-
idPrefix
Returns the value of theidPrefix
record component.- Returns:
- the value of the
idPrefix
record component
-