ViewBobbing class

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

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

implements: NetworkSerializable<com.hypixel.hytale.protocol.ViewBobbing>, JsonAssetWithMap<MovementType, AssetMap<MovementType, ViewBobbing>>

Методы (1)

МодификаторыВозвратСигнатура
public MovementType getIdMovementType getId()

Исходный код

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

class="kw">import com.hypixel.hytale.assetstore.AssetExtraInfo;
class="kw">import com.hypixel.hytale.assetstore.AssetMap;
class="kw">import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
class="kw">import com.hypixel.hytale.builtin.adventure.camera.asset.CameraShakeConfig;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.codecs.EnumCodec;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.protocol.MovementType;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import javax.annotation.Nonnull;

class="kw">public class ViewBobbing
   class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.ViewBobbing>,
   JsonAssetWithMap<MovementType, AssetMap<MovementType, ViewBobbing>> {
   @Nonnull
   class="kw">public class="kw">static class="kw">final Codec<MovementType> MOVEMENT_TYPE_CODEC = new EnumCodec<>(MovementType.class);
   @Nonnull
   class="kw">public class="kw">static class="kw">final AssetBuilderCodec<MovementType, ViewBobbing> CODEC = AssetBuilderCodec.builder(
         ViewBobbing.class,
         ViewBobbing::new,
         MOVEMENT_TYPE_CODEC,
         (var0, var1) -> var0.id = var1,
         ViewBobbing::getId,
         (var0, var1) -> var0.data = var1,
         var0 -> var0.data
      )
      .appendInherited(
         new KeyedCodec<>("FirstPerson", CameraShakeConfig.CODEC),
         (var0, var1) -> var0.firstPerson = var1,
         var0 -> var0.firstPerson,
         (var0, var1) -> var0.firstPerson = var1.firstPerson
      )
      .documentation("The camera shake profile to be applied")
      .addValidator(Validators.nonNull())
      .add()
      .build();
   class="kw">protected MovementType id;
   class="kw">protected AssetExtraInfo.Data data;
   @Nonnull
   class="kw">protected CameraShakeConfig firstPerson;

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

   class="kw">public MovementType getId() {
      class="kw">return this.id;
   }

   @Nonnull
   class="kw">public com.hypixel.hytale.protocol.ViewBobbing toPacket() {
      class="kw">return new com.hypixel.hytale.protocol.ViewBobbing(this.firstPerson.toPacket());
   }

   @Nonnull
   @Override
   class="kw">public String toString() {
      class="kw">return "ViewBobbing{id=" + this.id + ", data=" + this.data + ", firstPerson=" + this.firstPerson + "}";
   }
}