Trail class

Пакет: com.hypixel.hytale.server.core.asset.type.trail.config

Файл: com/hypixel/hytale/server/core/asset/type/trail/config/Trail.java

implements: JsonAssetWithMap<String, DefaultAssetMap<String, Trail>>, NetworkSerializable<com.hypixel.hytale.protocol.Trail>

Поля (5)

МодификаторыТипИмя
ASSET_STORE
final AssetBuilderCodec<String, Trail> CODEC
com.hypixel.hytale.protocol.Trail var1
com.hypixel.hytale.protocol.Trail var2
Vector2i var3

Методы (19)

МодификаторыВозвратСигнатура
public Animation getAnimationAnimation getAnimation()
static DefaultAssetMap<String, Trail> getAssetMapDefaultAssetMap<String, Trail> getAssetMap()
static AssetStore<String, Trail, DefaultAssetMap<String, Trail>> getAssetStoreAssetStore<String, Trail, DefaultAssetMap<String, Trail>> getAssetStore()
public Edge getEndEdge getEnd()
public String getIdString getId()
public IntersectionHighlight getIntersectionHighlightIntersectionHighlight getIntersectionHighlight()
public int getLifeSpanint getLifeSpan()
public float getLightInfluencefloat getLightInfluence()
public FXRenderMode getRenderModeFXRenderMode getRenderMode()
public float getRollfloat getRoll()
public Edge getStartEdge getStart()
public String getTextureString getTexture()
if if(ASSET_STORE == null)
if if(var1 != null)
if if(this.start != null)
if if(this.end != null)
if if(this.animation != null)
if if(var3 != null)
public boolean isSmoothboolean isSmooth()

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.trail.config;

class="kw">import com.hypixel.hytale.assetstore.AssetExtraInfo;
class="kw">import com.hypixel.hytale.assetstore.AssetKeyValidator;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.AssetStore;
class="kw">import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
class="kw">import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
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.schema.metadata.ui.UIDefaultCollapsedState;
class="kw">import com.hypixel.hytale.codec.validation.ValidatorCache;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.protocol.FXRenderMode;
class="kw">import com.hypixel.hytale.protocol.IntersectionHighlight;
class="kw">import com.hypixel.hytale.server.core.asset.common.CommonAssetValidator;
class="kw">import com.hypixel.hytale.server.core.codec.ProtocolCodecs;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import java.lang.ref.SoftReference;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector2i;

