Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 02:50:05 +01:00
Add convenient constructors in *RegionSelector classes
Dieser Commit ist enthalten in:
Ursprung
1fef255d77
Commit
77bc49e057
@ -71,6 +71,14 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
region.setPos2(pos2);
|
||||
}
|
||||
|
||||
public CuboidRegionSelector(LocalWorld world, Vector pos1, Vector pos2) {
|
||||
this(world);
|
||||
this.pos1 = pos1.toBlockVector();
|
||||
this.pos2 = pos2.toBlockVector();
|
||||
region.setPos1(pos1);
|
||||
region.setPos2(pos2);
|
||||
}
|
||||
|
||||
public boolean selectPrimary(Vector pos) {
|
||||
if (pos.equals(pos1)) {
|
||||
return false;
|
||||
|
@ -79,6 +79,16 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
}
|
||||
|
||||
public CylinderRegionSelector(LocalWorld world, Vector2D center, Vector2D radius, int minY, int maxY) {
|
||||
this(world);
|
||||
|
||||
region.setCenter(center);
|
||||
region.setRadius(radius);
|
||||
|
||||
region.setMinimumY(Math.min(minY, maxY));
|
||||
region.setMaximumY(Math.max(minY, maxY));
|
||||
}
|
||||
|
||||
public boolean selectPrimary(Vector pos) {
|
||||
if (!region.getCenter().equals(new Vector(0, 0, 0)) && pos.equals(region.getCenter())) {
|
||||
return false;
|
||||
|
@ -70,6 +70,13 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
}
|
||||
|
||||
public EllipsoidRegionSelector(LocalWorld world, Vector center, Vector radius) {
|
||||
this(world);
|
||||
|
||||
region.setCenter(center);
|
||||
region.setRadius(radius);
|
||||
}
|
||||
|
||||
public boolean selectPrimary(Vector pos) {
|
||||
if (pos.equals(region.getCenter()) && region.getRadius().lengthSq() == 0) {
|
||||
return false;
|
||||
|
@ -48,6 +48,14 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
|
||||
region.setPos2(pos2);
|
||||
}
|
||||
|
||||
public ExtendingCuboidRegionSelector(LocalWorld world, Vector pos1, Vector pos2) {
|
||||
this(world);
|
||||
pos1 = Vector.getMinimum(pos1, pos2);
|
||||
pos2 = Vector.getMaximum(pos1, pos2);
|
||||
region.setPos1(pos1);
|
||||
region.setPos2(pos2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean selectPrimary(Vector pos) {
|
||||
if (pos.equals(pos1) && pos.equals(pos2)) {
|
||||
|
@ -45,6 +45,10 @@ public class SphereRegionSelector extends EllipsoidRegionSelector {
|
||||
region.setRadius(new Vector(radiusScalar, radiusScalar, radiusScalar));
|
||||
}
|
||||
|
||||
public SphereRegionSelector(LocalWorld world, Vector center, int radius) {
|
||||
super(world, center, new Vector(radius, radius, radius));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean selectSecondary(Vector pos) {
|
||||
final Vector diff = pos.subtract(region.getCenter());
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren