SleepSoundsConfig class
Пакет: com.hypixel.hytale.server.core.asset.type.gameplay.sleep
Файл: com/hypixel/hytale/server/core/asset/type/gameplay/sleep/SleepSoundsConfig.java
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<SleepSoundsConfig> |
CODEC |
Методы (7)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
int |
getFailIndexint getFailIndex() |
public |
long |
getNotificationCooldownSecondslong getNotificationCooldownSeconds() |
public |
int |
getNotificationIndexint getNotificationIndex() |
public |
long |
getNotificationLoopCooldownMslong getNotificationLoopCooldownMs() |
public |
int |
getNotificationLoopIndexint getNotificationLoopIndex() |
public |
int |
getSuccessIndexint getSuccessIndex() |
public |
boolean |
isNotificationLoopEnabledboolean isNotificationLoopEnabled() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.gameplay.sleep;
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.server.core.asset.type.soundevent.config.SoundEvent;
class="kw">import javax.annotation.Nullable;
class="kw">public class SleepSoundsConfig {
class="kw">public class="kw">static class="kw">final BuilderCodec<SleepSoundsConfig> CODEC = BuilderCodec.builder(SleepSoundsConfig.class, SleepSoundsConfig::new)
.append(new KeyedCodec<>("Success", Codec.STRING), (var0, var1) -> var0.success = var1, var0 -> var0.success)
.addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
.add()
.<String>append(new KeyedCodec<>("Fail", Codec.STRING), (var0, var1) -> var0.fail = var1, var0 -> var0.fail)
.addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
.add()
.<String>append(new KeyedCodec<>("Notification", Codec.STRING), (var0, var1) -> var0.notification = var1, var0 -> var0.notification)
.addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
.add()
.<String>append(new KeyedCodec<>("NotificationLoop", Codec.STRING), (var0, var1) -> var0.notificationLoop = var1, var0 -> var0.notificationLoop)
.addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
.add()
.append(
new KeyedCodec<>("NotificationCooldownSeconds", Codec.INTEGER),
(var0, var1) -> var0.notificationCooldownSeconds = var1,
var0 -> var0.notificationCooldownSeconds
)
.add()
.append(
new KeyedCodec<>("NotificationLoopEnabled", Codec.BOOLEAN), (var0, var1) -> var0.notificationLoopEnabled = var1, var0 -> var0.notificationLoopEnabled
)
.add()
.build();
class="kw">private String success = "SFX_Sleep_Success";
class="kw">private String fail = "SFX_Sleep_Fail";
class="kw">private String notification = "SFX_Sleep_Notification";
class="kw">private String notificationLoop = "SFX_Sleep_Notification_Loop";
class="kw">private int notificationCooldownSeconds = 30;
class="kw">private boolean notificationLoopEnabled = true;
class="kw">public SleepSoundsConfig() {
}
@Nullable
class="kw">public String getSuccess() {
class="kw">return this.success;
}
class="kw">public int getSuccessIndex() {
class="kw">return SoundEvent.getAssetMap().getIndex(this.success);
}
@Nullable
class="kw">public String getFail() {
class="kw">return this.fail;
}
class="kw">public int getFailIndex() {
class="kw">return SoundEvent.getAssetMap().getIndex(this.fail);
}
@Nullable
class="kw">public String getNotification() {
class="kw">return this.notification;
}
class="kw">public int getNotificationIndex() {
class="kw">return SoundEvent.getAssetMap().getIndex(this.notification);
}
@Nullable
class="kw">public String getNotificationLoop() {
class="kw">return this.notificationLoop;
}
class="kw">public int getNotificationLoopIndex() {
class="kw">return SoundEvent.getAssetMap().getIndex(this.notificationLoop);
}
class="kw">public long getNotificationCooldownSeconds() {
class="kw">return this.notificationCooldownSeconds;
}
class="kw">public long getNotificationLoopCooldownMs() {
class="kw">return this.notificationCooldownSeconds * 1000L;
}
class="kw">public boolean isNotificationLoopEnabled() {
class="kw">return this.notificationLoopEnabled;
}
}