@ApiStatus.NonExtendable public interface Texture extends ResourcePackPart, net.kyori.adventure.key.Keyed, net.kyori.examination.Examinable, Metadatable
Textures determine the colors/skin of every block, item, mob, font, etc. in the game
The dimensions of the texture must be square, or the
height must be a multiple of the width (for animated
textures only, see AnimationMeta)
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Texture.Builder
A builder for texture instances.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
addTo(@NotNull ResourceContainer resourceContainer)
Adds this texture to the given resource container.
|
static @NotNull Texture.Builder |
builder()
Deprecated.
Use
texture() instead,
it's better for static imports |
@NotNull Writable |
data()
Returns the texture's PNG image data, as a
Writable object, never null |
default @NotNull Texture |
data(@NotNull Writable data)
Returns an updated texture with the given data.
|
@NotNull net.kyori.adventure.key.Key |
key()
Returns this texture's key (location), a key contains
the texture namespace and path, so that the full texture
path is formatted like
assets/<namespace>/textures/<path> |
default @NotNull Texture |
key(@NotNull net.kyori.adventure.key.Key key)
Returns an updated texture with the given key.
|
@NotNull Metadata |
meta()
Returns the metadata object for this texture,
contains some extra information for the texture
|
default @NotNull Texture |
meta(@NotNull Metadata meta)
Returns an updated texture with the given metadata.
|
static @NotNull Texture |
of(@NotNull net.kyori.adventure.key.Key key,
@NotNull Writable data)
Deprecated.
Use
texture(Key, Writable) instead,
it's better for static imports |
static @NotNull Texture |
of(@NotNull net.kyori.adventure.key.Key key,
@NotNull Writable data,
@NotNull Metadata meta)
Deprecated.
Use
texture(Key, Writable) instead,
it's better for static imports |
static @NotNull Texture.Builder |
texture()
Creates a new builder for textures.
|
static @NotNull Texture |
texture(@NotNull net.kyori.adventure.key.Key key,
@NotNull Writable data)
Creates a texture.
|
static @NotNull Texture |
texture(@NotNull net.kyori.adventure.key.Key key,
@NotNull Writable data,
@NotNull Metadata meta)
Creates a texture.
|
default @NotNull Texture.Builder |
toBuilder()
Returns a new texture builder with all properties
from this texture.
|
compound, compoundexaminableName, examinableProperties, examinehasMetadata@NotNull static @NotNull Texture texture(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull Writable data)
key - The texture keydata - The texture data@NotNull static @NotNull Texture texture(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull Writable data, @NotNull @NotNull Metadata meta)
key - The texture keydata - The texture datameta - The texture metadata@NotNull static @NotNull Texture.Builder texture()
@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull Texture of(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull Writable data)
texture(Key, Writable) instead,
it's better for static importskey - The texture keydata - The texture data@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull Texture of(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull Writable data, @NotNull @NotNull Metadata meta)
texture(Key, Writable) instead,
it's better for static importskey - The texture keydata - The texture datameta - The texture metadata@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull Texture.Builder builder()
texture() instead,
it's better for static imports@NotNull @NotNull net.kyori.adventure.key.Key key()
assets/<namespace>/textures/<path>
Example key for a texture:
Key key = Key.key("minecraft", "block/allium.png");
Note that the key value must have the file full path,
this means that the key value must also contain the file
extension, if any.key in interface net.kyori.adventure.key.Keyed@Contract(value="_ -> new",
pure=true)
@NotNull
default @NotNull Texture key(@NotNull
@NotNull net.kyori.adventure.key.Key key)
key - The texture key@NotNull @NotNull Writable data()
Writable object, never null@Contract(value="_ -> new",
pure=true)
@NotNull
default @NotNull Texture data(@NotNull
@NotNull Writable data)
data - The texture data@NotNull @NotNull Metadata meta()
Default Minecraft client only supports AnimationMeta,
VillagerMeta and TextureMeta
meta in interface Metadatable@Contract(value="_ -> new",
pure=true)
@NotNull
default @NotNull Texture meta(@NotNull
@NotNull Metadata meta)
meta in interface Metadatablemeta - The new metadata@Contract(value="-> new") @NotNull default @NotNull Texture.Builder toBuilder()
default void addTo(@NotNull
@NotNull ResourceContainer resourceContainer)
addTo in interface ResourcePackPartresourceContainer - The resource container