Class AbstractBlueprintIterator
java.lang.Object
com.ldtteam.structurize.placement.AbstractBlueprintIterator
- Direct Known Subclasses:
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 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 TypeMethodDescriptionabstract AbstractBlueprintIterator.ResultDecrement method, create in implementation.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).getBluePrintPositionInfo(net.minecraft.core.BlockPos localPos) Get the blueprint info from the position.net.minecraft.core.BlockPosGet the progress pos of the iterator.voidSet the iterator to include entities.abstract AbstractBlueprintIterator.ResultIncrement method, create in implementation.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).voidreset()Reset the progressPos.voidsetProgressPos(net.minecraft.core.BlockPos localPosition) Change the current progressPos.voidSet the iterator to removal mode.
-
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. -
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.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
Increment method, create in implementation.- Returns:
- increment the structure position (y++).
-
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
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.
-