RotationNoise class

Пакет: com.hypixel.hytale.builtin.adventure.camera.asset

Файл: com/hypixel/hytale/builtin/adventure/camera/asset/CameraShakeConfig.java

implements: NetworkSerializable<com.hypixel.hytale.protocol.RotationNoise>

Поля (5)

МодификаторыТипИмя
public static final BuilderCodec<CameraShakeConfig.RotationNoise> CODEC
public static final CameraShakeConfig.RotationNoise NONE
protected NoiseConfig[] pitch
protected NoiseConfig[] roll
protected NoiseConfig[] yaw

Методы (2)

МодификаторыВозвратСигнатура
public com.hypixel.hytale.protocol.RotationNoise toPacketpublic com.hypixel.hytale.protocol.RotationNoise toPacket()
public String toStringpublic String toString()

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.camera.asset;

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 com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import java.util.Arrays;
class="kw">import javax.annotation.Nonnull;

class="kw">public class CameraShakeConfig class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.CameraShakeConfig> {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<CameraShakeConfig> CODEC = BuilderCodec.builder(CameraShakeConfig.class, CameraShakeConfig::new)
      .appendInherited(
         new KeyedCodec<>("Duration", Codec.FLOAT), (var0, var1) -> var0.duration = var1, var0 -> var0.duration, (var0, var1) -> var0.duration = var1.duration
      )
      .documentation("The time period that the camera will shake at full intensity for")
      .addValidator(Validators.min(0.0F))
      .add()
      .<Float>appendInherited(
         new KeyedCodec<>("StartTime", Codec.FLOAT),
         (var0, var1) -> var0.startTime = var1,
         var0 -> var0.startTime,
         (var0, var1) -> var0.startTime = var1.startTime
      )
      .documentation(
         "The initial time value that the Offset and Rotation noises are sampled from when the camera-shake starts. If absent, the camera-shake uses a continuously incremented time value."
      )
      .add()
      .<EasingConfig>appendInherited(
         new KeyedCodec<>("EaseIn", EasingConfig.CODEC), (var0, var1) -> var0.easeIn = var1, var0 -> var0.easeIn, (var0, var1) -> var0.easeIn = var1.easeIn
      )
      .documentation("The fade-in time and intensity curve for the camera shake")
      .addValidator(Validators.nonNull())
      .add()
      .<EasingConfig>appendInherited(
         new KeyedCodec<>("EaseOut", EasingConfig.CODEC),
         (var0, var1) -> var0.easeOut = var1,
         var0 -> var0.easeOut,
         (var0, var1) -> var0.easeOut = var1.easeOut
      )
      .documentation("The fade-out time and intensity curve for the camera shake")
      .addValidator(Validators.nonNull())
      .add()
      .<CameraShakeConfig.OffsetNoise>appendInherited(
         new KeyedCodec<>("Offset", CameraShakeConfig.OffsetNoise.CODEC),
         (var0, var1) -> var0.offset = var1,
         var0 -> var0.offset,
         (var0, var1) -> var0.offset = var1.offset
      )
      .documentation("The translational offset motion")
      .add()
      .<CameraShakeConfig.RotationNoise>appendInherited(
         new KeyedCodec<>("Rotation", CameraShakeConfig.RotationNoise.CODEC),
         (var0, var1) -> var0.rotation = var1,
         var0 -> var0.rotation,
         (var0, var1) -> var0.rotation = var1.rotation
      )
      .documentation("The rotational motion")
      .add()
      .build();
   @Nonnull
   class="kw">public class="kw">static class="kw">final CameraShakeConfig NONE = new CameraShakeConfig();
   class="kw">protected float duration;
   class="kw">protected Float startTime;
   class="kw">protected EasingConfig easeIn = EasingConfig.NONE;
   class="kw">protected EasingConfig easeOut = EasingConfig.NONE;
   class="kw">protected CameraShakeConfig.OffsetNoise offset = CameraShakeConfig.OffsetNoise.NONE;
   class="kw">protected CameraShakeConfig.RotationNoise rotation = CameraShakeConfig.RotationNoise.NONE;

   class="kw">public CameraShakeConfig() {
   }

   @Nonnull
   class="kw">public com.hypixel.hytale.protocol.CameraShakeConfig toPacket() {
      boolean var1 = this.startTime == null;
      float var2 = var1 ? 0.0F : this.startTime;
      class="kw">return new com.hypixel.hytale.protocol.CameraShakeConfig(
         this.duration, var2, var1, this.easeIn.toPacket(), this.easeOut.toPacket(), this.offset.toPacket(), this.rotation.toPacket()
      );
   }

   @Nonnull
   @Override
   class="kw">public String toString() {
      class="kw">return "CameraShakeConfig{duration="
         + this.duration
         + ", startTime="
         + this.startTime
         + ", easeIn="
         + this.easeIn
         + ", easeOut="
         + this.easeOut
         + ", offset="
         + this.offset
         + ", rotation="
         + this.rotation
         + "}";
   }

