@ApiStatus.NonExtendable
public interface AtlasSource
extends net.kyori.examination.Examinable
Atlas. Every atlas source
runs in during load, in order of definition, adding or
removing new files to the texture list, to be later referenced
by block models, item models, particles, etc.
There are multiple types of atlas sources. See implementations
| Modifier and Type | Method and Description |
|---|---|
static @NotNull DirectoryAtlasSource |
directory(@NotNull java.lang.String source,
@NotNull java.lang.String prefix)
Creates a new
DirectoryAtlasSource, directory
atlas sources add all the files in a directory and its
subdirectories, across all namespaces. |
static @NotNull FilterAtlasSource |
filter(@NotNull KeyPattern pattern)
Creates a new
FilterAtlasSource, filter atlas sources
remove sprites matching the given pattern, only works for entries
already in the list. |
static @NotNull PalettedPermutationsAtlasSource |
palettedPermutations(@NotNull java.util.List<net.kyori.adventure.key.Key> textures,
@NotNull net.kyori.adventure.key.Key paletteKey,
@NotNull java.util.Map<java.lang.String,net.kyori.adventure.key.Key> permutations)
Creates a new
PalettedPermutationsAtlasSource, paletted permutations
atlas sources dynamically generate textures in-memory with specific color sets. |
static @NotNull SingleAtlasSource |
single(@NotNull net.kyori.adventure.key.Key resource)
Creates a new
SingleAtlasSource, single
atlas sources add a single file. |
static @NotNull SingleAtlasSource |
single(@NotNull net.kyori.adventure.key.Key resource,
@Nullable net.kyori.adventure.key.Key sprite)
Creates a new
SingleAtlasSource, single
atlas sources add a single file and maps it to
a custom name (sprite) if set |
static @NotNull UnstitchAtlasSource |
unstitch(@NotNull net.kyori.adventure.key.Key resource,
@NotNull java.util.List<UnstitchAtlasSource.Region> regions,
double xDivisor,
double yDivisor)
Deprecated.
Use
unstitch(Key, List, Vector2Float) instead |
static @NotNull UnstitchAtlasSource |
unstitch(@NotNull net.kyori.adventure.key.Key resource,
@NotNull java.util.List<UnstitchAtlasSource.Region> regions,
@NotNull Vector2Float divisor)
Creates a new
UnstitchAtlasSource, unstitch atlas sources
copy rectangular regions from other images. |
@NotNull static @NotNull SingleAtlasSource single(@NotNull @NotNull net.kyori.adventure.key.Key resource, @Nullable @Nullable net.kyori.adventure.key.Key sprite)
SingleAtlasSource, single
atlas sources add a single file and maps it to
a custom name (sprite) if setresource - The texture key (It can be Texture.key())sprite - The sprite nameSingleAtlasSource@NotNull static @NotNull SingleAtlasSource single(@NotNull @NotNull net.kyori.adventure.key.Key resource)
SingleAtlasSource, single
atlas sources add a single file.resource - The texture key (It can be Texture.key())SingleAtlasSource@NotNull static @NotNull DirectoryAtlasSource directory(@NotNull @NotNull java.lang.String source, @NotNull @NotNull java.lang.String prefix)
DirectoryAtlasSource, directory
atlas sources add all the files in a directory and its
subdirectories, across all namespaces.source - The directory in the pack to be listed
(relative to the textures directory)prefix - The prefix to be prepended to the sprite name
when loaded (can be empty)DirectoryAtlasSource@NotNull static @NotNull FilterAtlasSource filter(@NotNull @NotNull KeyPattern pattern)
FilterAtlasSource, filter atlas sources
remove sprites matching the given pattern, only works for entries
already in the list.pattern - The KeyPattern to match the resourcesFilterAtlasSource,
KeyPattern@NotNull static @NotNull UnstitchAtlasSource unstitch(@NotNull @NotNull net.kyori.adventure.key.Key resource, @NotNull @NotNull java.util.List<UnstitchAtlasSource.Region> regions, @NotNull @NotNull Vector2Float divisor)
UnstitchAtlasSource, unstitch atlas sources
copy rectangular regions from other images.resource - The resourceregions - The regions to copydivisor - The divisor, used to determine the units used by the regions@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull UnstitchAtlasSource unstitch(@NotNull @NotNull net.kyori.adventure.key.Key resource, @NotNull @NotNull java.util.List<UnstitchAtlasSource.Region> regions, double xDivisor, double yDivisor)
unstitch(Key, List, Vector2Float) insteadUnstitchAtlasSource, unstitch atlas sources
copy rectangular regions from other images.resource - The resourceregions - The regions to copyxDivisor - The X divisor, used to determine the units used by the regionsyDivisor - The Y divisor, used to determine the units used by the regions@NotNull static @NotNull PalettedPermutationsAtlasSource palettedPermutations(@NotNull @NotNull java.util.List<net.kyori.adventure.key.Key> textures, @NotNull @NotNull net.kyori.adventure.key.Key paletteKey, @NotNull @NotNull java.util.Map<java.lang.String,net.kyori.adventure.key.Key> permutations)
PalettedPermutationsAtlasSource, paletted permutations
atlas sources dynamically generate textures in-memory with specific color sets.textures - A list of the base texturespaletteKey - The key of the palette file that defines the set of key pixel
colors to swap out with the color palettes defined.permutations - A map of permutations from suffix to a key of a color palette file