Cloud class
Пакет: com.hypixel.hytale.server.core.asset.type.weather.config
Файл: com/hypixel/hytale/server/core/asset/type/weather/config/Cloud.java
implements: NetworkSerializable<com.hypixel.hytale.protocol.Cloud>
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<Cloud> |
CODEC |
|
com.hypixel.hytale.protocol.Cloud |
var1 |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
TimeColorAlpha[] |
getColorsTimeColorAlpha[] getColors() |
public |
TimeFloat[] |
getSpeedsTimeFloat[] getSpeeds() |
public |
String |
getTextureString getTexture() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.weather.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.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIEditor;
class="kw">import com.hypixel.hytale.server.core.asset.common.CommonAssetValidator;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import java.util.Arrays;
class="kw">import javax.annotation.Nonnull;
class="kw">public class Cloud class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.Cloud> {
class="kw">public class="kw">static class="kw">final BuilderCodec<Cloud> CODEC = BuilderCodec.builder(Cloud.class, Cloud::new)
.append(new KeyedCodec<>("Texture", Codec.STRING), (var0, var1) -> var0.texture = var1, Cloud::getTexture)
.addValidator(CommonAssetValidator.TEXTURE_SKY)
.add()
.<TimeColorAlpha[]>append(
new KeyedCodec<>("Colors", new ArrayCodec<>(TimeColorAlpha.CODEC, TimeColorAlpha[]::new)), (var0, var1) -> var0.colors = var1, Cloud::getColors
)
.metadata(new UIEditor(UIEditor.TIMELINE))
.add()
.<TimeFloat[]>append(
new KeyedCodec<>("Speeds", new ArrayCodec<>(TimeFloat.CODEC, TimeFloat[]::new)), (var0, var1) -> var0.speeds = var1, Cloud::getSpeeds
)
.metadata(new UIEditor(UIEditor.TIMELINE))
.add()
.build();
class="kw">protected String texture;
class="kw">protected TimeColorAlpha[] colors;
class="kw">protected TimeFloat[] speeds;
class="kw">public Cloud(String var1, TimeColorAlpha[] var2, TimeFloat[] var3) {
this.texture = var1;
this.colors = var2;
this.speeds = var3;
}
class="kw">protected Cloud() {
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.Cloud toPacket() {
com.hypixel.hytale.protocol.Cloud var1 = new com.hypixel.hytale.protocol.Cloud();
var1.texture = this.texture;
var1.colors = Weather.toColorAlphaMap(this.colors);
var1.speeds = Weather.toFloatMap(this.speeds);
class="kw">return var1;
}
class="kw">public String getTexture() {
class="kw">return this.texture;
}
class="kw">public TimeColorAlpha[] getColors() {
class="kw">return this.colors;
}
class="kw">public TimeFloat[] getSpeeds() {
class="kw">return this.speeds;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "Cloud{texture='" + this.texture + "', colors=" + Arrays.toString(this.colors) + ", speeds=" + Arrays.toString(this.speeds) + "}";
}
}