mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 14:58:35 +00:00
Move vectors to static creators, for caching
This commit is contained in:
@ -135,7 +135,7 @@ public class ExtentEntityCopy implements EntityFunction {
|
||||
boolean hasFacing = tag.containsKey("Facing");
|
||||
|
||||
if (hasTilePosition) {
|
||||
Vector3 tilePosition = new Vector3(tag.asInt("TileX"), tag.asInt("TileY"), tag.asInt("TileZ"));
|
||||
Vector3 tilePosition = Vector3.at(tag.asInt("TileX"), tag.asInt("TileY"), tag.asInt("TileZ"));
|
||||
BlockVector3 newTilePosition = transform.apply(tilePosition.subtract(from)).add(to).toBlockPoint();
|
||||
|
||||
CompoundTagBuilder builder = tag.createBuilder()
|
||||
|
@ -37,7 +37,6 @@ import com.sk89q.worldedit.function.mask.Masks;
|
||||
import com.sk89q.worldedit.function.visitor.EntityVisitor;
|
||||
import com.sk89q.worldedit.function.visitor.RegionVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.Identity;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
@ -89,7 +89,7 @@ public class RepeatingExtentPattern extends AbstractPattern {
|
||||
int x = base.getBlockX() % size.getBlockX();
|
||||
int y = base.getBlockY() % size.getBlockY();
|
||||
int z = base.getBlockZ() % size.getBlockZ();
|
||||
return extent.getFullBlock(new BlockVector3(x, y, z));
|
||||
return extent.getFullBlock(BlockVector3.at(x, y, z));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public abstract class BreadthFirstSearch implements Operation {
|
||||
* <p>Directions are {@link BlockVector3}s that determine
|
||||
* what adjacent points area available. Vectors should not be
|
||||
* unit vectors. An example of a valid direction is
|
||||
* {@code new BlockVector3(1, 0, 1)}.</p>
|
||||
* {@code BlockVector3.at(1, 0, 1)}.</p>
|
||||
*
|
||||
* <p>The list of directions can be cleared.</p>
|
||||
*
|
||||
@ -85,22 +85,22 @@ public abstract class BreadthFirstSearch implements Operation {
|
||||
* Add the directions along the axes as directions to visit.
|
||||
*/
|
||||
protected void addAxes() {
|
||||
directions.add(new BlockVector3(0, -1, 0));
|
||||
directions.add(new BlockVector3(0, 1, 0));
|
||||
directions.add(new BlockVector3(-1, 0, 0));
|
||||
directions.add(new BlockVector3(1, 0, 0));
|
||||
directions.add(new BlockVector3(0, 0, -1));
|
||||
directions.add(new BlockVector3(0, 0, 1));
|
||||
directions.add(BlockVector3.at(0, -1, 0));
|
||||
directions.add(BlockVector3.at(0, 1, 0));
|
||||
directions.add(BlockVector3.at(-1, 0, 0));
|
||||
directions.add(BlockVector3.at(1, 0, 0));
|
||||
directions.add(BlockVector3.at(0, 0, -1));
|
||||
directions.add(BlockVector3.at(0, 0, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the diagonal directions as directions to visit.
|
||||
*/
|
||||
protected void addDiagonal() {
|
||||
directions.add(new BlockVector3(1, 0, 1));
|
||||
directions.add(new BlockVector3(-1, 0, -1));
|
||||
directions.add(new BlockVector3(1, 0, -1));
|
||||
directions.add(new BlockVector3(-1, 0, 1));
|
||||
directions.add(BlockVector3.at(1, 0, 1));
|
||||
directions.add(BlockVector3.at(-1, 0, -1));
|
||||
directions.add(BlockVector3.at(1, 0, -1));
|
||||
directions.add(BlockVector3.at(-1, 0, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,11 +53,11 @@ public class DownwardVisitor extends RecursiveVisitor {
|
||||
|
||||
Collection<BlockVector3> directions = getDirections();
|
||||
directions.clear();
|
||||
directions.add(new BlockVector3(1, 0, 0));
|
||||
directions.add(new BlockVector3(-1, 0, 0));
|
||||
directions.add(new BlockVector3(0, 0, 1));
|
||||
directions.add(new BlockVector3(0, 0, -1));
|
||||
directions.add(new BlockVector3(0, -1, 0));
|
||||
directions.add(BlockVector3.at(1, 0, 0));
|
||||
directions.add(BlockVector3.at(-1, 0, 0));
|
||||
directions.add(BlockVector3.at(0, 0, 1));
|
||||
directions.add(BlockVector3.at(0, 0, -1));
|
||||
directions.add(BlockVector3.at(0, -1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,11 +40,11 @@ public class NonRisingVisitor extends RecursiveVisitor {
|
||||
super(mask, function);
|
||||
Collection<BlockVector3> directions = getDirections();
|
||||
directions.clear();
|
||||
directions.add(new BlockVector3(1, 0, 0));
|
||||
directions.add(new BlockVector3(-1, 0, 0));
|
||||
directions.add(new BlockVector3(0, 0, 1));
|
||||
directions.add(new BlockVector3(0, 0, -1));
|
||||
directions.add(new BlockVector3(0, -1, 0));
|
||||
directions.add(BlockVector3.at(1, 0, 0));
|
||||
directions.add(BlockVector3.at(-1, 0, 0));
|
||||
directions.add(BlockVector3.at(0, 0, 1));
|
||||
directions.add(BlockVector3.at(0, 0, -1));
|
||||
directions.add(BlockVector3.at(0, -1, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user