mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-23 08:16:52 +00:00
chore: address deprecations in vector classes
This commit is contained in:
@ -339,11 +339,11 @@ public class FaweAPI {
|
||||
final BlockVector3 bot = selection.getMinimumPoint();
|
||||
final BlockVector3 top = selection.getMaximumPoint();
|
||||
|
||||
final int minX = bot.getBlockX() >> 4;
|
||||
final int minZ = bot.getBlockZ() >> 4;
|
||||
final int minX = bot.x() >> 4;
|
||||
final int minZ = bot.z() >> 4;
|
||||
|
||||
final int maxX = top.getBlockX() >> 4;
|
||||
final int maxZ = top.getBlockZ() >> 4;
|
||||
final int maxX = top.x() >> 4;
|
||||
final int maxZ = top.z() >> 4;
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
@ -50,9 +50,9 @@ public class BlendBall implements Brush {
|
||||
final int outsetSize = (int) (size + 1);
|
||||
double brushSizeSquared = size * size;
|
||||
|
||||
int tx = position.getBlockX();
|
||||
int ty = position.getBlockY();
|
||||
int tz = position.getBlockZ();
|
||||
int tx = position.x();
|
||||
int ty = position.y();
|
||||
int tz = position.z();
|
||||
|
||||
int[] frequency = new int[BlockTypes.size()];
|
||||
|
||||
|
@ -81,9 +81,9 @@ public class CatenaryBrush implements Brush, ResettableTool {
|
||||
return pos1.add(pos2).divide(2).toBlockPoint();
|
||||
}
|
||||
double curveLen = pos1.distance(pos2) * lenPercent;
|
||||
double dy = pos2.getY() - pos1.getY();
|
||||
double dx = pos2.getX() - pos1.getX();
|
||||
double dz = pos2.getZ() - pos1.getZ();
|
||||
double dy = pos2.y() - pos1.y();
|
||||
double dx = pos2.x() - pos1.x();
|
||||
double dz = pos2.z() - pos1.z();
|
||||
double dh = Math.sqrt(dx * dx + dz * dz);
|
||||
double g = Math.sqrt(curveLen * curveLen - dy * dy) / 2;
|
||||
double a = 0.00001;
|
||||
|
@ -54,9 +54,9 @@ public class CommandBrush implements Brush {
|
||||
position.subtract(radius, radius, radius),
|
||||
position.add(radius, radius, radius)
|
||||
);
|
||||
String replaced = command.replace("{x}", Integer.toString(position.getBlockX()))
|
||||
.replace("{y}", Integer.toString(position.getBlockY()))
|
||||
.replace("{z}", Integer.toString(position.getBlockZ()))
|
||||
String replaced = command.replace("{x}", Integer.toString(position.x()))
|
||||
.replace("{y}", Integer.toString(position.y()))
|
||||
.replace("{z}", Integer.toString(position.z()))
|
||||
.replace("{world}", editSession.getWorld().getName())
|
||||
.replace("{size}", Integer.toString(radius));
|
||||
|
||||
|
@ -65,11 +65,11 @@ public class CopyPastaBrush implements Brush, ResettableTool {
|
||||
mask = Masks.alwaysTrue();
|
||||
}
|
||||
final ResizableClipboardBuilder builder = new ResizableClipboardBuilder(editSession.getWorld());
|
||||
final int minY = position.getBlockY();
|
||||
final int minY = position.y();
|
||||
mask = new AbstractDelegateMask(mask) {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (super.test(vector) && vector.getBlockY() >= minY) {
|
||||
if (super.test(vector) && vector.y() >= minY) {
|
||||
BaseBlock block = editSession.getFullBlock(vector);
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
builder.add(vector, BlockTypes.AIR.getDefaultState().toBaseBlock(), block);
|
||||
|
@ -63,9 +63,9 @@ public class ErodeBrush implements Brush {
|
||||
Clipboard buffer1 = new CPUOptimizedClipboard(region);
|
||||
Clipboard buffer2 = new CPUOptimizedClipboard(region);
|
||||
|
||||
final int bx = target.getBlockX();
|
||||
final int by = target.getBlockY();
|
||||
final int bz = target.getBlockZ();
|
||||
final int bx = target.x();
|
||||
final int by = target.y();
|
||||
final int bz = target.z();
|
||||
|
||||
for (int x = -brushSize, relx = 0; x <= brushSize && relx < buffer1.getWidth(); x++, relx++) {
|
||||
int x0 = x + bx;
|
||||
@ -106,7 +106,7 @@ public class ErodeBrush implements Brush {
|
||||
|
||||
for (BlockVector3 pos : finalBuffer) {
|
||||
BlockState block = pos.getBlock(finalBuffer);
|
||||
es.setBlock(pos.getX() + bx - brushSize, pos.getY() + by - brushSize, pos.getZ() + bz - brushSize, block);
|
||||
es.setBlock(pos.x() + bx - brushSize, pos.y() + by - brushSize, pos.z() + bz - brushSize, block);
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,9 +139,9 @@ public class ErodeBrush implements Brush {
|
||||
int highest = 1;
|
||||
for (BlockVector3 offs : FACES_TO_CHECK) {
|
||||
BaseBlock next = current.getFullBlock(
|
||||
relx + offs.getBlockX(),
|
||||
rely + offs.getBlockY(),
|
||||
relz + offs.getBlockZ()
|
||||
relx + offs.x(),
|
||||
rely + offs.y(),
|
||||
relz + offs.z()
|
||||
);
|
||||
if (!next.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
continue;
|
||||
@ -190,9 +190,9 @@ public class ErodeBrush implements Brush {
|
||||
int total = 0;
|
||||
for (BlockVector3 offs : FACES_TO_CHECK) {
|
||||
BaseBlock next = current.getFullBlock(
|
||||
relx + offs.getBlockX(),
|
||||
rely + offs.getBlockY(),
|
||||
relz + offs.getBlockZ()
|
||||
relx + offs.x(),
|
||||
rely + offs.y(),
|
||||
relz + offs.z()
|
||||
);
|
||||
if (next.getMaterial().isMovementBlocker()) {
|
||||
continue;
|
||||
|
@ -12,9 +12,9 @@ public class FallingSphere implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws
|
||||
MaxChangedBlocksException {
|
||||
int px = position.getBlockX();
|
||||
int py = position.getBlockY();
|
||||
int pz = position.getBlockZ();
|
||||
int px = position.x();
|
||||
int py = position.y();
|
||||
int pz = position.z();
|
||||
int maxY = editSession.getMaxY();
|
||||
int minY = editSession.getMinY();
|
||||
|
||||
|
@ -14,7 +14,6 @@ import com.sk89q.worldedit.command.tool.BrushTool;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
@ -25,7 +24,6 @@ import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
@ -80,9 +78,9 @@ public class InspectBrush extends BrushTool {
|
||||
return true;
|
||||
}
|
||||
BlockVector3 target = targetVector.toBlockPoint();
|
||||
final int x = target.getBlockX();
|
||||
final int y = target.getBlockY();
|
||||
final int z = target.getBlockZ();
|
||||
final int x = target.x();
|
||||
final int y = target.y();
|
||||
final int z = target.z();
|
||||
World world = player.getWorld();
|
||||
RollbackDatabase db = DBHandler.dbHandler().getDatabase(world);
|
||||
int count = 0;
|
||||
|
@ -35,7 +35,7 @@ public record RecurseBrush(boolean dfs) implements Brush {
|
||||
DFSRecursiveVisitor visitor = new DFSRecursiveVisitor(mask, replace, Integer.MAX_VALUE, Integer.MAX_VALUE) {
|
||||
@Override
|
||||
public boolean isVisitable(BlockVector3 from, BlockVector3 to) {
|
||||
int y = to.getBlockY();
|
||||
int y = to.y();
|
||||
return y < maxY && radMask.test(to) && super.isVisitable(from, to);
|
||||
}
|
||||
};
|
||||
@ -45,7 +45,7 @@ public record RecurseBrush(boolean dfs) implements Brush {
|
||||
RecursiveVisitor visitor = new RecursiveVisitor(mask, replace, radius, editSession.getMinY(), editSession.getMaxY()) {
|
||||
@Override
|
||||
public boolean isVisitable(BlockVector3 from, BlockVector3 to) {
|
||||
int y = to.getBlockY();
|
||||
int y = to.y();
|
||||
return y < maxY && super.isVisitable(from, to);
|
||||
}
|
||||
};
|
||||
|
@ -19,15 +19,15 @@ public record RockBrush(double amplitude, double frequency, Vector3 radius) impl
|
||||
double seedY = ThreadLocalRandom.current().nextDouble();
|
||||
double seedZ = ThreadLocalRandom.current().nextDouble();
|
||||
|
||||
int px = position.getBlockX();
|
||||
int py = position.getBlockY();
|
||||
int pz = position.getBlockZ();
|
||||
int px = position.x();
|
||||
int py = position.y();
|
||||
int pz = position.z();
|
||||
|
||||
double distort = this.frequency / size;
|
||||
|
||||
double modX = 1D / radius.getX();
|
||||
double modY = 1D / radius.getY();
|
||||
double modZ = 1D / radius.getZ();
|
||||
double modX = 1D / radius.x();
|
||||
double modY = 1D / radius.y();
|
||||
double modZ = 1D / radius.z();
|
||||
|
||||
int radiusSqr = (int) (size * size);
|
||||
int sizeInt = (int) size * 2;
|
||||
|
@ -67,15 +67,15 @@ public class ScatterBrush implements Brush {
|
||||
}
|
||||
BlockVector3 patternSize = pattern.size();
|
||||
BlockVector3Set placed = BlockVector3Set.getAppropriateVectorSet(patternSize.add(distance, distance, distance));
|
||||
placed.setOffset(position.getX(), position.getY(), position.getZ());
|
||||
placed.setOffset(position.x(), position.y(), position.z());
|
||||
int maxFails = 1000;
|
||||
for (int i = 0; i < count; i++) {
|
||||
int index = ThreadLocalRandom.current().nextInt(length);
|
||||
BlockVector3 pos = visited.get(index);
|
||||
if (pos != null && canApply(pos)) {
|
||||
int x = pos.getBlockX();
|
||||
int y = pos.getBlockY();
|
||||
int z = pos.getBlockZ();
|
||||
int x = pos.x();
|
||||
int y = pos.y();
|
||||
int z = pos.z();
|
||||
if (placed.containsRadius(x, y, z, distance)) {
|
||||
if (maxFails-- <= 0) {
|
||||
break;
|
||||
|
@ -45,9 +45,9 @@ public class ScatterCommand extends ScatterBrush {
|
||||
position.subtract(radius, radius, radius),
|
||||
position.add(radius, radius, radius)
|
||||
);
|
||||
String replaced = command.replace("{x}", Integer.toString(position.getBlockX()))
|
||||
.replace("{y}", Integer.toString(position.getBlockY()))
|
||||
.replace("{z}", Integer.toString(position.getBlockZ()))
|
||||
String replaced = command.replace("{x}", Integer.toString(position.x()))
|
||||
.replace("{y}", Integer.toString(position.y()))
|
||||
.replace("{z}", Integer.toString(position.z()))
|
||||
.replace("{world}", editSession.getWorld().getName())
|
||||
.replace("{size}", Integer.toString(radius));
|
||||
|
||||
|
@ -16,9 +16,9 @@ public class ScatterOverlayBrush extends ScatterBrush {
|
||||
@Override
|
||||
public void apply(EditSession editSession, LocalBlockVectorSet placed, BlockVector3 pt, Pattern p, double size) throws
|
||||
MaxChangedBlocksException {
|
||||
final int x = pt.getBlockX();
|
||||
final int y = pt.getBlockY();
|
||||
final int z = pt.getBlockZ();
|
||||
final int x = pt.x();
|
||||
final int y = pt.y();
|
||||
final int z = pt.z();
|
||||
BlockVector3 dir = getDirection(pt);
|
||||
if (dir == null) {
|
||||
getDir:
|
||||
@ -37,7 +37,7 @@ public class ScatterOverlayBrush extends ScatterBrush {
|
||||
return;
|
||||
}
|
||||
}
|
||||
editSession.setBlock(x + dir.getBlockX(), y + dir.getBlockY(), z + dir.getBlockZ(), p);
|
||||
editSession.setBlock(x + dir.x(), y + dir.y(), z + dir.z(), p);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -80,13 +80,13 @@ public class ShatterBrush extends ScatterBrush {
|
||||
}
|
||||
for (int i1 = 0; i1 < BreadthFirstSearch.DIAGONAL_DIRECTIONS.length; i1++) {
|
||||
BlockVector3 direction = BreadthFirstSearch.DIAGONAL_DIRECTIONS[i1];
|
||||
int x2 = x + direction.getBlockX();
|
||||
int y2 = y + direction.getBlockY();
|
||||
int z2 = z + direction.getBlockZ();
|
||||
int x2 = x + direction.x();
|
||||
int y2 = y + direction.y();
|
||||
int z2 = z + direction.z();
|
||||
// Check boundary
|
||||
int dx = position.getBlockX() - x2;
|
||||
int dy = position.getBlockY() - y2;
|
||||
int dz = position.getBlockZ() - z2;
|
||||
int dx = position.x() - x2;
|
||||
int dy = position.y() - y2;
|
||||
int dz = position.z() - z2;
|
||||
int dSqr = (dx * dx) + (dy * dy) + (dz * dz);
|
||||
if (dSqr <= radius2) {
|
||||
BlockVector3 bv = mutable.setComponents(x2, y2, z2);
|
||||
|
@ -130,9 +130,9 @@ public class SplineBrush implements Brush, ResettableTool {
|
||||
private Vector3 getCentroid(Collection<BlockVector3> points) {
|
||||
MutableVector3 sum = new MutableVector3();
|
||||
for (BlockVector3 p : points) {
|
||||
sum.mutX(sum.getX() + p.getX());
|
||||
sum.mutY(sum.getY() + p.getY());
|
||||
sum.mutZ(sum.getZ() + p.getZ());
|
||||
sum.mutX(sum.x() + p.x());
|
||||
sum.mutY(sum.y() + p.y());
|
||||
sum.mutZ(sum.z() + p.z());
|
||||
}
|
||||
return sum.multiply(1.0 / points.size());
|
||||
}
|
||||
|
@ -38,16 +38,16 @@ public class SurfaceSpline implements Brush {
|
||||
int minY = editSession.getMinY();
|
||||
if (path.isEmpty() || !pos.equals(path.get(path.size() - 1))) {
|
||||
int max = editSession.getNearestSurfaceTerrainBlock(
|
||||
pos.getBlockX(),
|
||||
pos.getBlockZ(),
|
||||
pos.getBlockY(),
|
||||
pos.x(),
|
||||
pos.z(),
|
||||
pos.y(),
|
||||
minY,
|
||||
maxY
|
||||
);
|
||||
if (max == -1) {
|
||||
return;
|
||||
}
|
||||
path.add(BlockVector3.at(pos.getBlockX(), max, pos.getBlockZ()));
|
||||
path.add(BlockVector3.at(pos.x(), max, pos.z()));
|
||||
if (editSession.getActor() != null) {
|
||||
editSession.getActor().print(Caption.of("fawe.worldedit.brush.spline.primary.2"));
|
||||
}
|
||||
@ -69,9 +69,9 @@ public class SurfaceSpline implements Brush {
|
||||
LocalBlockVectorSet vset = new LocalBlockVectorSet();
|
||||
for (double loop = 0; loop <= 1; loop += 1D / splinelength / quality) {
|
||||
final Vector3 tipv = interpol.getPosition(loop);
|
||||
final int tipx = MathMan.roundInt(tipv.getX());
|
||||
final int tipz = (int) tipv.getZ();
|
||||
int tipy = MathMan.roundInt(tipv.getY());
|
||||
final int tipx = MathMan.roundInt(tipv.x());
|
||||
final int tipz = (int) tipv.z();
|
||||
int tipy = MathMan.roundInt(tipv.y());
|
||||
tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, minY, maxY, Integer.MIN_VALUE, Integer.MAX_VALUE);
|
||||
if (tipy == Integer.MIN_VALUE || tipy == Integer.MAX_VALUE) {
|
||||
continue;
|
||||
@ -88,15 +88,15 @@ public class SurfaceSpline implements Brush {
|
||||
LocalBlockVectorSet newSet = new LocalBlockVectorSet();
|
||||
final int ceilrad = (int) Math.ceil(radius);
|
||||
for (BlockVector3 v : vset) {
|
||||
final int tipx = v.getBlockX();
|
||||
final int tipz = v.getBlockZ();
|
||||
final int tipx = v.x();
|
||||
final int tipz = v.z();
|
||||
for (int loopx = tipx - ceilrad; loopx <= tipx + ceilrad; loopx++) {
|
||||
for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
|
||||
if (MathMan.hypot2(loopx - tipx, 0, loopz - tipz) <= radius2) {
|
||||
int y = editSession.getNearestSurfaceTerrainBlock(
|
||||
loopx,
|
||||
loopz,
|
||||
v.getBlockY(),
|
||||
v.y(),
|
||||
minY,
|
||||
maxY,
|
||||
Integer.MIN_VALUE,
|
||||
|
@ -83,7 +83,7 @@ public class ClipboardSpline extends Spline {
|
||||
Region region = clipboard.getRegion();
|
||||
BlockVector3 origin = clipboard.getOrigin();
|
||||
// center = region.getCenter().setY(origin.getY() - 1);
|
||||
center = region.getCenter().withY(origin.getY() - 1).toBlockPoint();
|
||||
center = region.getCenter().withY(origin.y() - 1).toBlockPoint();
|
||||
this.centerOffset = center.subtract(center.round());
|
||||
this.center = center.subtract(centerOffset);
|
||||
this.transform = transform;
|
||||
@ -108,15 +108,15 @@ public class ClipboardSpline extends Spline {
|
||||
clipboardHolder.setTransform(transform);
|
||||
|
||||
BlockVector3 functionOffset = target.subtract(clipboard.getOrigin());
|
||||
final int offX = functionOffset.getBlockX();
|
||||
final int offY = functionOffset.getBlockY();
|
||||
final int offZ = functionOffset.getBlockZ();
|
||||
final int offX = functionOffset.x();
|
||||
final int offY = functionOffset.y();
|
||||
final int offZ = functionOffset.z();
|
||||
|
||||
Operation operation = clipboardHolder
|
||||
.createPaste(editSession)
|
||||
.to(target)
|
||||
.ignoreAirBlocks(true)
|
||||
.filter(v -> buffer.add(v.getBlockX() + offX, v.getBlockY() + offY, v.getBlockZ() + offZ))
|
||||
.filter(v -> buffer.add(v.x() + offX, v.y() + offY, v.z() + offZ))
|
||||
.build();
|
||||
Operations.completeLegacy(operation);
|
||||
|
||||
|
@ -121,7 +121,7 @@ public abstract class Spline {
|
||||
* 2 dimensional "cross" product. cross2D(v1, v2) = |v1|*|v2|*sin(theta) or v1 X v2 taking Y to be 0
|
||||
*/
|
||||
private double cross2D(Vector2 v1, Vector2 v2) {
|
||||
return v1.getX() * v2.getZ() - v2.getX() * v1.getZ();
|
||||
return v1.x() * v2.z() - v2.x() * v1.z();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +144,7 @@ public abstract class Spline {
|
||||
// Calculate rotation from spline
|
||||
|
||||
Vector3 deriv = interpolation.get1stDerivative(position);
|
||||
Vector2 deriv2D = Vector2.at(deriv.getX(), deriv.getZ()).normalize();
|
||||
Vector2 deriv2D = Vector2.at(deriv.x(), deriv.z()).normalize();
|
||||
double angle = Math.toDegrees(
|
||||
-Math.atan2(cross2D(direction, deriv2D), direction.dot(deriv2D))
|
||||
);
|
||||
|
@ -79,13 +79,13 @@ public class SweepBrush implements Brush, ResettableTool {
|
||||
Clipboard clipboard = holder.getClipboard();
|
||||
|
||||
BlockVector3 dimensions = clipboard.getDimensions();
|
||||
double quality = Math.max(dimensions.getBlockX(), dimensions.getBlockZ());
|
||||
double quality = Math.max(dimensions.x(), dimensions.z());
|
||||
|
||||
AffineTransform transform = new AffineTransform();
|
||||
|
||||
ClipboardSpline spline = new ClipboardSpline(editSession, holder, interpol, transform, nodes.size());
|
||||
|
||||
if (dimensions.getBlockX() > dimensions.getBlockZ()) {
|
||||
if (dimensions.x() > dimensions.z()) {
|
||||
spline.setDirection(Vector2.at(0, 1));
|
||||
}
|
||||
|
||||
|
@ -179,13 +179,13 @@ public class RollbackDatabase extends AsyncNotifyQueue {
|
||||
}
|
||||
try (PreparedStatement stmt = connection.prepareStatement(stmtStr.formatted(this.prefix))) {
|
||||
stmt.setInt(1, (int) (minTime / 1000));
|
||||
stmt.setInt(2, pos1.getBlockX());
|
||||
stmt.setInt(3, pos2.getBlockX());
|
||||
stmt.setInt(4, pos1.getBlockZ());
|
||||
stmt.setInt(5, pos2.getBlockZ());
|
||||
stmt.setInt(2, pos1.x());
|
||||
stmt.setInt(3, pos2.x());
|
||||
stmt.setInt(4, pos1.z());
|
||||
stmt.setInt(5, pos2.z());
|
||||
// Keep 128 offset for backwards-compatibility
|
||||
stmt.setInt(6, pos1.getBlockY() - 128);
|
||||
stmt.setInt(7, pos2.getBlockY() - 128);
|
||||
stmt.setInt(6, pos1.y() - 128);
|
||||
stmt.setInt(7, pos2.y() - 128);
|
||||
if (uuid != null) {
|
||||
byte[] uuidBytes = toBytes(uuid);
|
||||
stmt.setBytes(8, uuidBytes);
|
||||
@ -210,13 +210,13 @@ public class RollbackDatabase extends AsyncNotifyQueue {
|
||||
.array();
|
||||
stmt.setBytes(1, uuidBytes);
|
||||
stmt.setInt(2, (int) (minTime / 1000));
|
||||
stmt.setInt(3, pos1.getBlockX());
|
||||
stmt.setInt(4, pos2.getBlockX());
|
||||
stmt.setInt(5, pos1.getBlockZ());
|
||||
stmt.setInt(6, pos2.getBlockZ());
|
||||
stmt.setInt(3, pos1.x());
|
||||
stmt.setInt(4, pos2.x());
|
||||
stmt.setInt(5, pos1.z());
|
||||
stmt.setInt(6, pos2.z());
|
||||
// Keep 128 offset for backwards-compatibility
|
||||
stmt.setInt(7, pos1.getBlockY() - 128);
|
||||
stmt.setInt(8, pos2.getBlockY() - 128);
|
||||
stmt.setInt(7, pos1.y() - 128);
|
||||
stmt.setInt(8, pos2.y() - 128);
|
||||
}
|
||||
}
|
||||
return count;
|
||||
@ -262,13 +262,13 @@ public class RollbackDatabase extends AsyncNotifyQueue {
|
||||
BlockVector3 pos1 = change.getMinimumPoint();
|
||||
BlockVector3 pos2 = change.getMaximumPoint();
|
||||
|
||||
stmt.setInt(4, pos1.getX());
|
||||
stmt.setInt(5, pos2.getX());
|
||||
stmt.setInt(6, pos1.getZ());
|
||||
stmt.setInt(7, pos2.getZ());
|
||||
stmt.setInt(4, pos1.x());
|
||||
stmt.setInt(5, pos2.x());
|
||||
stmt.setInt(6, pos1.z());
|
||||
stmt.setInt(7, pos2.z());
|
||||
// Keep 128 offset for backwards-compatibility
|
||||
stmt.setInt(8, pos1.getY() - 128);
|
||||
stmt.setInt(9, pos2.getY() - 128);
|
||||
stmt.setInt(8, pos1.y() - 128);
|
||||
stmt.setInt(9, pos2.y() - 128);
|
||||
stmt.setString(10, change.getCommand());
|
||||
stmt.setInt(11, change.size());
|
||||
stmt.executeUpdate();
|
||||
|
@ -24,7 +24,7 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
|
||||
|
||||
@Override
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block) throws WorldEditException {
|
||||
return getExtent().setBlock(location.getX() + dx, location.getY() + dy, location.getZ() + dz, block);
|
||||
return getExtent().setBlock(location.x() + dx, location.y() + dy, location.z() + dz, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,7 +49,7 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(BlockVector3 location) {
|
||||
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||
return getBlock(location.x(), location.y(), location.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,11 +64,11 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
|
||||
|
||||
@Override
|
||||
public final boolean contains(BlockVector3 p) {
|
||||
return contains(p.getBlockX(), p.getBlockY(), p.getBlockZ());
|
||||
return contains(p.x(), p.y(), p.z());
|
||||
}
|
||||
|
||||
public final boolean contains(BlockVector2 p) {
|
||||
return contains(p.getBlockX(), p.getBlockZ());
|
||||
return contains(p.x(), p.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -96,7 +96,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
return getBiomeType(position.getX(), position.getY(), position.getZ());
|
||||
return getBiomeType(position.x(), position.y(), position.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -112,7 +112,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
return getFullBlock(position.getX(), position.getY(), position.getZ());
|
||||
return getFullBlock(position.x(), position.y(), position.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,7 +128,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(BlockVector3 position) {
|
||||
return getBlock(position.getX(), position.getY(), position.getZ());
|
||||
return getBlock(position.x(), position.y(), position.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,7 +66,7 @@ public class HistoryExtent extends AbstractDelegateExtent {
|
||||
|
||||
@Override
|
||||
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
|
||||
return setBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block);
|
||||
return setBlock(location.x(), location.y(), location.z(), block);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@ -111,7 +111,7 @@ public class HistoryExtent extends AbstractDelegateExtent {
|
||||
public boolean setBiome(BlockVector3 position, BiomeType newBiome) {
|
||||
BiomeType oldBiome = this.getBiome(position);
|
||||
if (!oldBiome.getId().equals(newBiome.getId())) {
|
||||
this.changeSet.addBiomeChange(position.getBlockX(), position.getBlockY(), position.getBlockZ(), oldBiome, newBiome);
|
||||
this.changeSet.addBiomeChange(position.x(), position.y(), position.z(), oldBiome, newBiome);
|
||||
return getExtent().setBiome(position, newBiome);
|
||||
} else {
|
||||
return false;
|
||||
|
@ -373,12 +373,12 @@ public class LimitExtent extends AbstractDelegateExtent {
|
||||
size = ((Collection<BlockVector3>) positions).size();
|
||||
} else if (positions instanceof Region) {
|
||||
BlockVector3 dim = ((Region) positions).getDimensions();
|
||||
size = dim.getX() * dim.getY() * dim.getZ();
|
||||
size = dim.x() * dim.y() * dim.z();
|
||||
} else if (positions instanceof Extent) {
|
||||
BlockVector3 min = ((Extent) positions).getMinimumPoint();
|
||||
BlockVector3 max = ((Extent) positions).getMinimumPoint();
|
||||
BlockVector3 dim = max.subtract(min).add(BlockVector3.ONE);
|
||||
size = dim.getX() * dim.getY() * dim.getZ();
|
||||
size = dim.x() * dim.y() * dim.z();
|
||||
} else {
|
||||
ExtentFilterBlock block = new ExtentFilterBlock(this);
|
||||
for (BlockVector3 pos : positions) {
|
||||
|
@ -38,9 +38,9 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
if (min == null) {
|
||||
min = pos;
|
||||
}
|
||||
mutable.mutX(pos.getX() - min.getX());
|
||||
mutable.mutY(pos.getY() - min.getY());
|
||||
mutable.mutZ(pos.getZ() - min.getZ());
|
||||
mutable.mutX(pos.x() - min.x());
|
||||
mutable.mutY(pos.y() - min.y());
|
||||
mutable.mutZ(pos.z() - min.z());
|
||||
MutableVector3 tmp = new MutableVector3(transform.apply(mutable.toVector3()));
|
||||
return min.add(tmp.roundHalfUp().toBlockPoint());
|
||||
}
|
||||
@ -49,9 +49,9 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
if (min == null) {
|
||||
min = BlockVector3.at(x, y, z);
|
||||
}
|
||||
mutable.mutX(x - min.getX());
|
||||
mutable.mutY(y - min.getY());
|
||||
mutable.mutZ(z - min.getZ());
|
||||
mutable.mutX(x - min.x());
|
||||
mutable.mutY(y - min.y());
|
||||
mutable.mutZ(z - min.z());
|
||||
MutableVector3 tmp = new MutableVector3(transform.apply(mutable.toVector3()));
|
||||
return min.add(tmp.roundHalfUp().toBlockPoint());
|
||||
}
|
||||
@ -73,10 +73,10 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
mutable.mutX(position.getBlockX());
|
||||
mutable.mutZ(position.getBlockZ());
|
||||
mutable.mutY(position.getBlockY());
|
||||
return super.getBiome(getPos(mutable.getX(), mutable.getY(), mutable.getZ()));
|
||||
mutable.mutX(position.x());
|
||||
mutable.mutZ(position.z());
|
||||
mutable.mutY(position.y());
|
||||
return super.getBiome(getPos(mutable.x(), mutable.y(), mutable.z()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -92,10 +92,10 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
mutable.mutX(position.getBlockX());
|
||||
mutable.mutZ(position.getBlockZ());
|
||||
mutable.mutY(position.getBlockY());
|
||||
return super.setBiome(getPos(mutable.getX(), mutable.getY(), mutable.getZ()), biome);
|
||||
mutable.mutX(position.x());
|
||||
mutable.mutZ(position.z());
|
||||
mutable.mutY(position.y());
|
||||
return super.setBiome(getPos(mutable.x(), mutable.y(), mutable.z()), biome);
|
||||
}
|
||||
|
||||
public void setTransform(Transform transform) {
|
||||
|
@ -80,12 +80,12 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
|
||||
@Override
|
||||
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block)
|
||||
throws WorldEditException {
|
||||
return setBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block);
|
||||
return setBlock(location.x(), location.y(), location.z(), block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(BlockVector3 location) {
|
||||
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||
return getBlock(location.x(), location.y(), location.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,8 +41,8 @@ public class SourceMaskExtent extends TemporalExtent {
|
||||
|
||||
@Override
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block) throws WorldEditException {
|
||||
set(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block);
|
||||
return mask.test(location) && super.setBlock(location.getX(), location.getY(), location.getZ(), block);
|
||||
set(location.x(), location.y(), location.z(), block);
|
||||
return mask.test(location) && super.setBlock(location.x(), location.y(), location.z(), block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,7 +44,7 @@ public class TemporalExtent extends PassthroughExtent {
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(BlockVector3 position) {
|
||||
if (position.getX() == x && position.getY() == y && position.getZ() == z) {
|
||||
if (position.x() == x && position.y() == y && position.z() == z) {
|
||||
return block.toImmutableState();
|
||||
}
|
||||
return super.getBlock(position);
|
||||
@ -60,7 +60,7 @@ public class TemporalExtent extends PassthroughExtent {
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
if (position.getX() == x && position.getY() == y && position.getZ() == z) {
|
||||
if (position.x() == x && position.y() == y && position.z() == z) {
|
||||
if (block instanceof BaseBlock) {
|
||||
return (BaseBlock) block;
|
||||
} else {
|
||||
@ -72,7 +72,7 @@ public class TemporalExtent extends PassthroughExtent {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
if (position.getX() == bx && position.getZ() == bz) {
|
||||
if (position.x() == bx && position.z() == bz) {
|
||||
return biome;
|
||||
}
|
||||
return super.getBiome(position);
|
||||
|
@ -55,13 +55,13 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
if (min == null) {
|
||||
min = pos;
|
||||
}
|
||||
mutable1.mutX(pos.getX() - min.getX());
|
||||
mutable1.mutY(pos.getY() - min.getY());
|
||||
mutable1.mutZ(pos.getZ() - min.getZ());
|
||||
mutable1.mutX(pos.x() - min.x());
|
||||
mutable1.mutY(pos.y() - min.y());
|
||||
mutable1.mutZ(pos.z() - min.z());
|
||||
Vector3 tmp = getTransform().apply(mutable1);
|
||||
mutable2.mutX(tmp.getX() + min.getX());
|
||||
mutable2.mutY(tmp.getY() + min.getY());
|
||||
mutable2.mutZ(tmp.getZ() + min.getZ());
|
||||
mutable2.mutX(tmp.x() + min.x());
|
||||
mutable2.mutY(tmp.y() + min.y());
|
||||
mutable2.mutZ(tmp.z() + min.z());
|
||||
return mutable2;
|
||||
}
|
||||
|
||||
@ -69,20 +69,20 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
if (min == null) {
|
||||
min = BlockVector3.at(x, y, z);
|
||||
}
|
||||
mutable1.mutX(x - min.getX());
|
||||
mutable1.mutY(y - min.getY());
|
||||
mutable1.mutZ(z - min.getZ());
|
||||
mutable1.mutX(x - min.x());
|
||||
mutable1.mutY(y - min.y());
|
||||
mutable1.mutZ(z - min.z());
|
||||
Vector3 tmp = getTransform().apply(mutable1);
|
||||
mutable2.mutX(tmp.getX() + min.getX());
|
||||
mutable2.mutY(tmp.getY() + min.getY());
|
||||
mutable2.mutZ(tmp.getZ() + min.getZ());
|
||||
mutable2.mutX(tmp.x() + min.x());
|
||||
mutable2.mutY(tmp.y() + min.y());
|
||||
mutable2.mutZ(tmp.z() + min.z());
|
||||
return tmp.toBlockPoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(int x, int y, int z) {
|
||||
BlockVector3 p = getPos(x, y, z);
|
||||
return transform(super.getBlock(p.getX(), p.getY(), p.getZ()));
|
||||
return transform(super.getBlock(p.x(), p.y(), p.z()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,7 +93,7 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
@Override
|
||||
public BiomeType getBiomeType(int x, int y, int z) {
|
||||
BlockVector3 p = getPos(x, y, z);
|
||||
return super.getBiomeType(p.getX(), y, p.getZ());
|
||||
return super.getBiomeType(p.x(), y, p.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -114,7 +114,7 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
@Override
|
||||
public boolean setBiome(int x, int y, int z, BiomeType biome) {
|
||||
BlockVector3 p = getPos(x, y, z);
|
||||
return super.setBiome(p.getX(), p.getY(), p.getZ(), biome);
|
||||
return super.setBiome(p.x(), p.y(), p.z(), biome);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class CPUOptimizedClipboard extends LinearClipboard {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
|
||||
return setBiome(position.x(), position.y(), position.z(), biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -92,7 +92,7 @@ public class CPUOptimizedClipboard extends LinearClipboard {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
return getBiome(getBiomeIndex(position.getX(), position.getY(), position.getZ()));
|
||||
return getBiome(getBiomeIndex(position.x(), position.y(), position.z()));
|
||||
}
|
||||
|
||||
public void convertTilesToIndex() {
|
||||
|
@ -359,7 +359,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
|
||||
return setBiome(position.x(), position.y(), position.z(), biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -417,7 +417,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
return getBiome(getBiomeIndex(position.getX(), position.getY(), position.getZ()));
|
||||
return getBiome(getBiomeIndex(position.x(), position.y(), position.z()));
|
||||
}
|
||||
|
||||
public BlockArrayClipboard toClipboard() {
|
||||
@ -438,9 +438,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
super.setOrigin(origin);
|
||||
origin = origin.subtract(offset);
|
||||
try {
|
||||
byteBuffer.putShort(10, (short) origin.getBlockX());
|
||||
byteBuffer.putShort(12, (short) origin.getBlockY());
|
||||
byteBuffer.putShort(14, (short) origin.getBlockZ());
|
||||
byteBuffer.putShort(10, (short) origin.x());
|
||||
byteBuffer.putShort(12, (short) origin.y());
|
||||
byteBuffer.putShort(14, (short) origin.z());
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -450,9 +450,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
protected void setOffset(BlockVector3 offset) {
|
||||
super.setOffset(offset);
|
||||
try {
|
||||
byteBuffer.putShort(16, (short) offset.getBlockX());
|
||||
byteBuffer.putShort(18, (short) offset.getBlockY());
|
||||
byteBuffer.putShort(20, (short) offset.getBlockZ());
|
||||
byteBuffer.putShort(16, (short) offset.x());
|
||||
byteBuffer.putShort(18, (short) offset.y());
|
||||
byteBuffer.putShort(20, (short) offset.z());
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -588,9 +588,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
CompoundTag data = entity.getState().getNbtData();
|
||||
HashMap<String, Tag> value = new HashMap<>(data.getValue());
|
||||
List<DoubleTag> pos = new ArrayList<>(3);
|
||||
pos.add(new DoubleTag(entity.getLocation().getX()));
|
||||
pos.add(new DoubleTag(entity.getLocation().getX()));
|
||||
pos.add(new DoubleTag(entity.getLocation().getX()));
|
||||
pos.add(new DoubleTag(entity.getLocation().x()));
|
||||
pos.add(new DoubleTag(entity.getLocation().x()));
|
||||
pos.add(new DoubleTag(entity.getLocation().x()));
|
||||
value.put("Pos", new ListTag(DoubleTag.class, pos));
|
||||
nbtOS.writeTag(new CompoundTag(value));
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class MemoryOptimizedClipboard extends LinearClipboard {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
|
||||
return setBiome(position.x(), position.y(), position.z(), biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -115,7 +115,7 @@ public class MemoryOptimizedClipboard extends LinearClipboard {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
return getBiome(getBiomeIndex(position.getX(), position.getY(), position.getZ()));
|
||||
return getBiome(getBiomeIndex(position.x(), position.y(), position.z()));
|
||||
}
|
||||
|
||||
private int getOrdinal(int index) {
|
||||
|
@ -70,17 +70,17 @@ public abstract class SimpleClipboard implements Clipboard {
|
||||
|
||||
@Override
|
||||
public final int getWidth() {
|
||||
return size.getBlockX();
|
||||
return size.x();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getHeight() {
|
||||
return size.getBlockY();
|
||||
return size.y();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getLength() {
|
||||
return size.getBlockZ();
|
||||
return size.z();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +56,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector3 position) {
|
||||
return getExtent().getBiomeType(position.getX(), position.getY(), position.getZ());
|
||||
return getExtent().getBiomeType(position.x(), position.y(), position.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -396,8 +396,8 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
int locY = loc.getBlockY();
|
||||
int locZ = loc.getBlockZ();
|
||||
BlockVector3 max = min.add(dimensions).subtract(BlockVector3.ONE);
|
||||
if (locX < min.getX() || locY < min.getY() || locZ < min.getZ()
|
||||
|| locX > max.getX() || locY > max.getY() || locZ > max.getZ()) {
|
||||
if (locX < min.x() || locY < min.y() || locZ < min.z()
|
||||
|| locX > max.x() || locY > max.y() || locZ > max.z()) {
|
||||
for (Entity e : clipboard.getEntities()) {
|
||||
clipboard.removeEntity(e);
|
||||
}
|
||||
|
@ -114,15 +114,15 @@ public class FastSchematicWriter implements ClipboardWriter {
|
||||
|
||||
// The Sponge format Offset refers to the 'min' points location in the world. That's our 'Origin'
|
||||
out.writeNamedTag("Offset", new int[]{
|
||||
min.getBlockX(),
|
||||
min.getBlockY(),
|
||||
min.getBlockZ(),
|
||||
min.x(),
|
||||
min.y(),
|
||||
min.z(),
|
||||
});
|
||||
|
||||
out.writeLazyCompoundTag("Metadata", out1 -> {
|
||||
out1.writeNamedTag("WEOffsetX", offset.getBlockX());
|
||||
out1.writeNamedTag("WEOffsetY", offset.getBlockY());
|
||||
out1.writeNamedTag("WEOffsetZ", offset.getBlockZ());
|
||||
out1.writeNamedTag("WEOffsetX", offset.x());
|
||||
out1.writeNamedTag("WEOffsetY", offset.y());
|
||||
out1.writeNamedTag("WEOffsetZ", offset.z());
|
||||
out1.writeNamedTag("FAWEVersion", Fawe.instance().getVersion().build);
|
||||
});
|
||||
|
||||
@ -162,9 +162,9 @@ public class FastSchematicWriter implements ClipboardWriter {
|
||||
// Dum.
|
||||
values.remove("id");
|
||||
values.put("Pos", new IntArrayTag(new int[]{
|
||||
pos.getX(),
|
||||
pos.getY(),
|
||||
pos.getZ()
|
||||
pos.x(),
|
||||
pos.y(),
|
||||
pos.z()
|
||||
}));
|
||||
numTiles++;
|
||||
|
||||
@ -282,10 +282,10 @@ public class FastSchematicWriter implements ClipboardWriter {
|
||||
int length = clipboard.getRegion().getLength();
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
for (int z = 0, i = 0; z < length; z++) {
|
||||
int z0 = min.getBlockZ() + z;
|
||||
int z0 = min.z() + z;
|
||||
for (int x = 0; x < width; x++, i++) {
|
||||
int x0 = min.getBlockX() + x;
|
||||
BiomeType biome = clipboard.getBiome(mutable.setComponents(x0, min.getY(), z0));
|
||||
int x0 = min.x() + x;
|
||||
BiomeType biome = clipboard.getBiome(mutable.setComponents(x0, min.y(), z0));
|
||||
task.applyInt(i, biome.getInternalId());
|
||||
}
|
||||
}
|
||||
|
@ -213,8 +213,8 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
|
||||
if (block.getBlockType() != BlockTypes.STRUCTURE_VOID) {
|
||||
int combined = block.getInternalId();
|
||||
int index = indexes.get(combined);
|
||||
List<Integer> pos = Arrays.asList(point.getX() - min.getX(),
|
||||
point.getY() - min.getY(), point.getZ() - min.getZ()
|
||||
List<Integer> pos = Arrays.asList(point.x() - min.x(),
|
||||
point.y() - min.y(), point.z() - min.z()
|
||||
);
|
||||
if (!block.hasNbtData()) {
|
||||
blocks.add(FaweCache.INSTANCE.asMap("state", index, "pos", pos));
|
||||
@ -231,7 +231,7 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
|
||||
ArrayList<Map<String, Object>> entities = new ArrayList<>();
|
||||
for (Entity entity : clipboard.getEntities()) {
|
||||
Location loc = entity.getLocation();
|
||||
List<Double> pos = Arrays.asList(loc.getX(), loc.getY(), loc.getZ());
|
||||
List<Double> pos = Arrays.asList(loc.x(), loc.y(), loc.z());
|
||||
List<Integer> blockPos = Arrays.asList(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||
BaseEntity state = entity.getState();
|
||||
if (state != null) {
|
||||
|
@ -75,9 +75,9 @@ public class PNGWriter implements ClipboardWriter {
|
||||
MutableBlockVector3 mutableLeft = new MutableBlockVector3(0, 0, 0);
|
||||
|
||||
BlockVector3 min = clipboard.getMinimumPoint();
|
||||
int y0 = min.getBlockY();
|
||||
int z0 = min.getBlockZ();
|
||||
int x0 = min.getBlockX();
|
||||
int y0 = min.y();
|
||||
int z0 = min.z();
|
||||
int x0 = min.x();
|
||||
for (int x = x0; x < x0 + width; x++) {
|
||||
mutable.mutX(x);
|
||||
mutableTop.mutX(x);
|
||||
|
@ -20,7 +20,7 @@ public class ArrayImageMask implements FilterBlockMask {
|
||||
|
||||
@Override
|
||||
public boolean applyBlock(FilterBlock block) {
|
||||
int height = image.getRGB(block.getX(), block.getZ()) & 0xFF;
|
||||
int height = image.getRGB(block.x(), block.z()) & 0xFF;
|
||||
return height == 255 || height > 0 && !white && random.nextInt(256) <= height;
|
||||
}
|
||||
|
||||
|
@ -83,18 +83,18 @@ public abstract class AbstractSingleFilterBlock extends FilterBlock {
|
||||
|
||||
@Override
|
||||
public BlockVector3 getMinimumPoint() {
|
||||
return at(getX(), getY(), getZ());
|
||||
return at(x(), y(), z());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockVector3 getMaximumPoint() {
|
||||
return at(getX(), getY(), getZ());
|
||||
return at(x(), y(), z());
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
|
||||
throws WorldEditException {
|
||||
if (x == this.getX() && y == this.getY() && z == this.getZ()) {
|
||||
if (x == this.x() && y == this.y() && z == this.z()) {
|
||||
setFullBlock(block.toBaseBlock());
|
||||
return true;
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ public class EntityInBlockRemovingProcessor implements IBatchProcessor {
|
||||
continue;
|
||||
}
|
||||
BlockVector3 pos = tag.getEntityPosition().toBlockPoint();
|
||||
int x = pos.getX() & 15;
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ() & 15;
|
||||
int x = pos.x() & 15;
|
||||
int y = pos.y();
|
||||
int z = pos.z() & 15;
|
||||
if (!set.hasSection(y >> 4)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -273,9 +273,9 @@ public class NMSRelighter implements Relighter {
|
||||
int lightLevel = (int) val[1];
|
||||
|
||||
this.computeRemoveBlockLight(
|
||||
node.getX() - 1,
|
||||
node.getY(),
|
||||
node.getZ(),
|
||||
node.x() - 1,
|
||||
node.y(),
|
||||
node.z(),
|
||||
lightLevel,
|
||||
lightRemovalQueue,
|
||||
lightPropagationQueue,
|
||||
@ -283,20 +283,20 @@ public class NMSRelighter implements Relighter {
|
||||
visited
|
||||
);
|
||||
this.computeRemoveBlockLight(
|
||||
node.getX() + 1,
|
||||
node.getY(),
|
||||
node.getZ(),
|
||||
node.x() + 1,
|
||||
node.y(),
|
||||
node.z(),
|
||||
lightLevel,
|
||||
lightRemovalQueue,
|
||||
lightPropagationQueue,
|
||||
removalVisited,
|
||||
visited
|
||||
);
|
||||
if (node.getY() > minY) {
|
||||
if (node.y() > minY) {
|
||||
this.computeRemoveBlockLight(
|
||||
node.getX(),
|
||||
node.getY() - 1,
|
||||
node.getZ(),
|
||||
node.x(),
|
||||
node.y() - 1,
|
||||
node.z(),
|
||||
lightLevel,
|
||||
lightRemovalQueue,
|
||||
lightPropagationQueue,
|
||||
@ -304,11 +304,11 @@ public class NMSRelighter implements Relighter {
|
||||
visited
|
||||
);
|
||||
}
|
||||
if (node.getY() < maxY) {
|
||||
if (node.y() < maxY) {
|
||||
this.computeRemoveBlockLight(
|
||||
node.getX(),
|
||||
node.getY() + 1,
|
||||
node.getZ(),
|
||||
node.x(),
|
||||
node.y() + 1,
|
||||
node.z(),
|
||||
lightLevel,
|
||||
lightRemovalQueue,
|
||||
lightPropagationQueue,
|
||||
@ -317,9 +317,9 @@ public class NMSRelighter implements Relighter {
|
||||
);
|
||||
}
|
||||
this.computeRemoveBlockLight(
|
||||
node.getX(),
|
||||
node.getY(),
|
||||
node.getZ() - 1,
|
||||
node.x(),
|
||||
node.y(),
|
||||
node.z() - 1,
|
||||
lightLevel,
|
||||
lightRemovalQueue,
|
||||
lightPropagationQueue,
|
||||
@ -327,9 +327,9 @@ public class NMSRelighter implements Relighter {
|
||||
visited
|
||||
);
|
||||
this.computeRemoveBlockLight(
|
||||
node.getX(),
|
||||
node.getY(),
|
||||
node.getZ() + 1,
|
||||
node.x(),
|
||||
node.y(),
|
||||
node.z() + 1,
|
||||
lightLevel,
|
||||
lightRemovalQueue,
|
||||
lightPropagationQueue,
|
||||
@ -340,27 +340,27 @@ public class NMSRelighter implements Relighter {
|
||||
|
||||
while (!lightPropagationQueue.isEmpty()) {
|
||||
MutableBlockVector3 node = lightPropagationQueue.poll();
|
||||
ChunkHolder<?> iChunk = (ChunkHolder<?>) queue.getOrCreateChunk(node.getX() >> 4, node.getZ() >> 4);
|
||||
ChunkHolder<?> iChunk = (ChunkHolder<?>) queue.getOrCreateChunk(node.x() >> 4, node.z() >> 4);
|
||||
if (!iChunk.isInit()) {
|
||||
iChunk.init(queue, node.getX() >> 4, node.getZ() >> 4);
|
||||
iChunk.init(queue, node.x() >> 4, node.z() >> 4);
|
||||
}
|
||||
int lightLevel = iChunk.getEmittedLight(node.getX() & 15, node.getY(), node.getZ() & 15);
|
||||
BlockState state = this.queue.getBlock(node.getX(), node.getY(), node.getZ());
|
||||
int lightLevel = iChunk.getEmittedLight(node.x() & 15, node.y(), node.z() & 15);
|
||||
BlockState state = this.queue.getBlock(node.x(), node.y(), node.z());
|
||||
String id = state.getBlockType().getId().toLowerCase(Locale.ROOT);
|
||||
if (lightLevel <= 1) {
|
||||
continue;
|
||||
}
|
||||
if (id.contains("slab")) {
|
||||
boolean top = state.getState(slabHalf).equalsIgnoreCase("top");
|
||||
computeSlab(node.getX(), node.getY(), node.getZ(), lightLevel, lightPropagationQueue, visited, top);
|
||||
computeSlab(node.x(), node.y(), node.z(), lightLevel, lightPropagationQueue, visited, top);
|
||||
} else if (id.contains("stair")) {
|
||||
boolean top = state.getState(stairHalf).equalsIgnoreCase("top");
|
||||
Direction direction = getStairDir(state);
|
||||
String shape = getStairShape(state);
|
||||
computeStair(
|
||||
node.getX(),
|
||||
node.getY(),
|
||||
node.getZ(),
|
||||
node.x(),
|
||||
node.y(),
|
||||
node.z(),
|
||||
lightLevel,
|
||||
lightPropagationQueue,
|
||||
visited,
|
||||
@ -369,7 +369,7 @@ public class NMSRelighter implements Relighter {
|
||||
shape
|
||||
);
|
||||
} else {
|
||||
computeNormal(node.getX(), node.getY(), node.getZ(), lightLevel, lightPropagationQueue, visited);
|
||||
computeNormal(node.x(), node.y(), node.z(), lightLevel, lightPropagationQueue, visited);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ public class OffsetTransform extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector3 location, BiomeType biome) {
|
||||
int x = location.getX() + dx;
|
||||
int y = location.getX() + dy;
|
||||
int z = location.getX() + dz;
|
||||
int x = location.x() + dx;
|
||||
int y = location.x() + dy;
|
||||
int z = location.x() + dz;
|
||||
if (!getExtent().contains(x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
@ -53,9 +53,9 @@ public class OffsetTransform extends ResettableExtent {
|
||||
@Override
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block)
|
||||
throws WorldEditException {
|
||||
int x = location.getX() + dx;
|
||||
int y = location.getX() + dy;
|
||||
int z = location.getX() + dz;
|
||||
int x = location.x() + dx;
|
||||
int y = location.x() + dy;
|
||||
int z = location.x() + dz;
|
||||
if (!getExtent().contains(x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -34,9 +34,9 @@ public class RandomOffsetTransform extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
int x = position.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
|
||||
int y = position.getBlockY() + random.nextInt(1 + (dy << 1)) - dy;
|
||||
int z = position.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
|
||||
int x = position.x() + random.nextInt(1 + (dx << 1)) - dx;
|
||||
int y = position.y() + random.nextInt(1 + (dy << 1)) - dy;
|
||||
int z = position.z() + random.nextInt(1 + (dz << 1)) - dz;
|
||||
if (!getExtent().contains(x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
@ -57,9 +57,9 @@ public class RandomOffsetTransform extends ResettableExtent {
|
||||
@Override
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 pos, T block)
|
||||
throws WorldEditException {
|
||||
int x = pos.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
|
||||
int y = pos.getBlockY() + random.nextInt(1 + (dy << 1)) - dy;
|
||||
int z = pos.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
|
||||
int x = pos.x() + random.nextInt(1 + (dx << 1)) - dx;
|
||||
int y = pos.y() + random.nextInt(1 + (dy << 1)) - dy;
|
||||
int z = pos.z() + random.nextInt(1 + (dz << 1)) - dz;
|
||||
if (!getExtent().contains(x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -55,9 +55,9 @@ public class ScaleTransform extends ResettableExtent {
|
||||
if (min == null) {
|
||||
min = pos;
|
||||
}
|
||||
mutable.mutX(min.getX() + (pos.getX() - min.getX()) * dx);
|
||||
mutable.mutY(min.getY() + (pos.getY() - min.getY()) * dy);
|
||||
mutable.mutZ(min.getZ() + (pos.getZ() - min.getZ()) * dz);
|
||||
mutable.mutX(min.x() + (pos.x() - min.x()) * dx);
|
||||
mutable.mutY(min.y() + (pos.y() - min.y()) * dy);
|
||||
mutable.mutZ(min.z() + (pos.z() - min.z()) * dz);
|
||||
return new MutableVector3(mutable);
|
||||
}
|
||||
|
||||
@ -65,9 +65,9 @@ public class ScaleTransform extends ResettableExtent {
|
||||
if (min == null) {
|
||||
min = BlockVector3.at(x, y, z);
|
||||
}
|
||||
mutable.mutX(min.getX() + (x - min.getX()) * dx);
|
||||
mutable.mutY(min.getY() + (y - min.getY()) * dy);
|
||||
mutable.mutZ(min.getZ() + (z - min.getZ()) * dz);
|
||||
mutable.mutX(min.x() + (x - min.x()) * dx);
|
||||
mutable.mutY(min.y() + (y - min.y()) * dy);
|
||||
mutable.mutZ(min.z() + (z - min.z()) * dz);
|
||||
return new MutableVector3(mutable);
|
||||
}
|
||||
|
||||
@ -77,15 +77,15 @@ public class ScaleTransform extends ResettableExtent {
|
||||
boolean result = false;
|
||||
MutableVector3 vector3 = getPos(location);
|
||||
MutableBlockVector3 pos = new MutableBlockVector3();
|
||||
double sx = vector3.getX();
|
||||
double sy = vector3.getY();
|
||||
double sz = vector3.getZ();
|
||||
double sx = vector3.x();
|
||||
double sy = vector3.y();
|
||||
double sz = vector3.z();
|
||||
double ex = sx + dx;
|
||||
double ey = Math.max(minY, Math.min(maxy, sy + dy));
|
||||
double ez = sz + dz;
|
||||
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
|
||||
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
|
||||
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
|
||||
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
|
||||
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
|
||||
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
|
||||
if (!getExtent().contains(pos)) {
|
||||
continue;
|
||||
}
|
||||
@ -101,15 +101,15 @@ public class ScaleTransform extends ResettableExtent {
|
||||
boolean result = false;
|
||||
MutableVector3 vector3 = getPos(position);
|
||||
MutableBlockVector3 pos = new MutableBlockVector3();
|
||||
double sx = vector3.getX();
|
||||
double sy = vector3.getY();
|
||||
double sz = vector3.getZ();
|
||||
double sx = vector3.x();
|
||||
double sy = vector3.y();
|
||||
double sz = vector3.z();
|
||||
double ex = sx + dx;
|
||||
double ey = Math.max(minY, Math.min(maxy, sy + dy));
|
||||
double ez = sz + dz;
|
||||
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
|
||||
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
|
||||
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
|
||||
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
|
||||
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
|
||||
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
|
||||
if (!getExtent().contains(pos)) {
|
||||
continue;
|
||||
}
|
||||
@ -126,15 +126,15 @@ public class ScaleTransform extends ResettableExtent {
|
||||
boolean result = false;
|
||||
MutableVector3 vector3 = getPos(x1, y1, z1);
|
||||
MutableBlockVector3 pos = new MutableBlockVector3();
|
||||
double sx = vector3.getX();
|
||||
double sy = vector3.getY();
|
||||
double sz = vector3.getZ();
|
||||
double ex = vector3.getX() + dx;
|
||||
double sx = vector3.x();
|
||||
double sy = vector3.y();
|
||||
double sz = vector3.z();
|
||||
double ex = vector3.x() + dx;
|
||||
double ey = Math.min(maxy, sy + dy);
|
||||
double ez = vector3.getZ() + dz;
|
||||
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
|
||||
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
|
||||
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
|
||||
double ez = vector3.z() + dz;
|
||||
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
|
||||
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
|
||||
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
|
||||
if (!getExtent().contains(pos)) {
|
||||
continue;
|
||||
}
|
||||
@ -150,15 +150,15 @@ public class ScaleTransform extends ResettableExtent {
|
||||
boolean result = false;
|
||||
MutableVector3 vector3 = getPos(x1, y1, z1);
|
||||
MutableBlockVector3 pos = new MutableBlockVector3();
|
||||
double sx = vector3.getX();
|
||||
double sy = vector3.getY();
|
||||
double sz = vector3.getZ();
|
||||
double sx = vector3.x();
|
||||
double sy = vector3.y();
|
||||
double sz = vector3.z();
|
||||
double ex = sx + dx;
|
||||
double ey = Math.max(minY, Math.min(maxy, sy + dy));
|
||||
double ez = sz + dz;
|
||||
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
|
||||
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
|
||||
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
|
||||
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
|
||||
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
|
||||
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
|
||||
if (!getExtent().contains(pos)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -27,11 +27,11 @@ public abstract class SelectTransform extends ResettableExtent {
|
||||
public abstract AbstractDelegateExtent getExtent(int x, int z);
|
||||
|
||||
public Extent getExtent(BlockVector3 pos) {
|
||||
return getExtent(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
return getExtent(pos.x(), pos.y(), pos.z());
|
||||
}
|
||||
|
||||
public Extent getExtent(BlockVector2 pos) {
|
||||
return getExtent(pos.getBlockX(), pos.getBlockZ());
|
||||
return getExtent(pos.x(), pos.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,8 +26,8 @@ public class SurfaceRegionFunction implements FlatRegionFunction {
|
||||
|
||||
@Override
|
||||
public boolean apply(BlockVector2 position) throws WorldEditException {
|
||||
int x = position.getBlockX();
|
||||
int z = position.getBlockZ();
|
||||
int x = position.x();
|
||||
int z = position.z();
|
||||
int layer = extent.getNearestSurfaceTerrainBlock(x, z, lastY, minY, maxY, false);
|
||||
if (layer != -1) {
|
||||
lastY = layer;
|
||||
|
@ -21,11 +21,11 @@ public class BiomeCopy implements RegionFunction {
|
||||
|
||||
@Override
|
||||
public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
int x = position.getBlockX();
|
||||
int y = position.getBlockY();
|
||||
int z = position.getBlockZ();
|
||||
if (x != mutableVector.getBlockX() || z != mutableVector.getBlockZ() || y != mutableVector
|
||||
.getBlockY()) {
|
||||
int x = position.x();
|
||||
int y = position.y();
|
||||
int z = position.z();
|
||||
if (x != mutableVector.x() || z != mutableVector.z() || y != mutableVector
|
||||
.y()) {
|
||||
mutableVector.setComponents(x, y, z);
|
||||
return destination.setBiome(mutableVector, source.getBiome(mutableVector));
|
||||
}
|
||||
|
@ -72,8 +72,8 @@ public class CavesGen extends GenBase {
|
||||
int maxAngle,
|
||||
double paramDouble4
|
||||
) throws WorldEditException {
|
||||
int bx = chunkPos.getBlockX() << 4;
|
||||
int bz = chunkPos.getBlockZ() << 4;
|
||||
int bx = chunkPos.x() << 4;
|
||||
int bz = chunkPos.z() << 4;
|
||||
double real_x = bx + 7;
|
||||
double real_z = bz + 7;
|
||||
|
||||
|
@ -26,8 +26,8 @@ public abstract class GenBase {
|
||||
|
||||
public void generate(BlockVector2 chunkPos, Extent chunk) throws WorldEditException {
|
||||
int i = this.checkAreaSize;
|
||||
int chunkX = chunkPos.getBlockX();
|
||||
int chunkZ = chunkPos.getBlockZ();
|
||||
int chunkX = chunkPos.x();
|
||||
int chunkZ = chunkPos.z();
|
||||
for (int x = chunkX - i; x <= chunkX + i; x++) {
|
||||
for (int z = chunkZ - i; z <= chunkZ + i; z++) {
|
||||
generateChunk(x, z, chunkPos, chunk);
|
||||
|
@ -36,7 +36,7 @@ public class SchemGen implements Resource {
|
||||
int y = extent.getNearestSurfaceTerrainBlock(
|
||||
x,
|
||||
z,
|
||||
mutable.getBlockY(),
|
||||
mutable.y(),
|
||||
this.extent.getMinY(),
|
||||
this.extent.getMaxY(),
|
||||
Integer.MIN_VALUE,
|
||||
|
@ -44,9 +44,9 @@ public class AdjacentAnyMask extends AbstractMask implements ResettableMask {
|
||||
}
|
||||
|
||||
public BlockVector3 direction(BlockVector3 v) {
|
||||
int x = v.getBlockX();
|
||||
int y = v.getBlockY();
|
||||
int z = v.getBlockZ();
|
||||
int x = v.x();
|
||||
int y = v.y();
|
||||
int z = v.z();
|
||||
if (mask.test(mutable.setComponents(x + 1, y, z))) {
|
||||
return mutable.setComponents(1, 0, 0);
|
||||
} else if (mask.test(mutable.setComponents(x - 1, y, z))) {
|
||||
|
@ -22,9 +22,9 @@ public class AdjacentMask extends AbstractMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 bv) {
|
||||
vector.setComponents(bv);
|
||||
double x = bv.getX();
|
||||
double y = bv.getY();
|
||||
double z = bv.getZ();
|
||||
double x = bv.x();
|
||||
double y = bv.y();
|
||||
double z = bv.z();
|
||||
vector.mutX(x + 1);
|
||||
int count = 0;
|
||||
if (mask.test(vector) && ++count == min && max >= 8) {
|
||||
|
@ -127,9 +127,9 @@ public class AngleMask extends AbstractExtentMask implements ResettableMask {
|
||||
}
|
||||
|
||||
private boolean adjacentAir(Extent extent, MutableBlockVector3 mutable) {
|
||||
int x = mutable.getBlockX();
|
||||
int y = mutable.getBlockY();
|
||||
int z = mutable.getBlockZ();
|
||||
int x = mutable.x();
|
||||
int y = mutable.y();
|
||||
int z = mutable.z();
|
||||
if (!mask.test(extent, mutable.setComponents(x + 1, y, z))) {
|
||||
return true;
|
||||
}
|
||||
@ -154,23 +154,23 @@ public class AngleMask extends AbstractExtentMask implements ResettableMask {
|
||||
if (!mask.test(vector)) {
|
||||
return false;
|
||||
}
|
||||
int y = vector.getBlockY();
|
||||
int y = vector.y();
|
||||
if (overlay) {
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3(vector);
|
||||
if (y < maxY && !adjacentAir(null, mutable)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int x = vector.getBlockX();
|
||||
int z = vector.getBlockZ();
|
||||
int x = vector.x();
|
||||
int z = vector.z();
|
||||
return testSlope(getExtent(), x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(final Extent extent, final BlockVector3 vector) {
|
||||
int x = vector.getBlockX();
|
||||
int y = vector.getBlockY();
|
||||
int z = vector.getBlockZ();
|
||||
int x = vector.x();
|
||||
int y = vector.y();
|
||||
int z = vector.z();
|
||||
|
||||
if ((lastX == (lastX = x) & lastZ == (lastZ = z))) {
|
||||
int height = getHeight(extent, x, y, z);
|
||||
|
@ -60,9 +60,9 @@ public class CachedMask extends AbstractDelegateMask implements ResettableMask {
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
int x = vector.getX();
|
||||
int y = vector.getY();
|
||||
int z = vector.getZ();
|
||||
int x = vector.x();
|
||||
int y = vector.y();
|
||||
int z = vector.z();
|
||||
try {
|
||||
boolean check = cache_checked.add(x, y, z);
|
||||
if (!check) {
|
||||
@ -88,9 +88,9 @@ public class CachedMask extends AbstractDelegateMask implements ResettableMask {
|
||||
if (!hasExtent || !(extent instanceof AbstractExtentMask)) {
|
||||
return test(vector);
|
||||
}
|
||||
int x = vector.getX();
|
||||
int y = vector.getY();
|
||||
int z = vector.getZ();
|
||||
int x = vector.x();
|
||||
int y = vector.y();
|
||||
int z = vector.z();
|
||||
AbstractExtentMask mask = (AbstractExtentMask) getMask();
|
||||
try {
|
||||
boolean check = cache_checked.add(x, y, z);
|
||||
|
@ -62,17 +62,17 @@ public class ImageBrushMask extends AbstractExtentMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (solid.test(vector)) {
|
||||
int dx = vector.getBlockX() - center.getBlockX();
|
||||
int dy = vector.getBlockY() - center.getBlockY();
|
||||
int dz = vector.getBlockZ() - center.getBlockZ();
|
||||
int dx = vector.x() - center.x();
|
||||
int dy = vector.y() - center.y();
|
||||
int dz = vector.z() - center.z();
|
||||
|
||||
Vector3 pos1 = transform.apply(mutable.setComponents(dx - 0.5, dy - 0.5, dz - 0.5));
|
||||
int x1 = (int) (pos1.getX() * scale + centerImageX);
|
||||
int z1 = (int) (pos1.getZ() * scale + centerImageZ);
|
||||
int x1 = (int) (pos1.x() * scale + centerImageX);
|
||||
int z1 = (int) (pos1.z() * scale + centerImageZ);
|
||||
|
||||
Vector3 pos2 = transform.apply(mutable.setComponents(dx + 0.5, dy + 0.5, dz + 0.5));
|
||||
int x2 = (int) (pos2.getX() * scale + centerImageX);
|
||||
int z2 = (int) (pos2.getZ() * scale + centerImageZ);
|
||||
int x2 = (int) (pos2.x() * scale + centerImageX);
|
||||
int z2 = (int) (pos2.z() * scale + centerImageZ);
|
||||
if (x2 < x1) {
|
||||
int tmp = x1;
|
||||
x1 = x2;
|
||||
|
@ -40,20 +40,20 @@ public class LayerBrushMask extends AbstractExtentMask {
|
||||
BlockState previous2 = layers[depth - 2];
|
||||
for (BlockVector3 dir : BreadthFirstSearch.DEFAULT_DIRECTIONS) {
|
||||
mutable.setComponents(
|
||||
pos.getBlockX() + dir.getBlockX(),
|
||||
pos.getBlockY() + dir.getBlockY(),
|
||||
pos.getBlockZ() + dir.getBlockZ()
|
||||
pos.x() + dir.x(),
|
||||
pos.y() + dir.y(),
|
||||
pos.z() + dir.z()
|
||||
);
|
||||
if (visitor.isVisited(mutable) && editSession.getBlock(
|
||||
mutable.getBlockX(),
|
||||
mutable.getBlockY(),
|
||||
mutable.getBlockZ()
|
||||
mutable.x(),
|
||||
mutable.y(),
|
||||
mutable.z()
|
||||
) == previous) {
|
||||
mutable.setComponents(pos.getBlockX() + dir.getBlockX() * 2, pos.getBlockY() + dir.getBlockY() * 2,
|
||||
pos.getBlockZ() + dir.getBlockZ() * 2
|
||||
mutable.setComponents(pos.x() + dir.x() * 2, pos.y() + dir.y() * 2,
|
||||
pos.z() + dir.z() * 2
|
||||
);
|
||||
if (visitor.isVisited(mutable)
|
||||
&& editSession.getBlock(mutable.getBlockX(), mutable.getBlockY(), mutable.getBlockZ()) == previous2) {
|
||||
&& editSession.getBlock(mutable.x(), mutable.y(), mutable.z()) == previous2) {
|
||||
found = true;
|
||||
break;
|
||||
} else {
|
||||
|
@ -15,9 +15,9 @@ public class PlaneMask extends AbstractMask implements ResettableMask {
|
||||
public boolean test(BlockVector3 vector) {
|
||||
switch (mode) {
|
||||
case -1:
|
||||
originX = vector.getBlockX();
|
||||
originY = vector.getBlockY();
|
||||
originZ = vector.getBlockZ();
|
||||
originX = vector.x();
|
||||
originY = vector.y();
|
||||
originZ = vector.z();
|
||||
mode = 0;
|
||||
return true;
|
||||
case 0:
|
||||
@ -25,13 +25,13 @@ public class PlaneMask extends AbstractMask implements ResettableMask {
|
||||
case 2:
|
||||
case 4:
|
||||
int original = mode;
|
||||
if (originX != vector.getBlockX()) {
|
||||
if (originX != vector.x()) {
|
||||
mode &= 1;
|
||||
}
|
||||
if (originY != vector.getBlockY()) {
|
||||
if (originY != vector.y()) {
|
||||
mode &= 2;
|
||||
}
|
||||
if (originZ != vector.getBlockZ()) {
|
||||
if (originZ != vector.z()) {
|
||||
mode &= 4;
|
||||
}
|
||||
if (Integer.bitCount(mode) >= 3) {
|
||||
@ -39,13 +39,13 @@ public class PlaneMask extends AbstractMask implements ResettableMask {
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
if (originX != vector.getBlockX() && (mode & 1) == 0) {
|
||||
if (originX != vector.x() && (mode & 1) == 0) {
|
||||
return false;
|
||||
}
|
||||
if (originZ != vector.getBlockZ() && (mode & 4) == 0) {
|
||||
if (originZ != vector.z() && (mode & 4) == 0) {
|
||||
return false;
|
||||
}
|
||||
return originY == vector.getBlockY() || (mode & 2) != 0;
|
||||
return originY == vector.y() || (mode & 2) != 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -30,17 +30,17 @@ public class RadiusMask extends AbstractMask implements ResettableMask {
|
||||
if (pos == null) {
|
||||
pos = to.toImmutable();
|
||||
}
|
||||
int dx = pos.getBlockX() - to.getBlockX();
|
||||
int dx = pos.x() - to.x();
|
||||
int d = dx * dx;
|
||||
if (d > maxSqr) {
|
||||
return false;
|
||||
}
|
||||
int dz = pos.getBlockZ() - to.getBlockZ();
|
||||
int dz = pos.z() - to.z();
|
||||
d += dz * dz;
|
||||
if (d > maxSqr) {
|
||||
return false;
|
||||
}
|
||||
int dy = pos.getBlockY() - to.getBlockY();
|
||||
int dy = pos.y() - to.y();
|
||||
d += dy * dy;
|
||||
return d >= minSqr && d <= maxSqr;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class SimplexMask extends AbstractMask {
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
double value = SimplexNoise.noise(vector.getBlockX() * scale, vector.getBlockY() * scale, vector.getBlockZ() * scale);
|
||||
double value = SimplexNoise.noise(vector.x() * scale, vector.y() * scale, vector.z() * scale);
|
||||
return value >= min && value <= max;
|
||||
}
|
||||
|
||||
|
@ -64,13 +64,13 @@ public class StencilBrushMask extends AbstractExtentMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (solid.test(vector)) {
|
||||
int dx = vector.getBlockX() - center.getBlockX();
|
||||
int dy = vector.getBlockY() - center.getBlockY();
|
||||
int dz = vector.getBlockZ() - center.getBlockZ();
|
||||
int dx = vector.x() - center.x();
|
||||
int dy = vector.y() - center.y();
|
||||
int dz = vector.z() - center.z();
|
||||
|
||||
Vector3 srcPos = transform.apply(mutable.setComponents(dx, dy, dz));
|
||||
dx = MathMan.roundInt(srcPos.getX());
|
||||
dz = MathMan.roundInt(srcPos.getZ());
|
||||
dx = MathMan.roundInt(srcPos.x());
|
||||
dz = MathMan.roundInt(srcPos.z());
|
||||
|
||||
int distance = dx * dx + dz * dz;
|
||||
if (distance > size2 || Math.abs(dx) > 256 || Math.abs(dz) > 256) {
|
||||
@ -83,7 +83,7 @@ public class StencilBrushMask extends AbstractExtentMask {
|
||||
return true;
|
||||
}
|
||||
if (val >= 255 || ThreadLocalRandom.current().nextInt(maxY) < val) {
|
||||
editSession.setBlock(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ(), pattern);
|
||||
editSession.setBlock(vector.x(), vector.y(), vector.z(), pattern);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class SurfaceAngleMask extends AbstractExtentMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (!vector.getBlock(getExtent()).isAir() && nextToAir(vector)) {
|
||||
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).getY();
|
||||
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).y();
|
||||
return (angle >= (min / 90.0) && angle <= (max / 90.0));
|
||||
}
|
||||
return false;
|
||||
@ -33,7 +33,7 @@ public class SurfaceAngleMask extends AbstractExtentMask {
|
||||
@Override
|
||||
public boolean test(Extent extent, BlockVector3 vector) {
|
||||
if (!vector.getBlock(getExtent()).isAir() && nextToAir(vector)) {
|
||||
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).getY();
|
||||
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).y();
|
||||
return (angle >= (min / 90.0) && angle <= (max / 90.0));
|
||||
}
|
||||
return false;
|
||||
@ -44,7 +44,7 @@ public class SurfaceAngleMask extends AbstractExtentMask {
|
||||
for (int i = -size; i <= size; i++) {
|
||||
for (int j = -size; j <= size; j++) {
|
||||
for (int k = -size; k <= size; k++) {
|
||||
Vector3 block = Vector3.at(currentLocation.getX(), currentLocation.getY(), currentLocation.getZ()).add(
|
||||
Vector3 block = Vector3.at(currentLocation.x(), currentLocation.y(), currentLocation.z()).add(
|
||||
0.5,
|
||||
0.5,
|
||||
0.5
|
||||
@ -65,13 +65,13 @@ public class SurfaceAngleMask extends AbstractExtentMask {
|
||||
double y = 0.0;
|
||||
double z = 0.0;
|
||||
for (Vector3 vector3 : airDirections) {
|
||||
x += vector3.getX();
|
||||
y += vector3.getY();
|
||||
z += vector3.getZ();
|
||||
x += vector3.x();
|
||||
y += vector3.y();
|
||||
z += vector3.z();
|
||||
}
|
||||
|
||||
Vector3 averageAirDirection = Vector3.at(x / airDirections.size(), y / airDirections.size(), z / airDirections.size());
|
||||
return (Double.isNaN(averageAirDirection.getY()) ? Vector3.ZERO : averageAirDirection.normalize());
|
||||
return (Double.isNaN(averageAirDirection.y()) ? Vector3.ZERO : averageAirDirection.normalize());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,8 +14,8 @@ public class WallMakeMask implements Mask {
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 position) {
|
||||
int x = position.getBlockX();
|
||||
int z = position.getBlockZ();
|
||||
int x = position.x();
|
||||
int z = position.z();
|
||||
return !region.contains(x, z + 1) || !region.contains(x, z - 1) || !region.contains(x + 1, z) || !region.contains(
|
||||
x - 1,
|
||||
z
|
||||
|
@ -23,9 +23,9 @@ public class WallMask extends AbstractMask {
|
||||
public boolean test(BlockVector3 bv) {
|
||||
vector.setComponents(bv);
|
||||
int count = 0;
|
||||
double x = vector.getX();
|
||||
double y = vector.getY();
|
||||
double z = vector.getZ();
|
||||
double x = vector.x();
|
||||
double y = vector.y();
|
||||
double z = vector.z();
|
||||
vector.mutX(x + 1);
|
||||
if (mask.test(vector) && ++count == min && max >= 8) {
|
||||
vector.mutX(x);
|
||||
|
@ -16,9 +16,9 @@ public class XAxisMask extends AbstractMask implements ResettableMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (layer == -1) {
|
||||
layer = vector.getBlockX();
|
||||
layer = vector.x();
|
||||
}
|
||||
return vector.getBlockX() == layer;
|
||||
return vector.x() == layer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,9 +14,9 @@ public class YAxisMask extends AbstractMask implements ResettableMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (layer == -1) {
|
||||
layer = vector.getBlockY();
|
||||
layer = vector.y();
|
||||
}
|
||||
return vector.getBlockY() == layer;
|
||||
return vector.y() == layer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,9 +14,9 @@ public class ZAxisMask extends AbstractMask implements ResettableMask {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (layer == -1) {
|
||||
layer = vector.getBlockZ();
|
||||
layer = vector.z();
|
||||
}
|
||||
return vector.getBlockZ() == layer;
|
||||
return vector.z() == layer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,9 +42,9 @@ public class AngleColorPattern extends AnglePattern {
|
||||
public <T extends BlockStateHolder<T>> int getSlope(T block, BlockVector3 vector, Extent extent) {
|
||||
int slope = super.getSlope(block, vector, extent);
|
||||
if (slope != -1) {
|
||||
int x = vector.getBlockX();
|
||||
int y = vector.getBlockY();
|
||||
int z = vector.getBlockZ();
|
||||
int x = vector.x();
|
||||
int y = vector.y();
|
||||
int z = vector.z();
|
||||
int height = extent.getNearestSurfaceTerrainBlock(x, z, y, minY, maxY);
|
||||
if (height > minY) {
|
||||
BlockState below = extent.getBlock(x, height - 1, z);
|
||||
|
@ -31,9 +31,9 @@ public abstract class AnglePattern extends AbstractPattern {
|
||||
}
|
||||
|
||||
public <T extends BlockStateHolder<T>> int getSlope(T block, BlockVector3 vector, Extent extent) {
|
||||
int x = vector.getBlockX();
|
||||
int y = vector.getBlockY();
|
||||
int z = vector.getBlockZ();
|
||||
int x = vector.x();
|
||||
int y = vector.y();
|
||||
int z = vector.z();
|
||||
if (!block.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class BufferedPattern2D extends BufferedPattern {
|
||||
|
||||
@Override
|
||||
public boolean set(BlockVector3 pos) {
|
||||
return set.add(pos.getBlockX(), 0, pos.getBlockY());
|
||||
return set.add(pos.x(), 0, pos.y());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class ExpressionPattern extends AbstractPattern {
|
||||
if (expression.getEnvironment() instanceof WorldEditExpressionEnvironment) {
|
||||
((WorldEditExpressionEnvironment) expression.getEnvironment()).setCurrentBlock(vector.toVector3());
|
||||
}
|
||||
double combined = expression.evaluate(vector.getX(), vector.getY(), vector.getZ());
|
||||
double combined = expression.evaluate(vector.x(), vector.y(), vector.z());
|
||||
return BlockState.getFromOrdinal((int) combined).toBaseBlock();
|
||||
} catch (EvaluationException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -37,7 +37,7 @@ public class Linear2DBlockPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
int index = (position.getBlockX() / this.xScale + position.getBlockZ() / this.zScale) % patternsArray.length;
|
||||
int index = (position.x() / this.xScale + position.z() / this.zScale) % patternsArray.length;
|
||||
if (index < 0) {
|
||||
index += patternsArray.length;
|
||||
}
|
||||
@ -46,8 +46,8 @@ public class Linear2DBlockPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
int index = (floorDiv(get.getBlockX(), this.xScale)
|
||||
+ floorDiv(get.getBlockZ(), this.zScale)) % patternsArray.length;
|
||||
int index = (floorDiv(get.x(), this.xScale)
|
||||
+ floorDiv(get.z(), this.zScale)) % patternsArray.length;
|
||||
if (index < 0) {
|
||||
index += patternsArray.length;
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ public class Linear3DBlockPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
int index = (position.getBlockX() / this.xScale
|
||||
+ position.getBlockY() / this.yScale + position.getBlockZ() / this.zScale) % patternsArray.length;
|
||||
int index = (position.x() / this.xScale
|
||||
+ position.y() / this.yScale + position.z() / this.zScale) % patternsArray.length;
|
||||
if (index < 0) {
|
||||
index += patternsArray.length;
|
||||
}
|
||||
@ -50,8 +50,8 @@ public class Linear3DBlockPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
int index = (floorDiv(get.getBlockX(), this.xScale)
|
||||
+ floorDiv(get.getBlockY(), this.yScale) + floorDiv(get.getBlockZ(), this.zScale)) % patternsArray.length;
|
||||
int index = (floorDiv(get.x(), this.xScale)
|
||||
+ floorDiv(get.y(), this.yScale) + floorDiv(get.z(), this.zScale)) % patternsArray.length;
|
||||
if (index < 0) {
|
||||
index += patternsArray.length;
|
||||
}
|
||||
|
@ -24,15 +24,15 @@ public class NoXPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 pos) {
|
||||
mutable.mutY(pos.getY());
|
||||
mutable.mutZ(pos.getZ());
|
||||
mutable.mutY(pos.y());
|
||||
mutable.mutZ(pos.z());
|
||||
return pattern.applyBlock(mutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
mutable.mutY(get.getY());
|
||||
mutable.mutZ(get.getZ());
|
||||
mutable.mutY(get.y());
|
||||
mutable.mutZ(get.z());
|
||||
return pattern.apply(extent, mutable, set);
|
||||
}
|
||||
|
||||
|
@ -24,15 +24,15 @@ public class NoYPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 pos) {
|
||||
mutable.mutX(pos.getX());
|
||||
mutable.mutZ(pos.getZ());
|
||||
mutable.mutX(pos.x());
|
||||
mutable.mutZ(pos.z());
|
||||
return pattern.applyBlock(mutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
mutable.mutX(get.getX());
|
||||
mutable.mutZ(get.getZ());
|
||||
mutable.mutX(get.x());
|
||||
mutable.mutZ(get.z());
|
||||
return pattern.apply(extent, mutable, set);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.fastasyncworldedit.core.function.pattern;
|
||||
|
||||
import com.fastasyncworldedit.core.math.MutableBlockVector3;
|
||||
import com.fastasyncworldedit.core.queue.Filter;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
@ -25,15 +24,15 @@ public class NoZPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 pos) {
|
||||
mutable.mutX(pos.getX());
|
||||
mutable.mutY(pos.getY());
|
||||
mutable.mutX(pos.x());
|
||||
mutable.mutY(pos.y());
|
||||
return pattern.applyBlock(mutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
mutable.mutX(get.getX());
|
||||
mutable.mutY(get.getY());
|
||||
mutable.mutX(get.x());
|
||||
mutable.mutY(get.y());
|
||||
return pattern.apply(extent, mutable, set);
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ public class OffsetPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
mutable.mutX(position.getX() + dx);
|
||||
mutable.mutY(position.getY() + dy);
|
||||
mutable.mutZ(position.getZ() + dz);
|
||||
if (mutable.getY() < minY || mutable.getY() > maxY) {
|
||||
mutable.mutX(position.x() + dx);
|
||||
mutable.mutY(position.y() + dy);
|
||||
mutable.mutZ(position.z() + dz);
|
||||
if (mutable.y() < minY || mutable.y() > maxY) {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
return pattern.applyBlock(mutable);
|
||||
@ -51,10 +51,10 @@ public class OffsetPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
mutable.mutX(get.getX() + dx);
|
||||
mutable.mutY(get.getY() + dy);
|
||||
mutable.mutZ(get.getZ() + dz);
|
||||
if (mutable.getY() < extent.getMinY() || mutable.getY() > extent.getMaxY()) {
|
||||
mutable.mutX(get.x() + dx);
|
||||
mutable.mutY(get.y() + dy);
|
||||
mutable.mutZ(get.z() + dz);
|
||||
if (mutable.y() < extent.getMinY() || mutable.y() > extent.getMaxY()) {
|
||||
return false;
|
||||
}
|
||||
return pattern.apply(extent, get, mutable);
|
||||
|
@ -52,10 +52,10 @@ public class RandomOffsetPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
mutable.mutX((position.getX() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((position.getY() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((position.getZ() + r.nextInt(dz2) - dz));
|
||||
if (mutable.getY() < minY || mutable.getY() > maxY) {
|
||||
mutable.mutX((position.x() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((position.y() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((position.z() + r.nextInt(dz2) - dz));
|
||||
if (mutable.y() < minY || mutable.y() > maxY) {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
return pattern.applyBlock(mutable);
|
||||
@ -63,10 +63,10 @@ public class RandomOffsetPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
mutable.mutX((set.getX() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((set.getY() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((set.getZ() + r.nextInt(dz2) - dz));
|
||||
if (mutable.getY() < extent.getMinY() || mutable.getY() > extent.getMaxY()) {
|
||||
mutable.mutX((set.x() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((set.y() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((set.z() + r.nextInt(dz2) - dz));
|
||||
if (mutable.y() < extent.getMinY() || mutable.y() > extent.getMaxY()) {
|
||||
return false;
|
||||
}
|
||||
return pattern.apply(extent, get, mutable);
|
||||
|
@ -35,10 +35,10 @@ public class RelativePattern extends AbstractPattern implements ResettablePatter
|
||||
if (origin == null) {
|
||||
origin = pos;
|
||||
}
|
||||
mutable.mutX(pos.getX() - origin.getX());
|
||||
mutable.mutY(pos.getY() - origin.getY());
|
||||
mutable.mutZ(pos.getZ() - origin.getZ());
|
||||
if (mutable.getY() < minY || mutable.getY() > maxY) {
|
||||
mutable.mutX(pos.x() - origin.x());
|
||||
mutable.mutY(pos.y() - origin.y());
|
||||
mutable.mutZ(pos.z() - origin.z());
|
||||
if (mutable.y() < minY || mutable.y() > maxY) {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
return pattern.applyBlock(mutable);
|
||||
@ -49,10 +49,10 @@ public class RelativePattern extends AbstractPattern implements ResettablePatter
|
||||
if (origin == null) {
|
||||
origin = set;
|
||||
}
|
||||
mutable.mutX(set.getX() - origin.getX());
|
||||
mutable.mutY(set.getY() - origin.getY());
|
||||
mutable.mutZ(set.getZ() - origin.getZ());
|
||||
if (mutable.getY() < extent.getMinY() || mutable.getY() > extent.getMaxY()) {
|
||||
mutable.mutX(set.x() - origin.x());
|
||||
mutable.mutY(set.y() - origin.y());
|
||||
mutable.mutZ(set.z() - origin.z());
|
||||
if (mutable.y() < extent.getMinY() || mutable.y() > extent.getMaxY()) {
|
||||
return false;
|
||||
}
|
||||
return pattern.apply(extent, get, mutable);
|
||||
|
@ -63,13 +63,13 @@ public class SolidRandomOffsetPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
mutable.mutX(position.getX() + r.nextInt(dx2) - dx);
|
||||
mutable.mutY(position.getY() + r.nextInt(dy2) - dy);
|
||||
mutable.mutZ(position.getZ() + r.nextInt(dz2) - dz);
|
||||
if (mutable.getY() < minY || mutable.getY() > maxY) {
|
||||
mutable.mutX(position.x() + r.nextInt(dx2) - dx);
|
||||
mutable.mutY(position.y() + r.nextInt(dy2) - dy);
|
||||
mutable.mutZ(position.z() + r.nextInt(dz2) - dz);
|
||||
if (mutable.y() < minY || mutable.y() > maxY) {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
if (mutable.getY() < minY || mutable.getY() > maxY) {
|
||||
if (mutable.y() < minY || mutable.y() > maxY) {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
BaseBlock block = pattern.applyBlock(mutable);
|
||||
@ -81,10 +81,10 @@ public class SolidRandomOffsetPattern extends AbstractPattern {
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
mutable.mutX(set.getX() + r.nextInt(dx2) - dx);
|
||||
mutable.mutY(set.getY() + r.nextInt(dy2) - dy);
|
||||
mutable.mutZ(set.getZ() + r.nextInt(dz2) - dz);
|
||||
if (mutable.getY() < extent.getMinY() || mutable.getY() > extent.getMaxY()) {
|
||||
mutable.mutX(set.x() + r.nextInt(dx2) - dx);
|
||||
mutable.mutY(set.y() + r.nextInt(dy2) - dy);
|
||||
mutable.mutZ(set.z() + r.nextInt(dz2) - dz);
|
||||
if (mutable.y() < extent.getMinY() || mutable.y() > extent.getMaxY()) {
|
||||
return false;
|
||||
}
|
||||
BaseBlock block = pattern.applyBlock(mutable);
|
||||
|
@ -62,9 +62,9 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
next = buffer[i];
|
||||
BlockVector3 dir = BreadthFirstSearch.DIAGONAL_DIRECTIONS[i];
|
||||
next.setComponents(
|
||||
cur.getBlockX() + dir.getBlockX(),
|
||||
cur.getBlockY() + dir.getBlockY(),
|
||||
cur.getBlockZ() + dir.getBlockZ()
|
||||
cur.x() + dir.x(),
|
||||
cur.y() + dir.y(),
|
||||
cur.z() + dir.z()
|
||||
);
|
||||
if (allowed(next)) {
|
||||
allowed[index++] = next;
|
||||
@ -74,7 +74,7 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
return cur;
|
||||
}
|
||||
next = allowed[ThreadLocalRandom.current().nextInt(index)];
|
||||
cur.setComponents(next.getBlockX(), next.getBlockY(), next.getBlockZ());
|
||||
cur.setComponents(next.x(), next.y(), next.z());
|
||||
}
|
||||
return cur;
|
||||
}
|
||||
@ -85,9 +85,9 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
if (!block.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
return false;
|
||||
}
|
||||
int x = v.getBlockX();
|
||||
int y = v.getBlockY();
|
||||
int z = v.getBlockZ();
|
||||
int x = v.x();
|
||||
int y = v.y();
|
||||
int z = v.z();
|
||||
v.mutY(y + 1);
|
||||
if (y < maxY && canPassthrough(v)) {
|
||||
v.mutY(y);
|
||||
|
@ -40,7 +40,7 @@ public class AboveVisitor extends RecursiveVisitor {
|
||||
|
||||
@Override
|
||||
public boolean isVisitable(BlockVector3 from, BlockVector3 to) {
|
||||
return (from.getBlockY() >= baseY) && super.isVisitable(from, to);
|
||||
return (from.y() >= baseY) && super.isVisitable(from, to);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,13 +64,13 @@ public abstract class DFSVisitor implements Operation {
|
||||
IntTriple[] array = new IntTriple[directions.size()];
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
BlockVector3 dir = directions.get(i);
|
||||
array[i] = new IntTriple(dir.getBlockX(), dir.getBlockY(), dir.getBlockZ());
|
||||
array[i] = new IntTriple(dir.x(), dir.y(), dir.z());
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public void visit(final BlockVector3 pos) {
|
||||
Node node = new Node(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
Node node = new Node(pos.x(), pos.y(), pos.z());
|
||||
if (!this.hashQueue.contains(node)) {
|
||||
isVisitable(pos, pos); // Ignore this, just to initialize mask on this point
|
||||
queue.addFirst(new NodePair(null, node, 0));
|
||||
@ -102,7 +102,7 @@ public abstract class DFSVisitor implements Operation {
|
||||
mutable2.mutY(from.getY() + direction.y());
|
||||
mutable2.mutZ(from.getZ() + direction.z());
|
||||
if (isVisitable(mutable, mutable2)) {
|
||||
Node adjacent = new Node(mutable2.getBlockX(), mutable2.getBlockY(), mutable2.getBlockZ());
|
||||
Node adjacent = new Node(mutable2.x(), mutable2.y(), mutable2.z());
|
||||
if (!adjacent.equals(current.from)) {
|
||||
AtomicInteger adjacentCount = visited.get(adjacent);
|
||||
if (adjacentCount == null) {
|
||||
|
@ -52,22 +52,22 @@ public class DirectionalVisitor extends RecursiveVisitor {
|
||||
|
||||
@Override
|
||||
public boolean isVisitable(final BlockVector3 from, final BlockVector3 to) {
|
||||
int dx = to.getBlockX() - from.getBlockX();
|
||||
int dz = to.getBlockZ() - from.getBlockZ();
|
||||
int dy = to.getBlockY() - from.getBlockY();
|
||||
int dx = to.x() - from.x();
|
||||
int dz = to.z() - from.z();
|
||||
int dy = to.y() - from.y();
|
||||
|
||||
if (dx != 0) {
|
||||
if (dirVec.getBlockX() != 0 && dirVec.getBlockX() != dx) {
|
||||
if (dirVec.x() != 0 && dirVec.x() != dx) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (dy != 0) {
|
||||
if (dirVec.getBlockY() != 0 && dirVec.getBlockY() != dy) {
|
||||
if (dirVec.y() != 0 && dirVec.y() != dy) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (dz != 0) {
|
||||
if (dirVec.getBlockZ() != 0 && dirVec.getBlockZ() != dz) {
|
||||
if (dirVec.z() != 0 && dirVec.z() != dz) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -84,12 +84,12 @@ public class RollbackOptimizedHistory extends DiskStorageHistory {
|
||||
}
|
||||
|
||||
public void setDimensions(BlockVector3 pos1, BlockVector3 pos2) {
|
||||
this.minX = pos1.getBlockX();
|
||||
this.minY = pos1.getBlockY();
|
||||
this.minZ = pos1.getBlockZ();
|
||||
this.maxX = pos2.getBlockX();
|
||||
this.maxY = pos2.getBlockY();
|
||||
this.maxZ = pos2.getBlockZ();
|
||||
this.minX = pos1.x();
|
||||
this.minY = pos1.y();
|
||||
this.minZ = pos1.z();
|
||||
this.maxX = pos2.x();
|
||||
this.maxY = pos2.y();
|
||||
this.maxZ = pos2.z();
|
||||
}
|
||||
|
||||
public void setTime(long time) {
|
||||
|
@ -127,18 +127,18 @@ public abstract class AbstractChangeSet implements ChangeSet, IBatchProcessor {
|
||||
if (!tilesFrom.isEmpty()) {
|
||||
for (Map.Entry<BlockVector3, CompoundTag> entry : tilesFrom.entrySet()) {
|
||||
BlockVector3 pos = entry.getKey();
|
||||
BlockState fromBlock = get.getBlock(pos.getX() & 15, pos.getY(), pos.getZ() & 15);
|
||||
BlockState toBlock = set.getBlock(pos.getX() & 15, pos.getY(), pos.getZ() & 15);
|
||||
BlockState fromBlock = get.getBlock(pos.x() & 15, pos.y(), pos.z() & 15);
|
||||
BlockState toBlock = set.getBlock(pos.x() & 15, pos.y(), pos.z() & 15);
|
||||
if (fromBlock != toBlock || tilesTo.containsKey(pos)) {
|
||||
addTileRemove(MainUtil.setPosition(entry.getValue(), entry.getKey().getX(), entry.getKey().getY(),
|
||||
entry.getKey().getZ()));
|
||||
addTileRemove(MainUtil.setPosition(entry.getValue(), entry.getKey().x(), entry.getKey().y(),
|
||||
entry.getKey().z()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!tilesTo.isEmpty()) {
|
||||
for (Map.Entry<BlockVector3, CompoundTag> entry : tilesTo.entrySet()) {
|
||||
BlockVector3 pos = entry.getKey();
|
||||
addTileCreate(MainUtil.setPosition(entry.getValue(), pos.getX() + bx, pos.getY(), pos.getZ() + bz));
|
||||
addTileCreate(MainUtil.setPosition(entry.getValue(), pos.x() + bx, pos.y(), pos.z() + bz));
|
||||
}
|
||||
}
|
||||
Set<UUID> entRemoves = set.getEntityRemoves();
|
||||
@ -310,9 +310,9 @@ public abstract class AbstractChangeSet implements ChangeSet, IBatchProcessor {
|
||||
}
|
||||
|
||||
public void add(BlockVector3 loc, BaseBlock from, BaseBlock to) {
|
||||
int x = loc.getBlockX();
|
||||
int y = loc.getBlockY();
|
||||
int z = loc.getBlockZ();
|
||||
int x = loc.x();
|
||||
int y = loc.y();
|
||||
int z = loc.z();
|
||||
add(x, y, z, from, to);
|
||||
}
|
||||
|
||||
|
@ -68,9 +68,9 @@ public class BlockBagChangeSet extends AbstractDelegateChangeSet {
|
||||
|
||||
@Override
|
||||
public void add(BlockVector3 loc, BaseBlock from, BaseBlock to) {
|
||||
int x = loc.getBlockX();
|
||||
int y = loc.getBlockY();
|
||||
int z = loc.getBlockZ();
|
||||
int x = loc.x();
|
||||
int y = loc.y();
|
||||
int z = loc.z();
|
||||
add(x, y, z, from, to);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class BlockVector3ChunkMap<T> implements IAdaptedMap<BlockVector3, T, Int
|
||||
|
||||
@Override
|
||||
public Integer adaptKey(BlockVector3 key) {
|
||||
return MathMan.tripleBlockCoord(key.getX(), key.getY(), key.getZ());
|
||||
return MathMan.tripleBlockCoord(key.x(), key.y(), key.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,9 +50,9 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
int cx = (int) MathMan.untripleWorldCoordX(triple);
|
||||
int cy = (int) MathMan.untripleWorldCoordY(triple);
|
||||
int cz = (int) MathMan.untripleWorldCoordZ(triple);
|
||||
pos.mutX((cx << 11) + pos.getBlockX());
|
||||
pos.mutY((cy << 9) + pos.getBlockY());
|
||||
pos.mutZ((cz << 11) + pos.getBlockZ());
|
||||
pos.mutX((cx << 11) + pos.x());
|
||||
pos.mutY((cy << 9) + pos.y());
|
||||
pos.mutZ((cz << 11) + pos.z());
|
||||
return pos.toImmutable();
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
if (o instanceof BlockVector3 v) {
|
||||
return contains(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
return contains(v.x(), v.y(), v.z());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -166,9 +166,9 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
int cy = (int) MathMan.untripleWorldCoordY(triple);
|
||||
int cz = (int) MathMan.untripleWorldCoordZ(triple);
|
||||
return mutable.setComponents(
|
||||
(cx << 11) + localPos.getBlockX(),
|
||||
(cy << 9) + localPos.getBlockY(),
|
||||
(cz << 11) + localPos.getBlockZ()
|
||||
(cx << 11) + localPos.x(),
|
||||
(cy << 9) + localPos.y(),
|
||||
(cz << 11) + localPos.z()
|
||||
);
|
||||
}
|
||||
};
|
||||
@ -176,7 +176,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
|
||||
@Override
|
||||
public boolean add(BlockVector3 vector) {
|
||||
return add(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ());
|
||||
return add(vector.x(), vector.y(), vector.z());
|
||||
}
|
||||
|
||||
public boolean add(int x, int y, int z) {
|
||||
@ -209,7 +209,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
if (o instanceof BlockVector3 v) {
|
||||
return remove(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
return remove(v.x(), v.y(), v.z());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ public class LocalBlockVectorSet implements BlockVector3Set {
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
if (o instanceof BlockVector3 v) {
|
||||
return contains(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
return contains(v.x(), v.y(), v.z());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -302,14 +302,14 @@ public class LocalBlockVectorSet implements BlockVector3Set {
|
||||
*/
|
||||
@Override
|
||||
public boolean add(BlockVector3 vector) {
|
||||
return add(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ());
|
||||
return add(vector.x(), vector.y(), vector.z());
|
||||
}
|
||||
|
||||
private int getIndex(BlockVector3 vector) {
|
||||
return MathMan.tripleSearchCoords(
|
||||
vector.getBlockX() - offsetX,
|
||||
vector.getBlockY() - offsetY,
|
||||
vector.getBlockZ() - offsetZ
|
||||
vector.x() - offsetX,
|
||||
vector.y() - offsetY,
|
||||
vector.z() - offsetZ
|
||||
);
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ public class LocalBlockVectorSet implements BlockVector3Set {
|
||||
public boolean remove(Object o) {
|
||||
if (o instanceof BlockVector3) {
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
return remove(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
return remove(v.x(), v.y(), v.z());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public interface HeightMap {
|
||||
@ -45,7 +44,7 @@ public interface HeightMap {
|
||||
boolean layers
|
||||
) throws MaxChangedBlocksException {
|
||||
BlockVector3 top = session.getMaximumPoint();
|
||||
int maxY = top.getBlockY();
|
||||
int maxY = top.y();
|
||||
Location min = new Location(session.getWorld(), pos.subtract(size, size, size).toVector3());
|
||||
BlockVector3 max = pos.add(size, maxY, size);
|
||||
Region region = new CuboidRegion(session.getWorld(), min.toBlockPoint(), max);
|
||||
@ -81,9 +80,9 @@ public interface HeightMap {
|
||||
int maxY = session.getMaxY();
|
||||
int minY = session.getMinY();
|
||||
int diameter = 2 * size + 1;
|
||||
int centerX = pos.getBlockX();
|
||||
int centerZ = pos.getBlockZ();
|
||||
int centerY = pos.getBlockY();
|
||||
int centerX = pos.x();
|
||||
int centerZ = pos.z();
|
||||
int centerY = pos.y();
|
||||
int[] oldData = new int[diameter * diameter];
|
||||
int[] newData = new int[oldData.length];
|
||||
if (layers) { // Pixel accuracy
|
||||
@ -92,7 +91,7 @@ public interface HeightMap {
|
||||
}
|
||||
if (towards) {
|
||||
double sizePowInv = 1d / Math.pow(size, yscale);
|
||||
int targetY = pos.getBlockY();
|
||||
int targetY = pos.y();
|
||||
int tmpY = targetY;
|
||||
for (int x = -size; x <= size; x++) {
|
||||
int xx = centerX + x;
|
||||
@ -133,7 +132,7 @@ public interface HeightMap {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int height = pos.getBlockY();
|
||||
int height = pos.y();
|
||||
for (int x = -size; x <= size; x++) {
|
||||
int xx = centerX + x;
|
||||
for (int z = -size; z <= size; z++) {
|
||||
|
@ -24,7 +24,7 @@ public class RotatableHeightMap extends AbstractDelegateHeightMap {
|
||||
mutable.mutX(x);
|
||||
mutable.mutZ(z);
|
||||
BlockVector3 pos = transform.apply(mutable.setComponents(x, 0, z)).toBlockPoint();
|
||||
return super.getHeight(pos.getBlockX(), pos.getBlockZ());
|
||||
return super.getHeight(pos.x(), pos.z());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -56,22 +56,22 @@ public class ScalableHeightMap implements HeightMap {
|
||||
|
||||
public static ScalableHeightMap fromClipboard(Clipboard clipboard, int minY, int maxY) {
|
||||
BlockVector3 dim = clipboard.getDimensions();
|
||||
char[][] heightArray = new char[dim.getBlockX()][dim.getBlockZ()];
|
||||
int clipMinX = clipboard.getMinimumPoint().getBlockX();
|
||||
int clipMinZ = clipboard.getMinimumPoint().getBlockZ();
|
||||
int clipMinY = clipboard.getMinimumPoint().getBlockY();
|
||||
int clipMaxY = clipboard.getMaximumPoint().getBlockY();
|
||||
char[][] heightArray = new char[dim.x()][dim.z()];
|
||||
int clipMinX = clipboard.getMinimumPoint().x();
|
||||
int clipMinZ = clipboard.getMinimumPoint().z();
|
||||
int clipMinY = clipboard.getMinimumPoint().y();
|
||||
int clipMaxY = clipboard.getMaximumPoint().y();
|
||||
int clipHeight = clipMaxY - clipMinY + 1;
|
||||
HashSet<IntPair> visited = new HashSet<>();
|
||||
MutableBlockVector3 bv = new MutableBlockVector3();
|
||||
for (BlockVector3 pos : clipboard.getRegion()) {
|
||||
IntPair pair = new IntPair(pos.getBlockX(), pos.getBlockZ());
|
||||
IntPair pair = new IntPair(pos.x(), pos.z());
|
||||
if (visited.contains(pair)) {
|
||||
continue;
|
||||
}
|
||||
visited.add(pair);
|
||||
int xx = pos.getBlockX();
|
||||
int zz = pos.getBlockZ();
|
||||
int xx = pos.x();
|
||||
int zz = pos.z();
|
||||
int highestY = clipMinY;
|
||||
bv.setComponents(pos);
|
||||
for (int y = clipMinY; y <= clipMaxY; y++) {
|
||||
|
@ -8,12 +8,12 @@ public class SimplexNoiseGenerator implements NoiseGenerator {
|
||||
|
||||
@Override
|
||||
public float noise(Vector2 position) {
|
||||
return convert(SimplexNoise.noise(position.getX(), position.getZ()));
|
||||
return convert(SimplexNoise.noise(position.x(), position.z()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public float noise(Vector3 position) {
|
||||
return convert(SimplexNoise.noise(position.getX(), position.getY(), position.getZ()));
|
||||
return convert(SimplexNoise.noise(position.x(), position.y(), position.z()));
|
||||
}
|
||||
|
||||
private float convert(double d) {
|
||||
|
@ -52,8 +52,8 @@ public interface IChunkExtent<T extends IChunk> extends Extent {
|
||||
|
||||
@Override
|
||||
default boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
final IChunk chunk = getOrCreateChunk(position.getX() >> 4, position.getZ() >> 4);
|
||||
return chunk.setBiome(position.getX() & 15, position.getY(), position.getZ() & 15, biome);
|
||||
final IChunk chunk = getOrCreateChunk(position.x() >> 4, position.z() >> 4);
|
||||
return chunk.setBiome(position.x() & 15, position.y(), position.z() & 15, biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,8 +76,8 @@ public interface IChunkExtent<T extends IChunk> extends Extent {
|
||||
|
||||
@Override
|
||||
default BiomeType getBiome(BlockVector3 position) {
|
||||
final IChunk chunk = getOrCreateChunk(position.getX() >> 4, position.getZ() >> 4);
|
||||
return chunk.getBiomeType(position.getX() & 15, position.getY(), position.getZ() & 15);
|
||||
final IChunk chunk = getOrCreateChunk(position.x() >> 4, position.z() >> 4);
|
||||
return chunk.getBiomeType(position.x() & 15, position.y(), position.z() & 15);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -129,9 +129,9 @@ public interface IChunkExtent<T extends IChunk> extends Extent {
|
||||
|
||||
//Set pos
|
||||
List<DoubleTag> posList = new ArrayList<>();
|
||||
posList.add(new DoubleTag(location.getX()));
|
||||
posList.add(new DoubleTag(location.getY()));
|
||||
posList.add(new DoubleTag(location.getZ()));
|
||||
posList.add(new DoubleTag(location.x()));
|
||||
posList.add(new DoubleTag(location.y()));
|
||||
posList.add(new DoubleTag(location.z()));
|
||||
map.put("Pos", new ListTag(DoubleTag.class, posList));
|
||||
|
||||
NBTUtils.addUUIDToMap(map, uuid);
|
||||
|
@ -25,7 +25,7 @@ public interface IChunkGet extends IBlocks, Trimable, InputExtent, ITileInput {
|
||||
|
||||
@Override
|
||||
default BiomeType getBiome(BlockVector3 position) {
|
||||
return getBiomeType(position.getX(), position.getY(), position.getZ());
|
||||
return getBiomeType(position.x(), position.y(), position.z());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,7 +25,7 @@ public interface IChunkSet extends IBlocks, OutputExtent {
|
||||
|
||||
@Override
|
||||
default boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
|
||||
return setBiome(position.x(), position.y(), position.z(), biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,7 +152,7 @@ public interface IQueueExtent<T extends IChunk> extends Flushable, Trimable, ICh
|
||||
final Set<BlockVector2> chunks = region.getChunks();
|
||||
ChunkFilterBlock block = null;
|
||||
for (BlockVector2 chunk : chunks) {
|
||||
block = apply(block, filter, region, chunk.getX(), chunk.getZ(), full);
|
||||
block = apply(block, filter, region, chunk.x(), chunk.z(), full);
|
||||
}
|
||||
flush();
|
||||
return filter;
|
||||
|
@ -135,7 +135,7 @@ public class ParallelQueueExtent extends PassthroughExtent {
|
||||
// if PQE is ever used with PARALLEL_THREADS = 1, or only one chunk is edited, just run sequentially
|
||||
while (chunksIter.hasNext()) {
|
||||
BlockVector2 pos = chunksIter.next();
|
||||
getExtent().apply(null, filter, region, pos.getX(), pos.getZ(), full);
|
||||
getExtent().apply(null, filter, region, pos.x(), pos.z(), full);
|
||||
}
|
||||
} else {
|
||||
final ForkJoinTask[] tasks = IntStream.range(0, size).mapToObj(i -> handler.submit(() -> {
|
||||
@ -159,8 +159,8 @@ public class ParallelQueueExtent extends PassthroughExtent {
|
||||
break;
|
||||
}
|
||||
final BlockVector2 pos = chunksIter.next();
|
||||
chunkX = pos.getX();
|
||||
chunkZ = pos.getZ();
|
||||
chunkX = pos.x();
|
||||
chunkZ = pos.z();
|
||||
}
|
||||
block = queue.apply(block, newFilter, region, chunkX, chunkZ, full);
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen
|
||||
break;
|
||||
}
|
||||
loadCount++;
|
||||
addChunkLoad(from.getBlockX(), from.getBlockZ());
|
||||
addChunkLoad(from.x(), from.z());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user