geforkt von Mirrors/FastAsyncWorldEdit
Used vector constants in all appropriate placed.
Dieser Commit ist enthalten in:
Ursprung
4c496bfaac
Commit
b28fdbfe4e
@ -64,7 +64,7 @@ public class ClipboardCommands {
|
|||||||
Vector pos = session.getPlacementPosition(player);
|
Vector pos = session.getPlacementPosition(player);
|
||||||
|
|
||||||
CuboidClipboard clipboard = new CuboidClipboard(
|
CuboidClipboard clipboard = new CuboidClipboard(
|
||||||
max.subtract(min).add(new Vector(1, 1, 1)),
|
max.subtract(min).add(Vector.ONE),
|
||||||
min, min.subtract(pos));
|
min, min.subtract(pos));
|
||||||
clipboard.copy(editSession);
|
clipboard.copy(editSession);
|
||||||
if (args.hasFlag('e')) {
|
if (args.hasFlag('e')) {
|
||||||
@ -107,7 +107,7 @@ public class ClipboardCommands {
|
|||||||
Vector pos = session.getPlacementPosition(player);
|
Vector pos = session.getPlacementPosition(player);
|
||||||
|
|
||||||
CuboidClipboard clipboard = new CuboidClipboard(
|
CuboidClipboard clipboard = new CuboidClipboard(
|
||||||
max.subtract(min).add(new Vector(1, 1, 1)),
|
max.subtract(min).add(Vector.ONE),
|
||||||
min, min.subtract(pos));
|
min, min.subtract(pos));
|
||||||
clipboard.copy(editSession);
|
clipboard.copy(editSession);
|
||||||
if (args.hasFlag('e')) {
|
if (args.hasFlag('e')) {
|
||||||
|
@ -384,17 +384,17 @@ public class GenerationCommands {
|
|||||||
Vector unit;
|
Vector unit;
|
||||||
|
|
||||||
if (args.hasFlag('r')) {
|
if (args.hasFlag('r')) {
|
||||||
zero = new Vector(0, 0, 0);
|
zero = Vector.ZERO;
|
||||||
unit = new Vector(1, 1, 1);
|
unit = Vector.ONE;
|
||||||
} else if (args.hasFlag('o')) {
|
} else if (args.hasFlag('o')) {
|
||||||
zero = session.getPlacementPosition(player);
|
zero = session.getPlacementPosition(player);
|
||||||
unit = new Vector(1, 1, 1);
|
unit = Vector.ONE;
|
||||||
} else if (args.hasFlag('c')) {
|
} else if (args.hasFlag('c')) {
|
||||||
final Vector min = region.getMinimumPoint();
|
final Vector min = region.getMinimumPoint();
|
||||||
final Vector max = region.getMaximumPoint();
|
final Vector max = region.getMaximumPoint();
|
||||||
|
|
||||||
zero = max.add(min).multiply(0.5);
|
zero = max.add(min).multiply(0.5);
|
||||||
unit = new Vector(1, 1, 1);
|
unit = Vector.ONE;
|
||||||
} else {
|
} else {
|
||||||
final Vector min = region.getMinimumPoint();
|
final Vector min = region.getMinimumPoint();
|
||||||
final Vector max = region.getMaximumPoint();
|
final Vector max = region.getMaximumPoint();
|
||||||
|
@ -393,11 +393,11 @@ public class RegionCommands {
|
|||||||
Vector unit;
|
Vector unit;
|
||||||
|
|
||||||
if (args.hasFlag('r')) {
|
if (args.hasFlag('r')) {
|
||||||
zero = new Vector(0, 0, 0);
|
zero = Vector.ZERO;
|
||||||
unit = new Vector(1, 1, 1);
|
unit = Vector.ONE;
|
||||||
} else if (args.hasFlag('o')) {
|
} else if (args.hasFlag('o')) {
|
||||||
zero = session.getPlacementPosition(player);
|
zero = session.getPlacementPosition(player);
|
||||||
unit = new Vector(1, 1, 1);
|
unit = Vector.ONE;
|
||||||
} else {
|
} else {
|
||||||
final Vector min = region.getMinimumPoint();
|
final Vector min = region.getMinimumPoint();
|
||||||
final Vector max = region.getMaximumPoint();
|
final Vector max = region.getMaximumPoint();
|
||||||
|
@ -602,7 +602,7 @@ public class SelectionCommands {
|
|||||||
|
|
||||||
player.print("Size: " + size);
|
player.print("Size: " + size);
|
||||||
player.print("Offset: " + offset);
|
player.print("Offset: " + offset);
|
||||||
player.print("Cuboid distance: " + size.distance( new Vector(1, 1, 1)));
|
player.print("Cuboid distance: " + size.distance(Vector.ONE));
|
||||||
player.print("# of blocks: "
|
player.print("# of blocks: "
|
||||||
+ (int) (size.getX() * size.getY() * size.getZ()));
|
+ (int) (size.getX() * size.getY() * size.getZ()));
|
||||||
return;
|
return;
|
||||||
|
@ -90,7 +90,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean selectPrimary(Vector pos) {
|
public boolean selectPrimary(Vector pos) {
|
||||||
if (!region.getCenter().equals(new Vector(0, 0, 0)) && pos.compareTo(region.getCenter()) == 0) {
|
if (!region.getCenter().equals(Vector.ZERO) && pos.compareTo(region.getCenter()) == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
|
|
||||||
public boolean selectSecondary(Vector pos) {
|
public boolean selectSecondary(Vector pos) {
|
||||||
Vector center = region.getCenter();
|
Vector center = region.getCenter();
|
||||||
if ((center.compareTo(new Vector(0, 0, 0))) == 0) {
|
if ((center.compareTo(Vector.ZERO)) == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
|
|
||||||
public void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector pos) {
|
public void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector pos) {
|
||||||
Vector center = region.getCenter();
|
Vector center = region.getCenter();
|
||||||
if (!center.equals(new Vector(0, 0, 0))) {
|
if (!center.equals(Vector.ZERO)) {
|
||||||
player.print("Radius set to " + format.format(region.getRadius().getX()) + "/" + format.format(region.getRadius().getZ()) + " blocks. (" + region.getArea() + ").");
|
player.print("Radius set to " + format.format(region.getRadius().getX()) + "/" + format.format(region.getRadius().getZ()) + " blocks. (" + region.getArea() + ").");
|
||||||
} else {
|
} else {
|
||||||
player.printError("You must select the center point before setting the radius.");
|
player.printError("You must select the center point before setting the radius.");
|
||||||
@ -159,7 +159,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDefined() {
|
public boolean isDefined() {
|
||||||
return !region.getRadius().equals(new Vector2D(0, 0));
|
return !region.getRadius().equals(Vector2D.ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void learnChanges() {
|
public void learnChanges() {
|
||||||
@ -176,10 +176,10 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
public List<String> getInformationLines() {
|
public List<String> getInformationLines() {
|
||||||
final List<String> lines = new ArrayList<String>();
|
final List<String> lines = new ArrayList<String>();
|
||||||
|
|
||||||
if (!region.getCenter().equals(new Vector(0, 0, 0))) {
|
if (!region.getCenter().equals(Vector.ZERO)) {
|
||||||
lines.add("Center: " + region.getCenter());
|
lines.add("Center: " + region.getCenter());
|
||||||
}
|
}
|
||||||
if (!region.getRadius().equals(new Vector2D(0, 0))) {
|
if (!region.getRadius().equals(Vector2D.ZERO)) {
|
||||||
lines.add("Radius: " + region.getRadius());
|
lines.add("Radius: " + region.getRadius());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren