CaveNodeCoverType enum

Пакет: com.hypixel.hytale.server.worldgen.cave

Файл: com/hypixel/hytale/server/worldgen/cave/CaveNodeType.java

Поля (1)

МодификаторыТипИмя
public final int parentOffset

Методы (1)

МодификаторыВозвратСигнатура
abstract CEILING CEILING(1)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.cave;

class="kw">import com.hypixel.hytale.common.map.IWeightedMap;
class="kw">import com.hypixel.hytale.procedurallib.condition.IBlockFluidCondition;
class="kw">import com.hypixel.hytale.procedurallib.condition.ICoordinateCondition;
class="kw">import com.hypixel.hytale.procedurallib.condition.ICoordinateRndCondition;
class="kw">import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
class="kw">import com.hypixel.hytale.server.core.prefab.PrefabRotation;
class="kw">import com.hypixel.hytale.server.worldgen.cave.element.CaveNode;
class="kw">import com.hypixel.hytale.server.worldgen.cave.prefab.CavePrefabContainer;
class="kw">import com.hypixel.hytale.server.worldgen.cave.shape.CaveNodeShape;
class="kw">import com.hypixel.hytale.server.worldgen.cave.shape.CaveNodeShapeEnum;
class="kw">import com.hypixel.hytale.server.worldgen.util.BlockFluidEntry;
class="kw">import com.hypixel.hytale.server.worldgen.util.ListPool;
class="kw">import java.util.Random;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3d;

class="kw">public class CaveNodeType {
   class="kw">public class="kw">static class="kw">final CaveNodeType[] EMPTY_ARRAY = new CaveNodeType[0];
   class="kw">public class="kw">static class="kw">final ListPool<CaveNodeType.CaveNodeCoverEntry> COVER_POOL = new ListPool<>(10, CaveNodeType.CaveNodeCoverEntry.EMPTY_ARRAY);
   class="kw">public class="kw">static class="kw">final ListPool<CaveNodeType.CaveNodeChildEntry> CHILD_POOL = new ListPool<>(10, CaveNodeType.CaveNodeChildEntry.EMPTY_ARRAY);
   @Nonnull
   class="kw">private class="kw">final String name;
   @Nullable
   class="kw">private class="kw">final CavePrefabContainer prefabContainer;
   @Nonnull
   class="kw">private class="kw">final IWeightedMap<BlockFluidEntry> fillings;
   @Nonnull
   class="kw">private class="kw">final CaveNodeShapeEnum.CaveNodeShapeGenerator shapeGenerator;
   @Nonnull
   class="kw">private class="kw">final ICoordinateCondition heightCondition;
   @Nullable
   class="kw">private class="kw">final IDoubleRange childrenCountBounds;
   @Nonnull
   class="kw">private class="kw">final CaveNodeType.CaveNodeCoverEntry[] covers;
   class="kw">private class="kw">final int priority;
   class="kw">private class="kw">final int environment;
   class="kw">private CaveNodeType.CaveNodeChildEntry[] children;

   class="kw">public CaveNodeType(
      @Nonnull String var1,
      @Nullable CavePrefabContainer var2,
      @Nonnull IWeightedMap<BlockFluidEntry> var3,
      @Nonnull CaveNodeShapeEnum.CaveNodeShapeGenerator var4,
      @Nonnull ICoordinateCondition var5,
      @Nullable IDoubleRange var6,
      @Nonnull CaveNodeType.CaveNodeCoverEntry[] var7,
      int var8,
      int var9
   ) {
      this.name = var1;
      this.prefabContainer = var2;
      this.fillings = var3;
      this.shapeGenerator = var4;
      this.heightCondition = var5;
      this.childrenCountBounds = var6;
      this.covers = var7;
      this.priority = var8;
      this.environment = var9;
   }

   @Nonnull
   class="kw">public String getName() {
      class="kw">return this.name;
   }

   @Nullable
   class="kw">public CavePrefabContainer getPrefabContainer() {
      class="kw">return this.prefabContainer;
   }

   class="kw">public void setChildren(@Nonnull CaveNodeType.CaveNodeChildEntry[] var1) {
      this.children = var1;
   }

   @Nonnull
   class="kw">public ICoordinateCondition getHeightCondition() {
      class="kw">return this.heightCondition;
   }

