FogOptions class

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

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

Поля (2)

МодификаторыТипИмя
final BuilderCodec<FogOptions> CODEC
com.hypixel.hytale.protocol.FogOptions var1

Методы (5)

МодификаторыВозвратСигнатура
public float getEffectiveViewDistanceMultiplierfloat getEffectiveViewDistanceMultiplier()
public float getFogHeightCameraOffsetfloat getFogHeightCameraOffset()
if if(this.fogHeightCameraFixed == null)
public boolean isIgnoreFogLimitsboolean isIgnoreFogLimits()
public com.hypixel.hytale.protocol.FogOptions toPacketcom.hypixel.hytale.protocol.FogOptions toPacket()

Исходный код

Показать/скрыть
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 javax.annotation.Nullable;

class="kw">public class FogOptions {
   class="kw">public class="kw">static class="kw">final BuilderCodec<FogOptions> CODEC = BuilderCodec.builder(FogOptions.class, FogOptions::new)
      .appendInherited(
         new KeyedCodec<>("IgnoreFogLimits", Codec.BOOLEAN),
         (var0, var1) -> var0.ignoreFogLimits = var1,
         var0 -> var0.ignoreFogLimits,
         (var0, var1) -> var0.ignoreFogLimits = var1.ignoreFogLimits
      )
      .documentation("The client has a class="kw">default minimum AND maximum for \"FogFar\". Toggling this on will allow your FogDistance[1] to bypass those limits.")
      .add()
      .<Float>appendInherited(
         new KeyedCodec<>("EffectiveViewDistanceMultiplier", Codec.FLOAT),
         (var0, var1) -> var0.effectiveViewDistanceMultiplier = var1,
         var0 -> var0.effectiveViewDistanceMultiplier,
         (var0, var1) -> var0.effectiveViewDistanceMultiplier = var1.effectiveViewDistanceMultiplier
      )
      .documentation(
         "The client's class="kw">default cap for FogDistance[1] (aka FogFar) is the effective view distance, meaning the farthest viewable chunk. This value (defaults 1.0) multiplies that cap. For example with high fog density, you can afford a fog multiplier of 1.3 as the cutoff of unloaded chunks may still be hidden."
      )
      .add()
      .<Float>appendInherited(
         new KeyedCodec<>("FogHeightCameraFixed", Codec.FLOAT),
         (var0, var1) -> var0.fogHeightCameraFixed = var1,
         var0 -> var0.fogHeightCameraFixed,
         (var0, var1) -> var0.fogHeightCameraFixed = var1.fogHeightCameraFixed
      )
      .documentation(
         "By class="kw">default, the client has e^(-FogHeightFalloff * ~Camera.Y) height-based fog. This adds significant fog near Camera.Y = 0. By setting this value (between 0.0 and 1.0), the Exp function is bypassed and there will be a fixed fog for height in the fog shader."
      )
      .add()
      .<Float>appendInherited(
         new KeyedCodec<>("FogHeightCameraOffset", Codec.FLOAT),
         (var0, var1) -> var0.fogHeightCameraOffset = var1,
         var0 -> var0.fogHeightCameraOffset,
         (var0, var1) -> var0.fogHeightCameraOffset = var1.fogHeightCameraOffset
      )
      .documentation(
         "By class="kw">default, the client has e^(-FogHeightFalloff * ~Camera.Y) height-based fog. This adds significant fog near Camera.Y = 0. The FogHeightCameraOffset is added to the Camera.Y."
      )
      .add()
      .build();
   class="kw">private boolean ignoreFogLimits = false;
   class="kw">private float effectiveViewDistanceMultiplier = 1.0F;
   class="kw">private Float fogHeightCameraFixed = null;
   class="kw">private float fogHeightCameraOffset = 0.0F;

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

   class="kw">public boolean isIgnoreFogLimits() {
      class="kw">return this.ignoreFogLimits;
   }

   class="kw">public float getEffectiveViewDistanceMultiplier() {
      class="kw">return this.effectiveViewDistanceMultiplier;
   }

   @Nullable
   class="kw">public Float getFogHeightCameraFixed() {
      class="kw">return this.fogHeightCameraFixed;
   }

   class="kw">public float getFogHeightCameraOffset() {
      class="kw">return this.fogHeightCameraOffset;
   }

   class="kw">public com.hypixel.hytale.protocol.FogOptions toPacket() {
      com.hypixel.hytale.protocol.FogOptions var1 = new com.hypixel.hytale.protocol.FogOptions();
      var1.ignoreFogLimits = this.ignoreFogLimits;
      var1.effectiveViewDistanceMultiplier = this.effectiveViewDistanceMultiplier;
      if (this.fogHeightCameraFixed == null) {
         var1.fogHeightCameraOverriden = false;
      } else {
         var1.fogHeightCameraOverriden = true;
         var1.fogHeightCameraFixed = this.fogHeightCameraFixed;
      }

      var1.fogHeightCameraOffset = this.fogHeightCameraOffset;
      class="kw">return var1;
   }

   @Override
   class="kw">public String toString() {
      class="kw">return "FogOptions{ignoreFogLimits="
         + this.ignoreFogLimits
         + ", effectiveViewDistanceMultiplier="
         + this.effectiveViewDistanceMultiplier
         + ", fogHeightCameraFixed="
         + this.fogHeightCameraFixed
         + ", fogHeightCameraOffset="
         + this.fogHeightCameraOffset
         + "}";
   }
}