3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Updated ClipboardSpline paste

Dieser Commit ist enthalten in:
Hazel Trinity 2020-08-16 01:08:35 -07:00
Ursprung cd0dac813c
Commit e5f092c3ef
2 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -8,6 +8,7 @@ import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.interpolation.Interpolation;
import com.sk89q.worldedit.math.transform.AffineTransform;
import com.sk89q.worldedit.math.transform.RoundedTransform;
@ -80,7 +81,7 @@ public class ClipboardSpline extends Spline {
}
@Override
protected int pasteBlocks(BlockVector3 target, BlockVector3 offset, double angle) throws MaxChangedBlocksException {
protected int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException {
RoundedTransform transform = new RoundedTransform(new AffineTransform()
.translate(offset)
.rotateY(angle));

Datei anzeigen

@ -127,9 +127,9 @@ public abstract class Spline {
Preconditions.checkArgument(position <= 1);
// Calculate position from spline
BlockVector3 target = interpolation.getPosition(position).toBlockPoint();
BlockVector3 offset = target.subtract(target.round());
target = target.subtract(offset).round();
Vector3 target = interpolation.getPosition(position);
BlockVector3 blockTarget = target.toBlockPoint();
Vector3 offset = target.subtract(target.floor());
// Calculate rotation from spline
@ -139,10 +139,10 @@ public abstract class Spline {
Math.atan2(direction.getZ(), direction.getX()) - Math.atan2(deriv2D.getZ(), deriv2D.getX())
);
return pasteBlocks(target, offset, angle);
return pasteBlocks(blockTarget, offset, angle);
}
protected abstract int pasteBlocks(BlockVector3 target, BlockVector3 offset, double angle) throws MaxChangedBlocksException;
protected abstract int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException;
private void initSections() {
int sectionCount = nodeCount - 1;