   @Nullable
   class="kw">public IDoubleRange getChildrenCountBounds() {
      class="kw">return this.childrenCountBounds;
   }

   @Nullable
   class="kw">public BlockFluidEntry getFilling(@Nonnull Random var1) {
      class="kw">return this.fillings.get(var1);
   }

   @Nonnull
   class="kw">public CaveNodeShape generateCaveNodeShape(
      Random var1, CaveType var2, CaveNode var3, CaveNodeType.CaveNodeChildEntry var4, Vector3d var5, float var6, float var7
   ) {
      class="kw">return this.shapeGenerator.generateCaveNodeShape(var1, var2, var3, var4, var5, var6, var7);
   }

   @Nonnull
   class="kw">public CaveNodeType.CaveNodeCoverEntry[] getCovers() {
      class="kw">return this.covers;
   }

   @Nonnull
   class="kw">public CaveNodeType.CaveNodeChildEntry[] getChildren() {
      class="kw">return this.children;
   }

   class="kw">public int getPriority() {
      class="kw">return this.priority;
   }

   class="kw">public boolean hasEnvironment() {
      class="kw">return this.environment != Integer.MIN_VALUE;
   }

   class="kw">public int getEnvironment() {
      class="kw">return this.environment;
   }

   class="kw">public class="kw">static class CaveNodeChildEntry {
      class="kw">public class="kw">static class="kw">final CaveNodeType.CaveNodeChildEntry[] EMPTY_ARRAY = new CaveNodeType.CaveNodeChildEntry[0];
      @Nonnull
      class="kw">private class="kw">final IWeightedMap<CaveNodeType> types;
      @Nonnull
      class="kw">private class="kw">final Vector3d anchor;
      @Nonnull
      class="kw">private class="kw">final Vector3d offset;
      @Nonnull
      class="kw">private class="kw">final PrefabRotation[] rotation;
      @Nullable
      class="kw">private class="kw">final IDoubleRange childrenLimit;
      @Nonnull
      class="kw">private class="kw">final IDoubleRange repeat;
      @Nonnull
      class="kw">private class="kw">final CaveNodeType.CaveNodeChildEntry.OrientationModifier pitchModifier;
      @Nonnull
      class="kw">private class="kw">final CaveNodeType.CaveNodeChildEntry.OrientationModifier yawModifier;
      class="kw">private class="kw">final double chance;
      @Nonnull
      class="kw">private class="kw">final CaveYawMode yawMode;

      class="kw">public CaveNodeChildEntry(
         @Nonnull IWeightedMap<CaveNodeType> var1,
         @Nonnull Vector3d var2,
         @Nonnull Vector3d var3,
         @Nonnull PrefabRotation[] var4,
         @Nullable IDoubleRange var5,
         @Nonnull IDoubleRange var6,
         @Nonnull CaveNodeType.CaveNodeChildEntry.OrientationModifier var7,
         @Nonnull CaveNodeType.CaveNodeChildEntry.OrientationModifier var8,
         double var9,
         @Nonnull CaveYawMode var11
      ) {
         this.types = var1;
         this.anchor = var2;
         this.offset = var3;
         this.rotation = var4;
         this.childrenLimit = var5;
         this.repeat = var6;
         this.pitchModifier = var7;
         this.yawModifier = var8;
         this.chance = var9;
         this.yawMode = var11;
      }

      @Nonnull
      class="kw">public IWeightedMap<CaveNodeType> getTypes() {
         class="kw">return this.types;
      }

      @Nonnull
      class="kw">public Vector3d getAnchor() {
         class="kw">return this.anchor;
      }

      @Nonnull
      class="kw">public Vector3d getOffset() {
         class="kw">return this.offset;
      }

      @Nonnull
      class="kw">public PrefabRotation getRotation(@Nonnull Random var1) {
         class="kw">return this.rotation.length == 1 ? this.rotation[0] : this.rotation[var1.nextInt(this.rotation.length)];
      }

      @Nullable
      class="kw">public IDoubleRange getChildrenLimit() {
         class="kw">return this.childrenLimit;
      }

      @Nonnull
      class="kw">public IDoubleRange getRepeat() {
         class="kw">return this.repeat;
      }

