Don't do the unbelievable bad use of a MutableBlockVector2 in the creation of a set (#1825)

* Don't do the unbelievable bad use of a MutableBlockVector2 in the creation of a set
 - Fixes IntellectualSites/PlotSquared#3683

* Clean up remnants of the use of MutableBlockVector2
This commit is contained in:
Jordan
2022-06-17 22:41:25 +01:00
committed by GitHub
parent d2b4154cc0
commit 907ad8528e
3 changed files with 9 additions and 11 deletions

View File

@@ -93,7 +93,6 @@ public final class MemBlockSet extends BlockSet {
@Override
public Iterator<BlockVector2> iterator() {
return new Iterator<>() {
private final MutableBlockVector2 mutable = new MutableBlockVector2();
private boolean hasNext;
private int X;
private int Z;
@@ -131,9 +130,10 @@ public final class MemBlockSet extends BlockSet {
@Override
public BlockVector2 next() {
mutable.setComponents(setX + getBlockOffsetX(), setZ + getBlockOffsetZ());
// Maintain correct order of method call/variable use
BlockVector2 result = BlockVector2.at(setX + getBlockOffsetX(), setZ + getBlockOffsetZ());
init();
return mutable;
return result;
}
@Override