remove Fast2DIterator

This commit is contained in:
MattBDev 2019-07-30 15:27:59 -04:00
parent 0d2b0025ce
commit cb03ed2fe8
3 changed files with 9 additions and 10 deletions

View File

@ -22,7 +22,6 @@ package com.sk89q.worldedit.command;
import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.visitor.Fast2DIterator;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit;
@ -141,14 +140,14 @@ public class BiomeCommands {
Region region = session.getSelection(world);
if (region instanceof FlatRegion) {
for (BlockVector2 pt : new Fast2DIterator(((FlatRegion) region).asFlatRegion(), editSession)) {
for (BlockVector2 pt : ((FlatRegion) region).asFlatRegion()) {
biomes.add(world.getBiome(pt));
}
} else {
RegionVisitor visitor = new RegionVisitor(region, position -> {
biomes.add(world.getBiome(position.toBlockVector2()));
return true;
}, editSession);
});
Operations.completeBlindly(visitor);
}

View File

@ -20,6 +20,7 @@
package com.sk89q.worldedit.function.visitor;
import com.boydti.fawe.config.BBC;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.function.RegionFunction;
import com.sk89q.worldedit.function.operation.Operation;
@ -58,6 +59,9 @@ public class RegionVisitor implements Operation {
this.iterable = iterable;
}
public RegionVisitor(Region region, RegionFunction regionFunction, EditSession editSession) {
}
/**
* Get the number of affected objects.
*

View File

@ -19,8 +19,6 @@
package com.sk89q.worldedit.math.convolution;
import com.boydti.fawe.object.visitor.Fast2DIterator;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.EditSession;
@ -34,7 +32,6 @@ import com.sk89q.worldedit.registry.state.PropertyGroup;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.Iterator;
import javax.annotation.Nullable;
@ -93,11 +90,10 @@ public class HeightMap {
BlockVector3 min = region.getMinimumPoint();
int bx = min.getBlockX();
int bz = min.getBlockZ();
Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion();
Iterator<BlockVector2> iter = new Fast2DIterator(flat, session).iterator();
Iterator<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion().iterator();
int layer = 0;
while (iter.hasNext()) {
BlockVector2 pos = iter.next();
while (flat.hasNext()) {
BlockVector2 pos = flat.next();
int x = pos.getBlockX();
int z = pos.getBlockZ();
layer = session.getNearestSurfaceLayer(x, z, (layer + 7) >> 3, 0, maxY);