Record Class DirectoryPalettedPermutations
- All Implemented Interfaces:
SpriteSource, SpriteSourceExtension
An implementation of vanilla's PalettedPermutations loader that uses a whole directory instead of just a list of contents.
If you wish to use the PalettedPermutations system for something, using this would be preferred as it allows other mods to also utilize your system to its fullest extent.
The problem with vanilla's system is that if Mod A adds a texture and Mod B adds a palette, the game will not recognize the additions of both and won't generate files for Mod A's texture using mod B's palette. Because Mod A doesn't list Mod B's materials in their atlas JSON, and Mod B doesn't list Mod A's pattern in their atlas JSON, the 2 don't work together.
This system makes it so only the owner of the atlas needs to create a JSON file, all other mods will be supported by default if they put their textures in the proper directory.
-
Nested Class Summary
Nested classes/interfaces inherited from interface SpriteSource
SpriteSource.DiscardableLoader, SpriteSource.Loader, SpriteSource.Output -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<DirectoryPalettedPermutations> static final Identifierprivate final IdentifierThe field for thepaletteKeyrecord component.private final StringThe field for thepalettePathrecord component.private final StringThe field for thetexturePathrecord component.Fields inherited from interface SpriteSource
TEXTURE_ID_CONVERTER -
Constructor Summary
ConstructorsConstructorDescriptionDirectoryPalettedPermutations(String texturePath, Identifier paletteKey, String palettePath) Creates an instance of aDirectoryPalettedPermutationsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends SpriteSource> 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 thepaletteKeyrecord component.Returns the value of thepalettePathrecord component.voidrun(ResourceManager manager, SpriteSource.Output output) Returns the value of thetexturePathrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface SpriteSourceExtension
run
-
Field Details
-
texturePath
The field for thetexturePathrecord component. -
paletteKey
The field for thepaletteKeyrecord component. -
palettePath
The field for thepalettePathrecord component. -
ID
-
CODEC
-
-
Constructor Details
-
DirectoryPalettedPermutations
Creates an instance of aDirectoryPalettedPermutationsrecord class.- Parameters:
texturePath- the value for thetexturePathrecord componentpaletteKey- the value for thepaletteKeyrecord componentpalettePath- the value for thepalettePathrecord component
-
-
Method Details
-
run
- Specified by:
runin interfaceSpriteSource
-
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). -
texturePath
Returns the value of thetexturePathrecord component.- Returns:
- the value of the
texturePathrecord component
-
paletteKey
Returns the value of thepaletteKeyrecord component.- Returns:
- the value of the
paletteKeyrecord component
-
palettePath
Returns the value of thepalettePathrecord component.- Returns:
- the value of the
palettePathrecord component
-