mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 10:28:35 +00:00
Refactor vector system to be cleaner
- Move Vector, etc. into `.math` package - Drop many methods that will be auto-promoted anyways, eg. with `divide(int)` and `divide(double)` the first is now gone. - Take Block vectors into their own class hierarchy - Make it clear throughout the API what takes blockvectors - many more improvements
This commit is contained in:
@ -21,13 +21,13 @@ package com.sk89q.worldedit.session;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
|
||||
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
|
||||
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
|
||||
/**
|
||||
@ -39,7 +39,7 @@ public class PasteBuilder {
|
||||
private final Transform transform;
|
||||
private final Extent targetExtent;
|
||||
|
||||
private Vector to = new Vector();
|
||||
private BlockVector3 to = BlockVector3.ZERO;
|
||||
private boolean ignoreAirBlocks;
|
||||
|
||||
/**
|
||||
@ -62,7 +62,7 @@ public class PasteBuilder {
|
||||
* @param to the target location
|
||||
* @return this builder instance
|
||||
*/
|
||||
public PasteBuilder to(Vector to) {
|
||||
public PasteBuilder to(BlockVector3 to) {
|
||||
this.to = to;
|
||||
return this;
|
||||
}
|
||||
|
@ -19,12 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.session.request;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.regions.NullRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
@ -64,17 +63,17 @@ public class RequestSelection implements Region {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMinimumPoint() {
|
||||
public BlockVector3 getMinimumPoint() {
|
||||
return getRegion().getMinimumPoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMaximumPoint() {
|
||||
public BlockVector3 getMaximumPoint() {
|
||||
return getRegion().getMaximumPoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getCenter() {
|
||||
public Vector3 getCenter() {
|
||||
return getRegion().getCenter();
|
||||
}
|
||||
|
||||
@ -99,32 +98,32 @@ public class RequestSelection implements Region {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void expand(Vector... changes) throws RegionOperationException {
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
getRegion().expand(changes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contract(Vector... changes) throws RegionOperationException {
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
getRegion().contract(changes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shift(Vector change) throws RegionOperationException {
|
||||
public void shift(BlockVector3 change) throws RegionOperationException {
|
||||
getRegion().shift(change);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Vector position) {
|
||||
public boolean contains(BlockVector3 position) {
|
||||
return getRegion().contains(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Vector2D> getChunks() {
|
||||
public Set<BlockVector2> getChunks() {
|
||||
return getRegion().getChunks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Vector> getChunkCubes() {
|
||||
public Set<BlockVector3> getChunkCubes() {
|
||||
return getRegion().getChunkCubes();
|
||||
}
|
||||
|
||||
@ -144,12 +143,12 @@ public class RequestSelection implements Region {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockVector2D> polygonize(int maxPoints) {
|
||||
public List<BlockVector2> polygonize(int maxPoints) {
|
||||
return getRegion().polygonize(maxPoints);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<BlockVector> iterator() {
|
||||
public Iterator<BlockVector3> iterator() {
|
||||
return getRegion().iterator();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user