mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:34:03 +00:00
Merge pull request #568 from HazelTheWitch/fix-spline-sweep
Fixed NullPointerException in Spline and Sweep brush
This commit is contained in:
@@ -775,6 +775,10 @@ public abstract class BlockVector3 {
|
||||
}
|
||||
|
||||
public final boolean equals(BlockVector3 other) {
|
||||
if (other == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return other.getX() == this.getX() && other.getY() == this.getY() && other.getZ() == this.getZ();
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
package com.sk89q.worldedit.math.interpolation;
|
||||
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -43,7 +44,7 @@ public class KochanekBartelsInterpolation implements Interpolation {
|
||||
private Vector3[] coeffC;
|
||||
private Vector3[] coeffD;
|
||||
private double scaling;
|
||||
private final MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private final MutableVector3 mutable = new MutableVector3();
|
||||
|
||||
public KochanekBartelsInterpolation() {
|
||||
setNodes(Collections.emptyList());
|
||||
@@ -166,7 +167,7 @@ public class KochanekBartelsInterpolation implements Interpolation {
|
||||
mutable.mutX((a.getX() * r3 + b.getX() * r2 + c.getX() * remainder + d.getX()));
|
||||
mutable.mutY((a.getY() * r3 + b.getY() * r2 + c.getY() * remainder + d.getY()));
|
||||
mutable.mutZ((a.getZ() * r3 + b.getZ() * r2 + c.getZ() * remainder + d.getZ()));
|
||||
return mutable.toVector3();
|
||||
return Vector3.at(mutable.getX(), mutable.getY(), mutable.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -17,8 +17,7 @@ public class RoundedTransform implements Transform {
|
||||
@Override
|
||||
public Vector3 apply(Vector3 input) {
|
||||
Vector3 val = transform.apply(input);
|
||||
return Vector3.at(Math.floor(val.getX() + 0.5), Math.floor(val.getY() + 0.5), Math
|
||||
.floor(val.getY() + 0.5));
|
||||
return val.round();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -128,7 +128,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
public boolean selectPrimary(BlockVector3 position, SelectorLimits limits) {
|
||||
checkNotNull(position);
|
||||
|
||||
if (position1 != null && position.equals(position1)) {
|
||||
if (position.equals(position1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
public boolean selectSecondary(BlockVector3 position, SelectorLimits limits) {
|
||||
checkNotNull(position);
|
||||
|
||||
if (position2 != null && position.equals(position2)) {
|
||||
if (position.equals(position2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,7 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
|
||||
|
||||
@Override
|
||||
public boolean selectPrimary(BlockVector3 position, SelectorLimits limits) {
|
||||
if (position1 != null && position2 != null && position.equals(position1) && position.equals(position2)) {
|
||||
if (position.equals(position1) && position.equals(position2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user