   class="kw">public class="kw">static class OffsetNoise class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.OffsetNoise> {
      @Nonnull
      class="kw">public class="kw">static class="kw">final BuilderCodec<CameraShakeConfig.OffsetNoise> CODEC = BuilderCodec.builder(
            CameraShakeConfig.OffsetNoise.class, CameraShakeConfig.OffsetNoise::new
         )
         .documentation(
            "The translational offset noise sources. Each component's list of noise configurations are summed together to calculate the output value for that component"
         )
         .<NoiseConfig[]>appendInherited(
            new KeyedCodec<>("X", NoiseConfig.ARRAY_CODEC), (var0, var1) -> var0.x = var1, var0 -> var0.x, (var0, var1) -> var0.x = var1.x
         )
         .documentation("The noise used to vary the camera x-offset")
         .add()
         .<NoiseConfig[]>appendInherited(
            new KeyedCodec<>("Y", NoiseConfig.ARRAY_CODEC), (var0, var1) -> var0.y = var1, var0 -> var0.y, (var0, var1) -> var0.y = var1.y
         )
         .documentation("The noise used to vary the camera y-offset")
         .add()
         .<NoiseConfig[]>appendInherited(
            new KeyedCodec<>("Z", NoiseConfig.ARRAY_CODEC), (var0, var1) -> var0.z = var1, var0 -> var0.z, (var0, var1) -> var0.z = var1.z
         )
         .documentation("The noise used to vary the camera z-offset")
         .add()
         .build();
      @Nonnull
      class="kw">public class="kw">static class="kw">final CameraShakeConfig.OffsetNoise NONE = new CameraShakeConfig.OffsetNoise();
      class="kw">protected NoiseConfig[] x;
      class="kw">protected NoiseConfig[] y;
      class="kw">protected NoiseConfig[] z;

      class="kw">public OffsetNoise() {
      }

      @Nonnull
      class="kw">public com.hypixel.hytale.protocol.OffsetNoise toPacket() {
         class="kw">return new com.hypixel.hytale.protocol.OffsetNoise(NoiseConfig.toPacket(this.x), NoiseConfig.toPacket(this.y), NoiseConfig.toPacket(this.z));
      }

      @Nonnull
      @Override
      class="kw">public String toString() {
         class="kw">return "OffsetNoise{x=" + Arrays.toString(this.x) + ", y=" + Arrays.toString(this.y) + ", z=" + Arrays.toString(this.z) + "}";
      }
   }

   class="kw">public class="kw">static class RotationNoise class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.RotationNoise> {
      @Nonnull
      class="kw">public class="kw">static class="kw">final BuilderCodec<CameraShakeConfig.RotationNoise> CODEC = BuilderCodec.builder(
            CameraShakeConfig.RotationNoise.class, CameraShakeConfig.RotationNoise::new
         )
         .documentation(
            "The rotational noise sources. Each component's list of noise configurations are summed together to calculate the output value for that component"
         )
         .<NoiseConfig[]>appendInherited(
            new KeyedCodec<>("Pitch", NoiseConfig.ARRAY_CODEC), (var0, var1) -> var0.pitch = var1, var0 -> var0.pitch, (var0, var1) -> var0.pitch = var1.pitch
         )
         .documentation("The noise used to vary the camera pitch")
         .add()
         .<NoiseConfig[]>appendInherited(
            new KeyedCodec<>("Yaw", NoiseConfig.ARRAY_CODEC), (var0, var1) -> var0.yaw = var1, var0 -> var0.yaw, (var0, var1) -> var0.yaw = var1.yaw
         )
         .documentation("The noise used to vary the camera yaw")
         .add()
         .<NoiseConfig[]>appendInherited(
            new KeyedCodec<>("Roll", NoiseConfig.ARRAY_CODEC), (var0, var1) -> var0.roll = var1, var0 -> var0.roll, (var0, var1) -> var0.roll = var1.roll
         )
         .documentation("The noise used to vary the camera roll")
         .add()
         .build();
      @Nonnull
      class="kw">public class="kw">static class="kw">final CameraShakeConfig.RotationNoise NONE = new CameraShakeConfig.RotationNoise();
      class="kw">protected NoiseConfig[] pitch;
      class="kw">protected NoiseConfig[] yaw;
      class="kw">protected NoiseConfig[] roll;

      class="kw">public RotationNoise() {
      }

      @Nonnull
      class="kw">public com.hypixel.hytale.protocol.RotationNoise toPacket() {
         class="kw">return new com.hypixel.hytale.protocol.RotationNoise(NoiseConfig.toPacket(this.pitch), NoiseConfig.toPacket(this.yaw), NoiseConfig.toPacket(this.roll));
      }

      @Nonnull
      @Override
      class="kw">public String toString() {
         class="kw">return "RotationNoise{pitch=" + Arrays.toString(this.pitch) + ", yaw=" + Arrays.toString(this.yaw) + ", roll=" + Arrays.toString(this.roll) + "}";
      }
   }
}