Class AbstractBlueprintIterator

java.lang.Object
com.ldtteam.structurize.placement.AbstractBlueprintIterator
Direct Known Subclasses:
BlueprintIteratorDefault, BlueprintIteratorHilbert, BlueprintIteratorInwardCircle, BlueprintIteratorInwardCircleHeight, BlueprintIteratorRandom

public abstract class AbstractBlueprintIterator extends Object
This is the blueprint iterator. It's a helper class used to track the progress of one iteration over the structure.
  • Field Details

    • NULL_POS

      public static final net.minecraft.core.BlockPos NULL_POS
      The position we use as our uninitialized value.
    • progressPos

      protected final net.minecraft.core.BlockPos.MutableBlockPos progressPos
      The Structure position we are at. Defaulted to NULL_POS.
    • size

      protected final net.minecraft.core.BlockPos size
      The size of the structure.
  • Constructor Details

    • AbstractBlueprintIterator

      public AbstractBlueprintIterator(IStructureHandler structureHandler)
      Initialize the blueprint iterator with the structure handler.
      Parameters:
      structureHandler - the structure handler.
    • AbstractBlueprintIterator

      public AbstractBlueprintIterator(IStructureHandler structureHandler, net.minecraft.core.BlockPos size)
      Initialize the blueprint iterator with the structure handler.
      Parameters:
      size - the size.
      structureHandler - the structure handler.
  • Method Details

    • increment

      public AbstractBlueprintIterator.Result increment(net.neoforged.neoforge.common.util.TriPredicate<BlueprintPositionInfo,net.minecraft.core.BlockPos,IStructureHandler> skipCondition)
      Increment the structure with a certain skipCondition (jump over blocks that fulfill skipCondition).
      Parameters:
      skipCondition - the skipCondition.
      Returns:
      Result of increment.
    • increment

      public abstract AbstractBlueprintIterator.Result increment()
      Increment method, create in implementation.
      Returns:
      increment the structure position (y++).
    • decrement

      public abstract AbstractBlueprintIterator.Result decrement()
      Decrement method, create in implementation.
      Returns:
      decrement the structure position (y--).
    • decrement

      public AbstractBlueprintIterator.Result decrement(net.neoforged.neoforge.common.util.TriPredicate<BlueprintPositionInfo,net.minecraft.core.BlockPos,IStructureHandler> skipCondition)
      Decrement the structure with a certain skipCondition (jump over blocks that fulfill skipCondition).
      Parameters:
      skipCondition - the skipCondition.
      Returns:
      Result of decrement.
    • setProgressPos

      public void setProgressPos(net.minecraft.core.BlockPos localPosition)
      Change the current progressPos. Used when loading progress.
      Parameters:
      localPosition - new progressPos.
    • getBluePrintPositionInfo

      public BlueprintPositionInfo getBluePrintPositionInfo(net.minecraft.core.BlockPos localPos)
      Get the blueprint info from the position.
      Parameters:
      localPos - the position.
      Returns:
      the info object.
    • includeEntities

      public void includeEntities()
      Set the iterator to include entities.
    • setRemoving

      public void setRemoving()
      Set the iterator to removal mode.
    • reset

      public void reset()
      Reset the progressPos.
    • getProgressPos

      public net.minecraft.core.BlockPos getProgressPos()
      Get the progress pos of the iterator.
      Returns:
      the progress pos.