15
15
*/
16
16
public abstract class AbstractBlueprintIterator implements IBlueprintIterator
17
17
{
18
-
19
18
/**
20
19
* The position we use as our uninitialized value.
21
20
*/
22
21
public static final BlockPos NULL_POS = new BlockPos (-1 , -1 , -1 );
22
+
23
23
/**
24
24
* The Structure position we are at. Defaulted to NULL_POS.
25
25
*/
26
26
protected final BlockPos .MutableBlockPos progressPos = new BlockPos .MutableBlockPos (-1 , -1 , -1 );
27
27
28
+ /**
29
+ * The previous position before the current progress position.
30
+ */
31
+ protected final BlockPos .MutableBlockPos prevProgressPos = new BlockPos .MutableBlockPos (-1 , -1 , -1 );
32
+
28
33
/**
29
34
* The size of the structure.
30
35
*/
@@ -118,6 +123,7 @@ else if (!isRemoving() && BlockUtils.areBlockStatesEqual(info.getBlockInfo().get
118
123
@ Override
119
124
public void setProgressPos (final BlockPos localPosition )
120
125
{
126
+ this .prevProgressPos .set (this .progressPos );
121
127
if (localPosition .equals (NULL_POS ))
122
128
{
123
129
this .progressPos .set (localPosition );
@@ -163,6 +169,7 @@ public boolean isRemoving()
163
169
@ Override
164
170
public void reset ()
165
171
{
172
+ prevProgressPos .set (NULL_POS );
166
173
progressPos .set (NULL_POS );
167
174
includeEntities = false ;
168
175
isRemoving = false ;
@@ -180,6 +187,12 @@ public BlockPos getProgressPos()
180
187
return progressPos .immutable ();
181
188
}
182
189
190
+ @ Override
191
+ public BlockPos getPrevProgressPos ()
192
+ {
193
+ return prevProgressPos .immutable ();
194
+ }
195
+
183
196
protected IStructureHandler getStructureHandler ()
184
197
{
185
198
return structureHandler ;
0 commit comments