@ApiStatus.NonExtendable public interface Language extends ResourcePackPart, net.kyori.adventure.key.Keyed, net.kyori.examination.Examinable
Custom language additions require a LanguageEntry
being added to the LanguageMeta instance of the resource
pack.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Language.Builder
A builder for
Language instances. |
| Modifier and Type | Method and Description |
|---|---|
default void |
addTo(@NotNull ResourceContainer resourceContainer)
Adds this language to the given resource container.
|
static @NotNull Language.Builder |
builder()
Deprecated.
Use
language() instead,
it is better for static imports |
@NotNull net.kyori.adventure.key.Key |
key()
Returns the language key.
|
static @NotNull Language.Builder |
language()
Creates a new
Language instance builder. |
static @NotNull Language |
language(@NotNull net.kyori.adventure.key.Key key,
@NotNull java.util.Map<java.lang.String,java.lang.String> translations)
Creates a new
Language object which holds
the given translations in a Map. |
static @NotNull Language |
of(@NotNull net.kyori.adventure.key.Key key,
@NotNull java.util.Map<java.lang.String,java.lang.String> translations)
Deprecated.
Use
language(Key, Map) instead,
it is better for static imports |
default @Nullable java.lang.String |
translation(@NotNull java.lang.String key)
Returns the translation for the given key, or null if there is
no translation.
|
default @Nullable java.lang.String |
translation(@NotNull net.kyori.adventure.translation.Translatable translatable)
Returns the translation for the given
Translatable object,
or null if there is no translation. |
@NotNull java.util.Map<java.lang.String,java.lang.String> |
translations()
Returns a map containing all the translations for this language, where
the key is the translation key (yeah) and the value is the actual translation,
in example, there could be a translation for the Stone block
|
compound, compound@NotNull static @NotNull Language language(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> translations)
Language object which holds
the given translations in a Map.key - The language keytranslations - The translations@NotNull static @NotNull Language.Builder language()
Language instance builder.@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull Language of(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> translations)
language(Key, Map) instead,
it is better for static importsLanguage object which holds
the given translations in a Maptranslations - The language translations@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull Language.Builder builder()
language() instead,
it is better for static importsLanguage instance builder.@NotNull @NotNull net.kyori.adventure.key.Key key()
For example, the English language key is "minecraft:en_us"
key in interface net.kyori.adventure.key.Keyed@NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> translations()
"block.minecraft.stone" -> "Stone"
@Nullable
default @Nullable java.lang.String translation(@NotNull
@NotNull java.lang.String key)
key - The translation key@Nullable
default @Nullable java.lang.String translation(@NotNull
@NotNull net.kyori.adventure.translation.Translatable translatable)
Translatable object,
or null if there is no translation.translatable - The translatable objectdefault void addTo(@NotNull
@NotNull ResourceContainer resourceContainer)
addTo in interface ResourcePackPartresourceContainer - The resource container