mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 04:46:40 +00:00
Current Progress #3
This commit is contained in:
@ -19,14 +19,10 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.regions.iterator.RegionIterator;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.storage.ChunkStore;
|
||||
|
@ -329,7 +329,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
|
||||
@Override
|
||||
public BlockVector2 next() {
|
||||
BlockVector2 result = pos;
|
||||
MutableBlockVector2D result = pos;
|
||||
// calc next
|
||||
pos.setComponents(pos.getX() - 1, pos.getZ());
|
||||
if (pos.getX() <= minX) {
|
||||
@ -339,7 +339,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
pos.setComponents(maxX, pos.getZ() - 1);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return result.toBlockVector2();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -484,7 +484,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
x = tx;
|
||||
y = ty;
|
||||
hasNext = false;
|
||||
return mutable;
|
||||
return mutable.toBlockVector3();
|
||||
}
|
||||
} else {
|
||||
z = cbz;
|
||||
@ -503,7 +503,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
x = cbx;
|
||||
}
|
||||
}
|
||||
return mutable;
|
||||
return mutable.toBlockVector3();
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -549,7 +549,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
}
|
||||
}
|
||||
}
|
||||
return mutable;
|
||||
return mutable.toBlockVector3();
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -574,7 +574,8 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
@Override
|
||||
public BlockVector2 next() {
|
||||
if (!hasNext()) throw new java.util.NoSuchElementException();
|
||||
BlockVector2 answer = mutable.setComponents(nextX, nextZ);
|
||||
// BlockVector2 answer = mutable.setComponents(nextX, nextZ);
|
||||
BlockVector2 answer = new BlockVector2(nextX, nextZ);
|
||||
if (++nextX > max.getBlockX()) {
|
||||
nextX = min.getBlockX();
|
||||
if (++nextZ > max.getBlockZ()) {
|
||||
|
@ -19,15 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
@ -48,14 +41,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
|
||||
<<<<<<< HEAD
|
||||
private BlockVector2D center;
|
||||
private BlockVector2D radius;
|
||||
private Vector2D radiusInverse;
|
||||
=======
|
||||
private BlockVector2 center;
|
||||
private Vector2 radius;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
private Vector2 radiusInverse;
|
||||
private int minY;
|
||||
private int maxY;
|
||||
private boolean hasY = false;
|
||||
@ -117,24 +105,9 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
hasY = region.hasY;
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public Vector getCenter() {
|
||||
return center.toVector((getMaximumY() + getMinimumY()) / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the main center point of the region
|
||||
*
|
||||
* @deprecated replaced by {@link #setCenter(Vector2D)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setCenter(Vector center) {
|
||||
setCenter(center.toVector2D());
|
||||
=======
|
||||
@Override
|
||||
public Vector3 getCenter() {
|
||||
return center.toVector3((maxY + minY) / 2);
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,13 +115,8 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
*
|
||||
* @param center the center point
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
public void setCenter(Vector2D center) {
|
||||
this.center = new BlockVector2D(center);
|
||||
=======
|
||||
public void setCenter(BlockVector2 center) {
|
||||
this.center = center;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,14 +133,9 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
*
|
||||
* @param radius the radius along the X and Z axes
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
public void setRadius(Vector2D radius) {
|
||||
this.radius = radius.add(0.5, 0.5).toBlockVector2D();
|
||||
this.radiusInverse = Vector2D.ONE.divide(radius);
|
||||
=======
|
||||
public void setRadius(Vector2 radius) {
|
||||
this.radius = radius.add(0.5, 0.5);
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
this.radiusInverse = Vector2.ONE.divide(radius);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,17 +166,8 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
hasY = true;
|
||||
maxY = y;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public Vector getMinimumPoint() {
|
||||
return center.subtract(getRadius()).toVector(getMinimumY());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMaximumPoint() {
|
||||
return center.add(getRadius()).toVector(getMaximumY());
|
||||
=======
|
||||
public BlockVector3 getMinimumPoint() {
|
||||
return center.toVector2().subtract(getRadius()).toVector3(minY).toBlockPoint();
|
||||
}
|
||||
@ -221,7 +175,6 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
@Override
|
||||
public BlockVector3 getMaximumPoint() {
|
||||
return center.toVector2().add(getRadius()).toVector3(maxY).toBlockPoint();
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -291,18 +244,11 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
* @throws RegionOperationException
|
||||
*/
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void expand(Vector... changes) throws RegionOperationException {
|
||||
center = center.add(calculateDiff2D(changes)).toBlockVector2D();
|
||||
radius = radius.add(calculateChanges2D(changes)).toBlockVector2D();
|
||||
this.radiusInverse = Vector2D.ONE.divide(radius);
|
||||
for (Vector change : changes) {
|
||||
=======
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
center = center.add(calculateDiff2D(changes));
|
||||
radius = radius.add(calculateChanges2D(changes).toVector2());
|
||||
this.radiusInverse = Vector2.ONE.divide(radius);
|
||||
for (BlockVector3 change : changes) {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
int changeY = change.getBlockY();
|
||||
if (changeY > 0) {
|
||||
maxY += changeY;
|
||||
@ -319,20 +265,12 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
* @throws RegionOperationException
|
||||
*/
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void contract(Vector... changes) throws RegionOperationException {
|
||||
center = center.subtract(calculateDiff2D(changes)).toBlockVector2D();
|
||||
Vector2D newRadius = radius.subtract(calculateChanges2D(changes));
|
||||
radius = Vector2D.getMaximum(new Vector2D(1.5, 1.5), newRadius).toBlockVector2D();
|
||||
this.radiusInverse = Vector2D.ONE.divide(radius);
|
||||
for (Vector change : changes) {
|
||||
=======
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
center = center.subtract(calculateDiff2D(changes));
|
||||
Vector2 newRadius = radius.subtract(calculateChanges2D(changes).toVector2());
|
||||
radius = new Vector2(1.5, 1.5).getMaximum(newRadius);
|
||||
this.radiusInverse = Vector2.ONE.divide(radius);
|
||||
for (BlockVector3 change : changes) {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
int height = maxY - minY;
|
||||
int changeY = change.getBlockY();
|
||||
if (changeY > 0) {
|
||||
@ -344,13 +282,8 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void shift(Vector change) throws RegionOperationException {
|
||||
center = center.add(change.toVector2D()).toBlockVector2D();
|
||||
=======
|
||||
public void shift(BlockVector3 change) throws RegionOperationException {
|
||||
center = center.add(change.toBlockVector2());
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
int changeY = change.getBlockY();
|
||||
maxY += changeY;
|
||||
@ -361,15 +294,9 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
* Checks to see if a point is inside this region.
|
||||
*/
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public boolean contains(Vector position) {
|
||||
final int pt = position.getBlockY();
|
||||
if (pt < getMinimumY() || pt > getMaximumY()) {
|
||||
=======
|
||||
public boolean contains(BlockVector3 position) {
|
||||
final int blockY = position.getBlockY();
|
||||
if (blockY < minY || blockY > maxY) {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
return false;
|
||||
}
|
||||
int px = position.getBlockX();
|
||||
@ -378,11 +305,8 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
double dx = Math.abs(px - center.getBlockX()) * radiusInverse.getX();
|
||||
double dz = Math.abs(pz - center.getBlockZ()) * radiusInverse.getZ();
|
||||
|
||||
<<<<<<< HEAD
|
||||
return dx * dx + dz * dz <= 1;
|
||||
=======
|
||||
return position.toBlockVector2().subtract(center).toVector2().divide(radius).lengthSq() <= 1;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
// return position.toBlockVector2().subtract(center).toVector2().divide(radius).lengthSq() <= 1;
|
||||
}
|
||||
|
||||
|
||||
@ -415,18 +339,8 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public Iterable<Vector2D> asFlatRegion() {
|
||||
return new Iterable<Vector2D>() {
|
||||
@Override
|
||||
public Iterator<Vector2D> iterator() {
|
||||
return new FlatRegionIterator(CylinderRegion.this);
|
||||
}
|
||||
};
|
||||
=======
|
||||
public Iterable<BlockVector2> asFlatRegion() {
|
||||
return () -> new FlatRegionIterator(CylinderRegion.this);
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,13 +37,13 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
/**
|
||||
* Stores the center.
|
||||
*/
|
||||
private MutableBlockVector center;
|
||||
private BlockVector3 center;
|
||||
|
||||
/**
|
||||
* Stores the radii plus 0.5 on each axis.
|
||||
*/
|
||||
private MutableBlockVector radius;
|
||||
private MutableBlockVector radiusSqr;
|
||||
private Vector3 radius;
|
||||
private Vector3 radiusSqr;
|
||||
private int radiusLengthSqr;
|
||||
private boolean sphere;
|
||||
|
||||
@ -67,8 +67,8 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
*/
|
||||
public EllipsoidRegion(World world, BlockVector3 center, Vector3 radius) {
|
||||
super(world);
|
||||
this.center = new MutableBlockVector(center);
|
||||
setRadius(radius.toBlockPoint());
|
||||
this.center = center;
|
||||
setRadius(radius);
|
||||
}
|
||||
|
||||
public EllipsoidRegion(EllipsoidRegion ellipsoidRegion) {
|
||||
@ -128,20 +128,20 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
|
||||
@Override
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
center = new MutableBlockVector(center.add(calculateDiff(changes)));
|
||||
setRadius(radius.add(calculateChanges(changes)));
|
||||
center = center.add(calculateDiff(changes));
|
||||
setRadius(radius.add(calculateChanges(changes).toVector3()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
center = new MutableBlockVector(center.subtract(calculateDiff(changes)));
|
||||
BlockVector3 newRadius = radius.subtract(calculateChanges(changes));
|
||||
setRadius(new BlockVector3(1.5, 1.5, 1.5).getMaximum(newRadius));
|
||||
center = center.subtract(calculateDiff(changes));
|
||||
Vector3 newRadius = radius.subtract(calculateChanges(changes).toVector3());
|
||||
setRadius(new Vector3(1.5, 1.5, 1.5).getMaximum(newRadius));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shift(BlockVector3 change) throws RegionOperationException {
|
||||
center = new MutableBlockVector(center.add(change));
|
||||
center = center.add(change);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -160,7 +160,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
* @param center the center
|
||||
*/
|
||||
public void setCenter(BlockVector3 center) {
|
||||
this.center = new MutableBlockVector(center);
|
||||
this.center = center;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,7 +170,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
*/
|
||||
public Vector3 getRadius() {
|
||||
if (radius == null) return null;
|
||||
return radius.toVector3().subtract(0.5, 0.5, 0.5);
|
||||
return radius.subtract(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,10 +178,10 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
*
|
||||
* @param radius the radius
|
||||
*/
|
||||
public void setRadius(BlockVector3 radius) {
|
||||
this.radius = new MutableBlockVector(radius);
|
||||
radiusSqr = new MutableBlockVector(radius.multiply(radius));
|
||||
radiusLengthSqr = radiusSqr.getBlockX();
|
||||
public void setRadius(Vector3 radius) {
|
||||
this.radius = radius;
|
||||
radiusSqr = radius.multiply(radius);
|
||||
radiusLengthSqr = (int) radiusSqr.getX();
|
||||
if (radius.getY() == radius.getX() && radius.getX() == radius.getZ()) {
|
||||
this.sphere = true;
|
||||
} else {
|
||||
@ -238,7 +238,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
// double czd = (double) cz / radius.getBlockZ();
|
||||
// return cxd * cxd + cyd * cyd + czd * czd <= 1;
|
||||
public boolean contains(BlockVector3 position) {
|
||||
return position.subtract(center).divide(radius).lengthSq() <= 1;
|
||||
return position.subtract(center).divide(radius.toBlockPoint()).lengthSq() <= 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -253,7 +253,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
}
|
||||
|
||||
public void extendRadius(Vector3 minRadius) {
|
||||
setRadius(minRadius.getMaximum(getRadius()).toBlockPoint());
|
||||
setRadius(minRadius.getMaximum(getRadius()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,14 +19,10 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -277,7 +277,6 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public boolean contains(int targetX, int targetZ) {
|
||||
boolean inside = false;
|
||||
int npoints = points.size();
|
||||
@ -325,11 +324,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
|
||||
return inside;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Vector position) {
|
||||
=======
|
||||
public boolean contains(BlockVector3 position) {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
return contains(points, minY, maxY, position);
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ public interface RegionSelector {
|
||||
* @return
|
||||
* @throws IncompleteRegionException
|
||||
*/
|
||||
default List<Vector> getVerticies() throws IncompleteRegionException {
|
||||
default List<BlockVector3> getVerticies() throws IncompleteRegionException {
|
||||
return Collections.singletonList(getPrimaryPosition());
|
||||
}
|
||||
|
||||
|
@ -19,17 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.math.transform.Identity;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
@ -19,27 +19,16 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.iterator;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.regions.FlatRegion;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class FlatRegion3DIterator implements Iterator<BlockVector> {
|
||||
=======
|
||||
public class FlatRegion3DIterator implements Iterator<BlockVector3> {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
private Iterator<BlockVector2> flatIterator;
|
||||
private int minY;
|
||||
|
@ -19,27 +19,18 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.iterator;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class FlatRegionIterator implements Iterator<Vector2D> {
|
||||
=======
|
||||
public class FlatRegionIterator implements Iterator<BlockVector2> {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
private Region region;
|
||||
private int y;
|
||||
@ -76,11 +67,7 @@ public class FlatRegionIterator implements Iterator<BlockVector2> {
|
||||
}
|
||||
|
||||
private void forward() {
|
||||
<<<<<<< HEAD
|
||||
while (hasNext() && !region.contains(nextX, y, nextZ)) {
|
||||
=======
|
||||
while (hasNext() && !region.contains(new BlockVector3(nextX, y, nextZ))) {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
forwardOne();
|
||||
}
|
||||
}
|
||||
|
@ -19,25 +19,16 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.iterator;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class RegionIterator implements Iterator<BlockVector> {
|
||||
=======
|
||||
public class RegionIterator implements Iterator<BlockVector3> {
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
private final Region region;
|
||||
private final int maxX;
|
||||
|
@ -19,13 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.polyhedron;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
|
@ -19,13 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.polyhedron;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
|
@ -19,14 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -104,15 +99,9 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
||||
|
||||
region = new ConvexPolyhedralRegion(oldRegion.getWorld());
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (final BlockVector2D pt : new ArrayList<BlockVector2D>(oldRegion.polygonize(Integer.MAX_VALUE))) {
|
||||
region.addVertex(pt.toVector(minY));
|
||||
region.addVertex(pt.toVector(maxY));
|
||||
=======
|
||||
for (final BlockVector2 pt : new ArrayList<>(oldRegion.polygonize(Integer.MAX_VALUE))) {
|
||||
region.addVertex(pt.toBlockVector3(minY));
|
||||
region.addVertex(pt.toBlockVector3(maxY));
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
}
|
||||
|
||||
learnChanges();
|
||||
@ -120,7 +109,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vector> getVerticies() {
|
||||
public List<BlockVector3> getVerticies() {
|
||||
return new ArrayList<>(region.getVertices());
|
||||
}
|
||||
|
||||
@ -258,11 +247,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
||||
Collection<BlockVector3> vertices = region.getVertices();
|
||||
Collection<Triangle> triangles = region.getTriangles();
|
||||
|
||||
<<<<<<< HEAD
|
||||
Map<Vector, Integer> vertexIds = new HashMap<Vector, Integer>(vertices.size());
|
||||
=======
|
||||
Map<BlockVector3, Integer> vertexIds = new HashMap<>(vertices.size());
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
int lastVertexId = -1;
|
||||
for (BlockVector3 vertex : vertices) {
|
||||
vertexIds.put(vertex, ++lastVertexId);
|
||||
|
@ -19,22 +19,17 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Commands;
|
||||
import com.boydti.fawe.util.chat.Message;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.SelectionCommands;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.cui.CUIRegion;
|
||||
import com.sk89q.worldedit.internal.cui.SelectionPointEvent;
|
||||
@ -57,15 +52,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
<<<<<<< HEAD
|
||||
public transient BlockVector position1;
|
||||
public transient BlockVector position2;
|
||||
public transient CuboidRegion region;
|
||||
=======
|
||||
protected transient BlockVector3 position1;
|
||||
protected transient BlockVector3 position2;
|
||||
protected transient CuboidRegion region;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
/**
|
||||
* Create a new region selector with a {@code null} world.
|
||||
@ -129,7 +118,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vector> getVerticies() {
|
||||
public List<BlockVector3> getVerticies() {
|
||||
return Arrays.asList(position1, position2);
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -176,13 +172,8 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_CENTER.send(player, pos, 0);
|
||||
=======
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.print("Starting a new cylindrical selection at " + pos + ".");
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_CENTER.send(player, pos, 0);
|
||||
|
||||
session.describeCUI(player);
|
||||
}
|
||||
@ -191,13 +182,8 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
Vector3 center = region.getCenter();
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (!center.equals(Vector.ZERO)) {
|
||||
if (!center.equals(BlockVector3.ZERO)) {
|
||||
BBC.SELECTOR_RADIUS.send(player, NUMBER_FORMAT.format(region.getRadius().getX()) + "/" + NUMBER_FORMAT.format(region.getRadius().getZ()), region.getArea());
|
||||
=======
|
||||
if (!center.equals(Vector3.ZERO)) {
|
||||
player.print("Radius set to " + NUMBER_FORMAT.format(region.getRadius().getX()) + "/" + NUMBER_FORMAT.format(region.getRadius().getZ()) + " blocks. (" + region.getArea() + ").");
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
} else {
|
||||
BBC.SELECTION_WAND.send(player);
|
||||
return;
|
||||
|
@ -19,13 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -149,33 +145,15 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_CENTER.send(player, region.getCenter(), region.getArea());
|
||||
=======
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
if (isDefined()) {
|
||||
player.print("Center position set to " + region.getCenter() + " (" + region.getArea() + ").");
|
||||
} else {
|
||||
player.print("Center position set to " + region.getCenter() + ".");
|
||||
}
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_CENTER.send(player, region.getCenter(), region.getArea());
|
||||
|
||||
session.describeCUI(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_RADIUS.send(player, region.getRadius(), region.getArea());
|
||||
=======
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
if (isDefined()) {
|
||||
player.print("Radius set to " + region.getRadius() + " (" + region.getArea() + ").");
|
||||
} else {
|
||||
player.print("Radius set to " + region.getRadius() + ".");
|
||||
}
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_RADIUS.send(player, region.getRadius(), region.getArea());
|
||||
|
||||
session.describeCUI(player);
|
||||
}
|
||||
|
@ -19,11 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
=======
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -132,25 +128,15 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_POS.send(player, 1, pos, region.getArea());
|
||||
=======
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.print("Started selection at " + pos + " (" + region.getArea() + ").");
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_POS.send(player, 1, pos, region.getArea());
|
||||
|
||||
explainRegionAdjust(player, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_EXPANDED.send(player, pos, region.getArea());
|
||||
=======
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.print("Extended selection to encompass " + pos + " (" + region.getArea() + ").");
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_EXPANDED.send(player, pos, region.getArea());
|
||||
|
||||
explainRegionAdjust(player, session);
|
||||
}
|
||||
|
@ -19,14 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -174,13 +169,8 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_POS.send(player, 1, pos, region.getArea());
|
||||
=======
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.print("Starting a new polygon at " + pos + ".");
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_POS.send(player, 1, pos, region.getArea());
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID()));
|
||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getArea()));
|
||||
@ -188,13 +178,8 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_POS.send(player, region.size(), pos, region.getArea());
|
||||
=======
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.print("Added point #" + region.size() + " at " + pos + ".");
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_POS.send(player, region.size(), pos, region.getArea());
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(region.size() - 1, pos, getArea()));
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
|
||||
|
@ -86,17 +86,8 @@ public class SphereRegionSelector extends EllipsoidRegionSelector {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
|
||||
BBC.SELECTOR_RADIUS.send(player, region.getRadius().getX(), region.getArea());
|
||||
=======
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
if (isDefined()) {
|
||||
player.print("Radius set to " + region.getRadius().getX() + " (" + region.getArea() + ").");
|
||||
} else {
|
||||
player.print("Radius set to " + region.getRadius().getX() + ".");
|
||||
}
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
BBC.SELECTOR_RADIUS.send(player, region.getRadius().getX(), region.getArea());
|
||||
|
||||
session.describeCUI(player);
|
||||
}
|
||||
|
@ -19,12 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.shape;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
Reference in New Issue
Block a user