class="kw">public class Trail class="kw">implements JsonAssetWithMap<String, DefaultAssetMap<String, Trail>>, NetworkSerializable<com.hypixel.hytale.protocol.Trail> {
   class="kw">public class="kw">static class="kw">final AssetBuilderCodec<String, Trail> CODEC = AssetBuilderCodec.builder(
         Trail.class, Trail::new, Codec.STRING, (var0, var1) -> var0.id = var1, var0 -> var0.id, (var0, var1) -> var0.data = var1, var0 -> var0.data
      )
      .appendInherited(
         new KeyedCodec<>("TexturePath", Codec.STRING), (var0, var1) -> var0.texture = var1, var0 -> var0.texture, (var0, var1) -> var0.texture = var1.texture
      )
      .addValidator(Validators.nonNull())
      .addValidator(CommonAssetValidator.TEXTURE_TRAIL)
      .add()
      .appendInherited(
         new KeyedCodec<>("LifeSpan", Codec.INTEGER),
         (var0, var1) -> var0.lifeSpan = var1,
         var0 -> var0.lifeSpan,
         (var0, var1) -> var0.lifeSpan = var1.lifeSpan
      )
      .add()
      .appendInherited(
         new KeyedCodec<>("Roll", Codec.DOUBLE),
         (var0, var1) -> var0.roll = var1.floatValue(),
         var0 -> (double)var0.roll,
         (var0, var1) -> var0.roll = var1.roll
      )
      .add()
      .<Edge>appendInherited(
         new KeyedCodec<>("Start", Edge.CODEC), (var0, var1) -> var0.start = var1, var0 -> var0.start, (var0, var1) -> var0.start = var1.start
      )
      .metadata(UIDefaultCollapsedState.UNCOLLAPSED)
      .add()
      .<Edge>appendInherited(new KeyedCodec<>("End", Edge.CODEC), (var0, var1) -> var0.end = var1, var0 -> var0.end, (var0, var1) -> var0.end = var1.end)
      .metadata(UIDefaultCollapsedState.UNCOLLAPSED)
      .add()
      .<Double>appendInherited(
         new KeyedCodec<>("LightInfluence", Codec.DOUBLE),
         (var0, var1) -> var0.lightInfluence = var1.floatValue(),
         var0 -> (double)var0.lightInfluence,
         (var0, var1) -> var0.lightInfluence = var1.lightInfluence
      )
      .addValidator(Validators.range(0.0, 1.0))
      .add()
      .<FXRenderMode>appendInherited(
         new KeyedCodec<>("RenderMode", new EnumCodec<>(FXRenderMode.class)),
         (var0, var1) -> var0.renderMode = var1,
         var0 -> var0.renderMode,
         (var0, var1) -> var0.renderMode = var1.renderMode
      )
      .addValidator(Validators.nonNull())
      .add()
      .appendInherited(
         new KeyedCodec<>("IntersectionHighlight", ProtocolCodecs.INTERSECTION_HIGHLIGHT),
         (var0, var1) -> var0.intersectionHighlight = var1,
         var0 -> var0.intersectionHighlight,
         (var0, var1) -> var0.intersectionHighlight = var1.intersectionHighlight
      )
      .add()
      .appendInherited(
         new KeyedCodec<>("Smooth", Codec.BOOLEAN), (var0, var1) -> var0.smooth = var1, var0 -> var0.smooth, (var0, var1) -> var0.smooth = var1.smooth
      )
      .add()
      .appendInherited(
         new KeyedCodec<>("Animation", Animation.CODEC),
         (var0, var1) -> var0.animation = var1,
         var0 -> var0.animation,
         (var0, var1) -> var0.animation = var1.animation
      )
      .add()
      .build();
   class="kw">private class="kw">static AssetStore<String, Trail, DefaultAssetMap<String, Trail>> ASSET_STORE;
   class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(Trail::getAssetStore));
   class="kw">protected AssetExtraInfo.Data data;
   class="kw">protected String id;
   class="kw">protected String texture;
   @Nonnull
   class="kw">protected FXRenderMode renderMode = FXRenderMode.BlendLinear;
   class="kw">protected IntersectionHighlight intersectionHighlight;
   class="kw">protected int lifeSpan;
   class="kw">protected float roll;
   class="kw">protected float lightInfluence;
   class="kw">protected boolean smooth;
   class="kw">protected Edge start;
   class="kw">protected Edge end;
   class="kw">protected Animation animation;
   class="kw">protected SoftReference<com.hypixel.hytale.protocol.Trail> cachedPacket;

   class="kw">public class="kw">static AssetStore<String, Trail, DefaultAssetMap<String, Trail>> getAssetStore() {
      if (ASSET_STORE == null) {
         ASSET_STORE = AssetRegistry.getAssetStore(Trail.class);
      }

      class="kw">return ASSET_STORE;
   }

   class="kw">public class="kw">static DefaultAssetMap<String, Trail> getAssetMap() {
      class="kw">return (DefaultAssetMap<String, Trail>)getAssetStore().getAssetMap();
   }

   class="kw">public Trail(
      String var1,
      String var2,
      FXRenderMode var3,
      IntersectionHighlight var4,
      int var5,
      float var6,
      float var7,
      boolean var8,
      Edge var9,
      Edge var10,
      Animation var11
   ) {
      this.id = var1;
      this.texture = var2;
      this.renderMode = var3;
      this.intersectionHighlight = var4;
      this.lifeSpan = var5;
      this.roll = var6;
      this.lightInfluence = var7;
      this.smooth = var8;
      this.start = var9;
      this.end = var10;
      this.animation = var11;
   }

   class="kw">protected Trail() {
   }

   @Nonnull
   class="kw">public com.hypixel.hytale.protocol.Trail toPacket() {
      com.hypixel.hytale.protocol.Trail var1 = this.cachedPacket == null ? null : this.cachedPacket.get();
      if (var1 != null) {
         class="kw">return var1;
      }

      com.hypixel.hytale.protocol.Trail var2 = new com.hypixel.hytale.protocol.Trail();
      var2.id = this.id;
      var2.texture = this.texture;
      var2.lifeSpan = this.lifeSpan;
      var2.roll = this.roll;
      var2.lightInfluence = this.lightInfluence;
      var2.renderMode = this.renderMode;
      var2.intersectionHighlight = this.intersectionHighlight;
      var2.smooth = this.smooth;
      if (this.start != null) {
         var2.start = this.start.toPacket();
      }

      if (this.end != null) {
         var2.end = this.end.toPacket();
      }

      if (this.animation != null) {
         Vector2i var3 = this.animation.getFrameSize();
         if (var3 != null) {
            var2.frameSize = new com.hypixel.hytale.protocol.Vector2i(var3.x(), var3.y());
         }

         if (this.animation.getFrameRange() != null) {
            var2.frameRange = this.animation.getFrameRange();
         }

         var2.frameLifeSpan = this.animation.getFrameLifeSpan();
      }

      this.cachedPacket = new SoftReference<>(var2);
      class="kw">return var2;
   }

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

   class="kw">public String getTexture() {
      class="kw">return this.texture;
   }

   class="kw">public FXRenderMode getRenderMode() {
      class="kw">return this.renderMode;
   }

   class="kw">public IntersectionHighlight getIntersectionHighlight() {
      class="kw">return this.intersectionHighlight;
   }

   class="kw">public int getLifeSpan() {
      class="kw">return this.lifeSpan;
   }

   class="kw">public float getRoll() {
      class="kw">return this.roll;
   }

   class="kw">public float getLightInfluence() {
      class="kw">return this.lightInfluence;
   }

   class="kw">public boolean isSmooth() {
      class="kw">return this.smooth;
   }

   class="kw">public Edge getStart() {
      class="kw">return this.start;
   }

   class="kw">public Edge getEnd() {
      class="kw">return this.end;
   }

   class="kw">public Animation getAnimation() {
      class="kw">return this.animation;
   }

   @Nonnull
   @Override
   class="kw">public String toString() {
      class="kw">return "Trail{id='"
         + this.id
         + "', texture='"
         + this.texture
         + "', renderMode="
         + this.renderMode
         + ", intersectionHighlight="
         + this.intersectionHighlight
         + ", lifeSpan="
         + this.lifeSpan
         + ", roll="
         + this.roll
         + ", lightInfluence="
         + this.lightInfluence
         + ", smooth="
         + this.smooth
         + ", start="
         + this.start
         + ", end="
         + this.end
         + ", animation="
         + this.animation
         + "}";
   }
}