Record Class PalettedPermutations
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.texture.atlas.sources.PalettedPermutations
- All Implemented Interfaces:
SpriteSource, SpriteSourceExtension
public record PalettedPermutations(List<Identifier> textures, Identifier paletteKey, Map<String, Identifier> permutations, String separator)
extends Record
implements SpriteSource
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface SpriteSource
SpriteSource.DiscardableLoader, SpriteSource.Loader, SpriteSource.Output -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate static final org.slf4j.Loggerstatic final com.mojang.serialization.MapCodec<PalettedPermutations> private final IdentifierThe field for thepaletteKeyrecord component.private final Map<String, Identifier> The field for thepermutationsrecord component.private final StringThe field for theseparatorrecord component.private final List<Identifier> The field for thetexturesrecord component.Fields inherited from interface SpriteSource
TEXTURE_ID_CONVERTER -
Constructor Summary
ConstructorsConstructorDescriptionPalettedPermutations(List<Identifier> textures, Identifier paletteKey, Map<String, Identifier> permutations) PalettedPermutations(List<Identifier> textures, Identifier paletteKey, Map<String, Identifier> permutations, String separator) Creates an instance of aPalettedPermutationsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<PalettedPermutations> codec()private static IntUnaryOperatorcreatePaletteMapping(int[] keys, int[] values) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private static int[]loadPaletteEntryFromImage(ResourceManager resourceManager, Identifier location) Returns the value of thepaletteKeyrecord component.Returns the value of thepermutationsrecord component.voidrun(ResourceManager resourceManager, SpriteSource.Output output) Returns the value of theseparatorrecord component.textures()Returns the value of thetexturesrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface SpriteSourceExtension
run
-
Field Details
-
textures
The field for thetexturesrecord component. -
paletteKey
The field for thepaletteKeyrecord component. -
permutations
The field for thepermutationsrecord component. -
separator
The field for theseparatorrecord component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
DEFAULT_SEPARATOR
- See Also:
-
MAP_CODEC
-
-
Constructor Details
-
PalettedPermutations
public PalettedPermutations(List<Identifier> textures, Identifier paletteKey, Map<String, Identifier> permutations) -
PalettedPermutations
public PalettedPermutations(List<Identifier> textures, Identifier paletteKey, Map<String, Identifier> permutations, String separator) Creates an instance of aPalettedPermutationsrecord class.- Parameters:
textures- the value for thetexturesrecord componentpaletteKey- the value for thepaletteKeyrecord componentpermutations- the value for thepermutationsrecord componentseparator- the value for theseparatorrecord component
-
-
Method Details
-
run
- Specified by:
runin interfaceSpriteSource
-
createPaletteMapping
-
loadPaletteEntryFromImage
private static int[] loadPaletteEntryFromImage(ResourceManager resourceManager, Identifier location) -
codec
- Specified by:
codecin interfaceSpriteSource
-
toString
-
hashCode
-
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). -
textures
Returns the value of thetexturesrecord component.- Returns:
- the value of the
texturesrecord component
-
paletteKey
Returns the value of thepaletteKeyrecord component.- Returns:
- the value of the
paletteKeyrecord component
-
permutations
Returns the value of thepermutationsrecord component.- Returns:
- the value of the
permutationsrecord component
-
separator
Returns the value of theseparatorrecord component.- Returns:
- the value of the
separatorrecord component
-