      @Nonnull
      class="kw">public CaveNodeType.CaveNodeChildEntry.OrientationModifier getPitchModifier() {
         class="kw">return this.pitchModifier;
      }

      @Nonnull
      class="kw">public CaveNodeType.CaveNodeChildEntry.OrientationModifier getYawModifier() {
         class="kw">return this.yawModifier;
      }

      class="kw">public double getChance() {
         class="kw">return this.chance;
      }

      @Nonnull
      class="kw">public CaveYawMode getYawMode() {
         class="kw">return this.yawMode;
      }

      @FunctionalInterface
      class="kw">public class="kw">interface OrientationModifier {
         float calc(float var1, Random var2);
      }
   }

   class="kw">public class="kw">static class CaveNodeCoverEntry {
      class="kw">public class="kw">static class="kw">final CaveNodeType.CaveNodeCoverEntry[] EMPTY_ARRAY = new CaveNodeType.CaveNodeCoverEntry[0];
      @Nonnull
      class="kw">protected class="kw">final IWeightedMap<CaveNodeType.CaveNodeCoverEntry.Entry> entries;
      @Nonnull
      class="kw">protected class="kw">final ICoordinateRndCondition heightCondition;
      @Nonnull
      class="kw">protected class="kw">final ICoordinateCondition mapCondition;
      @Nonnull
      class="kw">protected class="kw">final ICoordinateCondition densityCondition;
      @Nonnull
      class="kw">protected class="kw">final IBlockFluidCondition parentCondition;
      @Nonnull
      class="kw">protected class="kw">final CaveNodeType.CaveNodeCoverType type;

      class="kw">public CaveNodeCoverEntry(
         @Nonnull IWeightedMap<CaveNodeType.CaveNodeCoverEntry.Entry> var1,
         @Nonnull ICoordinateRndCondition var2,
         @Nonnull ICoordinateCondition var3,
         @Nonnull ICoordinateCondition var4,
         @Nonnull IBlockFluidCondition var5,
         @Nonnull CaveNodeType.CaveNodeCoverType var6
      ) {
         this.entries = var1;
         this.heightCondition = var2;
         this.mapCondition = var3;
         this.densityCondition = var4;
         this.type = var6;
         this.parentCondition = var5;
      }

      @Nullable
      class="kw">public CaveNodeType.CaveNodeCoverEntry.Entry get(Random var1) {
         class="kw">return this.entries.get(var1);
      }

      @Nonnull
      class="kw">public ICoordinateRndCondition getHeightCondition() {
         class="kw">return this.heightCondition;
      }

      @Nonnull
      class="kw">public ICoordinateCondition getMapCondition() {
         class="kw">return this.mapCondition;
      }

      @Nonnull
      class="kw">public ICoordinateCondition getDensityCondition() {
         class="kw">return this.densityCondition;
      }

      @Nonnull
      class="kw">public IBlockFluidCondition getParentCondition() {
         class="kw">return this.parentCondition;
      }

      @Nonnull
      class="kw">public CaveNodeType.CaveNodeCoverType getType() {
         class="kw">return this.type;
      }

      class="kw">public class="kw">static class Entry {
         class="kw">public class="kw">static class="kw">final CaveNodeType.CaveNodeCoverEntry.Entry[] EMPTY_ARRAY = new CaveNodeType.CaveNodeCoverEntry.Entry[0];
         class="kw">protected class="kw">final BlockFluidEntry entry;
         class="kw">protected class="kw">final int offset;

         class="kw">public Entry(BlockFluidEntry var1, int var2) {
            this.entry = var1;
            this.offset = var2;
         }

         class="kw">public int getOffset() {
            class="kw">return this.offset;
         }

         class="kw">public BlockFluidEntry getEntry() {
            class="kw">return this.entry;
         }

         @Nonnull
         @Override
         class="kw">public String toString() {
            class="kw">return "Entry{entry=" + this.entry + ", offset=" + this.offset + "}";
         }
      }
   }

   class="kw">public enum CaveNodeCoverType {
      FLOOR(-1),
      CEILING(1);

      class="kw">public class="kw">final int parentOffset;

      CaveNodeCoverType(int nullxx) {
         this.parentOffset = nullxx;
      }
   }
}