InstanceDiscoveryConfig class
Пакет: com.hypixel.hytale.builtin.instances.config
Файл: com/hypixel/hytale/builtin/instances/config/InstanceDiscoveryConfig.java
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
|
InstanceDiscoveryConfig |
var1 |
Методы (16)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
boolean |
alwaysDisplayboolean alwaysDisplay() |
public |
float |
getDurationfloat getDuration() |
public |
float |
getFadeInDurationfloat getFadeInDuration() |
public |
float |
getFadeOutDurationfloat getFadeOutDuration() |
public |
boolean |
isDisplayboolean isDisplay() |
public |
boolean |
isMajorboolean isMajor() |
public |
void |
setAlwaysDisplayvoid setAlwaysDisplay(boolean var1) |
public |
void |
setDiscoverySoundEventIdvoid setDiscoverySoundEventId(@Nullable String var1) |
public |
void |
setDisplayvoid setDisplay(boolean var1) |
public |
void |
setDurationvoid setDuration(float var1) |
public |
void |
setFadeInDurationvoid setFadeInDuration(float var1) |
public |
void |
setFadeOutDurationvoid setFadeOutDuration(float var1) |
public |
void |
setIconvoid setIcon(@Nullable String var1) |
public |
void |
setMajorvoid setMajor(boolean var1) |
public |
void |
setSubtitleKeyvoid setSubtitleKey(@Nullable String var1) |
public |
void |
setTitleKeyvoid setTitleKey(@Nonnull String var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.instances.config;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class InstanceDiscoveryConfig {
@Nonnull
class="kw">public class="kw">static class="kw">final BuilderCodec<InstanceDiscoveryConfig> CODEC = BuilderCodec.builder(InstanceDiscoveryConfig.class, InstanceDiscoveryConfig::new)
.documentation("Configuration for displaying an event title when a player discovers an instance.")
.<String>append(new KeyedCodec<>("TitleKey", Codec.STRING), (var0, var1) -> var0.titleKey = var1, var0 -> var0.titleKey)
.documentation("The translation key for the primary title (e.g., \"server.instances.gaia_temple.title\").")
.addValidator(Validators.nonNull())
.add()
.<String>append(new KeyedCodec<>("SubtitleKey", Codec.STRING), (var0, var1) -> var0.subtitleKey = var1, var0 -> var0.subtitleKey)
.documentation("The translation key for the subtitle (e.g., \"server.instances.gaia_temple.subtitle\").")
.add()
.<Boolean>append(new KeyedCodec<>("Display", Codec.BOOLEAN), (var0, var1) -> var0.display = var1, var0 -> var0.display)
.documentation("Whether to display the discovery title and play the discovery sound.")
.add()
.<Boolean>append(new KeyedCodec<>("AlwaysDisplay", Codec.BOOLEAN), (var0, var1) -> var0.alwaysDisplay = var1, var0 -> var0.alwaysDisplay)
.documentation("Whether to always display the discovery title, even if already discovered.")
.add()
.<String>append(
new KeyedCodec<>("DiscoverySoundEventId", Codec.STRING), (var0, var1) -> var0.discoverySoundEventId = var1, var0 -> var0.discoverySoundEventId
)
.documentation("The sound event ID to play when discovering this instance.")
.add()
.<String>append(new KeyedCodec<>("Icon", Codec.STRING), (var0, var1) -> var0.icon = var1, var0 -> var0.icon)
.documentation("The icon to display with the event title.")
.add()
.<Boolean>append(new KeyedCodec<>("Major", Codec.BOOLEAN), (var0, var1) -> var0.major = var1, var0 -> var0.major)
.documentation("Whether this is a major discovery (affects visual presentation).")
.add()
.<Float>append(new KeyedCodec<>("Duration", Codec.FLOAT), (var0, var1) -> var0.duration = var1, var0 -> var0.duration)
.documentation("The duration to display the event title for, in seconds.")
.add()
.<Float>append(new KeyedCodec<>("FadeInDuration", Codec.FLOAT), (var0, var1) -> var0.fadeInDuration = var1, var0 -> var0.fadeInDuration)
.documentation("The fade-in duration for the event title, in seconds.")
.add()
.<Float>append(new KeyedCodec<>("FadeOutDuration", Codec.FLOAT), (var0, var1) -> var0.fadeOutDuration = var1, var0 -> var0.fadeOutDuration)
.documentation("The fade-out duration for the event title, in seconds.")
.add()
.build();
@Nullable
class="kw">private String titleKey;
@Nullable
class="kw">private String subtitleKey;
class="kw">private boolean display = true;
class="kw">private boolean alwaysDisplay = false;
@Nullable
class="kw">private String discoverySoundEventId;
@Nullable
class="kw">private String icon;
class="kw">private boolean major = false;
class="kw">private float duration = 4.0F;
class="kw">private float fadeInDuration = 1.5F;
class="kw">private float fadeOutDuration = 1.5F;
class="kw">public InstanceDiscoveryConfig() {
}
@Nullable
class="kw">public String getTitleKey() {
class="kw">return this.titleKey;
}
class="kw">public void setTitleKey(@Nonnull String var1) {
this.titleKey = var1;
}
@Nullable
class="kw">public String getSubtitleKey() {
class="kw">return this.subtitleKey;
}
class="kw">public void setSubtitleKey(@Nullable String var1) {
this.subtitleKey = var1;
}
class="kw">public boolean isDisplay() {
class="kw">return this.display;
}
class="kw">public void setDisplay(boolean var1) {
this.display = var1;
}
class="kw">public boolean alwaysDisplay() {
class="kw">return this.alwaysDisplay;
}
class="kw">public void setAlwaysDisplay(boolean var1) {
this.alwaysDisplay = var1;
}
@Nullable
class="kw">public String getDiscoverySoundEventId() {
class="kw">return this.discoverySoundEventId;
}
class="kw">public void setDiscoverySoundEventId(@Nullable String var1) {
this.discoverySoundEventId = var1;
}
@Nullable
class="kw">public String getIcon() {
class="kw">return this.icon;
}
class="kw">public void setIcon(@Nullable String var1) {
this.icon = var1;
}
class="kw">public boolean isMajor() {
class="kw">return this.major;
}
class="kw">public void setMajor(boolean var1) {
this.major = var1;
}
class="kw">public float getDuration() {
class="kw">return this.duration;
}
class="kw">public void setDuration(float var1) {
this.duration = var1;
}
class="kw">public float getFadeInDuration() {
class="kw">return this.fadeInDuration;
}
class="kw">public void setFadeInDuration(float var1) {
this.fadeInDuration = var1;
}
class="kw">public float getFadeOutDuration() {
class="kw">return this.fadeOutDuration;
}
class="kw">public void setFadeOutDuration(float var1) {
this.fadeOutDuration = var1;
}
@Nonnull
class="kw">public InstanceDiscoveryConfig clone() {
InstanceDiscoveryConfig var1 = new InstanceDiscoveryConfig();
var1.titleKey = this.titleKey;
var1.subtitleKey = this.subtitleKey;
var1.display = this.display;
var1.alwaysDisplay = this.alwaysDisplay;
var1.discoverySoundEventId = this.discoverySoundEventId;
var1.icon = this.icon;
var1.major = this.major;
var1.duration = this.duration;
var1.fadeInDuration = this.fadeInDuration;
var1.fadeOutDuration = this.fadeOutDuration;
class="kw">return var1;
}
}