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