Class AbstractBlueprintIterator
java.lang.Object
com.ldtteam.structurize.placement.AbstractBlueprintIterator
- All Implemented Interfaces:
IBlueprintIterator
- Direct Known Subclasses:
AbstractBlueprintIteratorWrapper,BlueprintIteratorDefault,BlueprintIteratorHilbert,BlueprintIteratorInwardCircle,BlueprintIteratorInwardCircleHeight,BlueprintIteratorRandom
This is the blueprint iterator.
It's a helper class used to track the progress of one iteration over the structure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe different results when advancing the structure. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.core.BlockPosThe position we use as our uninitialized value.protected final net.minecraft.core.BlockPos.MutableBlockPosThe previous position before the current progress position.protected final net.minecraft.core.BlockPos.MutableBlockPosThe Structure position we are at.protected final net.minecraft.core.BlockPosThe size of the structure. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBlueprintIterator(IStructureHandler structureHandler) Initialize the blueprint iterator with the structure handler.AbstractBlueprintIterator(IStructureHandler structureHandler, net.minecraft.core.BlockPos size) Initialize the blueprint iterator with the structure handler. -
Method Summary
Modifier and TypeMethodDescriptiondecrement(net.minecraftforge.common.util.TriPredicate<BlueprintPositionInfo, net.minecraft.core.BlockPos, IStructureHandler> skipCondition) Decrement the structure with a certain skipCondition (jump over blocks that fulfill skipCondition).getBluePrintPositionInfo(net.minecraft.core.BlockPos localPos) Get the blueprint info from the position.net.minecraft.core.BlockPosGet the last position before the progress pos of the iterator.net.minecraft.core.BlockPosGet the progress pos of the iterator.net.minecraft.core.BlockPosgetSize()Get the size of the blueprint which is iterated overprotected IStructureHandlerbooleanRetrieve whether the iterator is taking entities into account as wellvoidSet the iterator to include entities.increment(net.minecraftforge.common.util.TriPredicate<BlueprintPositionInfo, net.minecraft.core.BlockPos, IStructureHandler> skipCondition) Increment the structure with a certain skipCondition (jump over blocks that fulfill skipCondition).booleanRetrieve whether we're removing blocks at the momentvoidreset()Reset the progressPos.voidsetProgressPos(net.minecraft.core.BlockPos localPosition) Change the current progressPos.voidSet the iterator to removal mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ldtteam.structurize.placement.IBlueprintIterator
decrement, increment
-
Field Details
-
NULL_POS
public static final net.minecraft.core.BlockPos NULL_POSThe position we use as our uninitialized value. -
progressPos
protected final net.minecraft.core.BlockPos.MutableBlockPos progressPosThe Structure position we are at. Defaulted to NULL_POS. -
prevProgressPos
protected final net.minecraft.core.BlockPos.MutableBlockPos prevProgressPosThe previous position before the current progress position. -
size
protected final net.minecraft.core.BlockPos sizeThe size of the structure.
-
-
Constructor Details
-
AbstractBlueprintIterator
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.minecraftforge.common.util.TriPredicate<BlueprintPositionInfo, net.minecraft.core.BlockPos, IStructureHandler> skipCondition) Description copied from interface:IBlueprintIteratorIncrement the structure with a certain skipCondition (jump over blocks that fulfill skipCondition).- Specified by:
incrementin interfaceIBlueprintIterator- Parameters:
skipCondition- the skipCondition.- Returns:
- Result of increment.
-
decrement
public AbstractBlueprintIterator.Result decrement(net.minecraftforge.common.util.TriPredicate<BlueprintPositionInfo, net.minecraft.core.BlockPos, IStructureHandler> skipCondition) Description copied from interface:IBlueprintIteratorDecrement the structure with a certain skipCondition (jump over blocks that fulfill skipCondition).- Specified by:
decrementin interfaceIBlueprintIterator- Parameters:
skipCondition- the skipCondition.- Returns:
- Result of decrement.
-
setProgressPos
public void setProgressPos(net.minecraft.core.BlockPos localPosition) Description copied from interface:IBlueprintIteratorChange the current progressPos. Used when loading progress.- Specified by:
setProgressPosin interfaceIBlueprintIterator- Parameters:
localPosition- new progressPos.
-
getBluePrintPositionInfo
Description copied from interface:IBlueprintIteratorGet the blueprint info from the position.- Specified by:
getBluePrintPositionInfoin interfaceIBlueprintIterator- Parameters:
localPos- the position.- Returns:
- the info object.
-
includeEntities
public void includeEntities()Description copied from interface:IBlueprintIteratorSet the iterator to include entities.- Specified by:
includeEntitiesin interfaceIBlueprintIterator
-
hasEntities
public boolean hasEntities()Description copied from interface:IBlueprintIteratorRetrieve whether the iterator is taking entities into account as well- Specified by:
hasEntitiesin interfaceIBlueprintIterator- Returns:
- whether the iterator is taking entities into account as well
-
setRemoving
public void setRemoving()Description copied from interface:IBlueprintIteratorSet the iterator to removal mode.- Specified by:
setRemovingin interfaceIBlueprintIterator
-
isRemoving
public boolean isRemoving()Description copied from interface:IBlueprintIteratorRetrieve whether we're removing blocks at the moment- Specified by:
isRemovingin interfaceIBlueprintIterator- Returns:
- Whether we are removing blocks at the moment
-
reset
public void reset()Description copied from interface:IBlueprintIteratorReset the progressPos.- Specified by:
resetin interfaceIBlueprintIterator
-
getSize
public net.minecraft.core.BlockPos getSize()Description copied from interface:IBlueprintIteratorGet the size of the blueprint which is iterated over- Specified by:
getSizein interfaceIBlueprintIterator- Returns:
- the size
-
getProgressPos
public net.minecraft.core.BlockPos getProgressPos()Description copied from interface:IBlueprintIteratorGet the progress pos of the iterator.- Specified by:
getProgressPosin interfaceIBlueprintIterator- Returns:
- the progress pos.
-
getPrevProgressPos
public net.minecraft.core.BlockPos getPrevProgressPos()Description copied from interface:IBlueprintIteratorGet the last position before the progress pos of the iterator.- Specified by:
getPrevProgressPosin interfaceIBlueprintIterator- Returns:
- the prev progress pos.
-
getStructureHandler
-