java.lang.Object
com.hypixel.hytale.builtin.hytalegenerator.datastructures.voxelspace.ArrayVoxelSpace<T>
All Implemented Interfaces:
VoxelSpace<T>

public class ArrayVoxelSpace<T> extends Object implements VoxelSpace<T>
  • Field Details

    • sizeX

      protected final int sizeX
    • sizeY

      protected final int sizeY
    • sizeZ

      protected final int sizeZ
    • contents

      @Nonnull protected final T[] contents
    • name

      @Nonnull protected String name
    • fastReset

      @Nullable protected T[] fastReset
    • origin

      protected VoxelCoordinate origin
  • Constructor Details

    • ArrayVoxelSpace

      public ArrayVoxelSpace(@Nonnull Bounds3i bounds)
    • ArrayVoxelSpace

      public ArrayVoxelSpace(@Nonnull String name, int sizeX, int sizeY, int sizeZ, int originX, int originY, int originZ)
    • ArrayVoxelSpace

      public ArrayVoxelSpace(int sizeX, int sizeY, int sizeZ)
    • ArrayVoxelSpace

      public ArrayVoxelSpace(@Nonnull VoxelSpace<T> voxelSpace)
  • Method Details

    • setFastResetTo

      public void setFastResetTo(T e)
    • disableFastReset

      public void disableFastReset()
    • hasFastReset

      public boolean hasFastReset()
    • fastReset

      public void fastReset()
    • sizeX

      public int sizeX()
      Specified by:
      sizeX in interface VoxelSpace<T>
    • sizeY

      public int sizeY()
      Specified by:
      sizeY in interface VoxelSpace<T>
    • sizeZ

      public int sizeZ()
      Specified by:
      sizeZ in interface VoxelSpace<T>
    • pasteFrom

      public void pasteFrom(@Nonnull VoxelSpace<T> source)
      Specified by:
      pasteFrom in interface VoxelSpace<T>
    • set

      public boolean set(T content, int x, int y, int z)
      Specified by:
      set in interface VoxelSpace<T>
    • set

      public boolean set(T content, @Nonnull Vector3i position)
      Specified by:
      set in interface VoxelSpace<T>
    • set

      public void set(T content)
      Specified by:
      set in interface VoxelSpace<T>
    • setOrigin

      public void setOrigin(int x, int y, int z)
      Specified by:
      setOrigin in interface VoxelSpace<T>
    • getContent

      public T getContent(int x, int y, int z)
      Specified by:
      getContent in interface VoxelSpace<T>
    • getContent

      @Nullable public T getContent(@Nonnull Vector3i position)
      Specified by:
      getContent in interface VoxelSpace<T>
    • replace

      public boolean replace(T replacement, int x, int y, int z, @Nonnull Predicate<T> mask)
      Specified by:
      replace in interface VoxelSpace<T>
    • toArray

      public T[] toArray()
    • getOrigin

      @Nonnull VoxelCoordinate getOrigin()
    • getOriginX

      public int getOriginX()
      Specified by:
      getOriginX in interface VoxelSpace<T>
    • getOriginY

      public int getOriginY()
      Specified by:
      getOriginY in interface VoxelSpace<T>
    • getOriginZ

      public int getOriginZ()
      Specified by:
      getOriginZ in interface VoxelSpace<T>
    • getName

      @Nonnull public String getName()
      Specified by:
      getName in interface VoxelSpace<T>
    • isInsideSpace

      public boolean isInsideSpace(int x, int y, int z)
      Specified by:
      isInsideSpace in interface VoxelSpace<T>
    • isInsideSpace

      public boolean isInsideSpace(@Nonnull Vector3i position)
      Specified by:
      isInsideSpace in interface VoxelSpace<T>
    • forEach

      public void forEach(@Nonnull VoxelConsumer<? super T> action)
      Specified by:
      forEach in interface VoxelSpace<T>
    • minX

      public int minX()
      Specified by:
      minX in interface VoxelSpace<T>
    • maxX

      public int maxX()
      Specified by:
      maxX in interface VoxelSpace<T>
    • minY

      public int minY()
      Specified by:
      minY in interface VoxelSpace<T>
    • maxY

      public int maxY()
      Specified by:
      maxY in interface VoxelSpace<T>
    • minZ

      public int minZ()
      Specified by:
      minZ in interface VoxelSpace<T>
    • maxZ

      public int maxZ()
      Specified by:
      maxZ in interface VoxelSpace<T>
    • clone

      @Nonnull public ArrayVoxelSpace<T> clone()
      Overrides:
      clone in class Object
    • arrayIndex

      private int arrayIndex(int x, int y, int z)
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object