BlockRotationConfig class
Пакет: com.hypixel.hytale.server.core.universe.world.connectedblocks.config
Файл: com/hypixel/hytale/server/core/universe/world/connectedblocks/config/BlockRotationConfig.java
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<BlockRotationConfig> |
CODEC |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.universe.world.connectedblocks.config;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.Rotation;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.RotationTuple;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BlockRotationConfig {
class="kw">public class="kw">static class="kw">final BuilderCodec<BlockRotationConfig> CODEC = BuilderCodec.<BlockRotationConfig>builder(BlockRotationConfig.class, BlockRotationConfig::new)
.metadata(UIDisplayMode.COMPACT)
.append(new KeyedCodec<>("Yaw", Rotation.CODEC), (var0, var1) -> var0.yaw = var1, var0 -> var0.yaw == Rotation.None ? null : var0.yaw)
.add()
.append(new KeyedCodec<>("Pitch", Rotation.CODEC), (var0, var1) -> var0.pitch = var1, var0 -> var0.pitch == Rotation.None ? null : var0.pitch)
.add()
.append(new KeyedCodec<>("Roll", Rotation.CODEC), (var0, var1) -> var0.roll = var1, var0 -> var0.roll == Rotation.None ? null : var0.roll)
.add()
.build();
@Nonnull
class="kw">private Rotation yaw = Rotation.None;
@Nonnull
class="kw">private Rotation pitch = Rotation.None;
@Nonnull
class="kw">private Rotation roll = Rotation.None;
class="kw">private BlockRotationConfig() {
}
class="kw">public BlockRotationConfig(RotationTuple var1) {
this.yaw = var1.yaw();
this.pitch = var1.pitch();
this.roll = var1.roll();
}
@Nonnull
class="kw">public RotationTuple toRotationTuple() {
class="kw">return RotationTuple.of(this.yaw, this.pitch, this.roll);
}
}