mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 04:38:35 +00:00
Handle null case in equality checking BlockVector3+DFSNode
This commit is contained in:
@ -59,7 +59,7 @@ public class SplineBrush implements Brush, ResettableTool {
|
||||
return;
|
||||
}
|
||||
int originalSize = numSplines;
|
||||
boolean newPos = this.position == null || !position.equals(this.position);
|
||||
boolean newPos = !position.equals(this.position);
|
||||
this.position = position;
|
||||
if (newPos) {
|
||||
if (positionSets.size() >= MAX_POINTS) {
|
||||
|
@ -46,7 +46,7 @@ public class SweepBrush implements Brush, ResettableTool {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean newPos = this.position == null || !position.equals(this.position);
|
||||
boolean newPos = !position.equals(this.position);
|
||||
this.position = position;
|
||||
Player player = editSession.getPlayer();
|
||||
if (player == null) {
|
||||
|
@ -104,7 +104,7 @@ public abstract class DFSVisitor implements Operation {
|
||||
from.getZ() + direction.getZ());
|
||||
if (isVisitable(bv, bv2)) {
|
||||
Node adjacent = new Node(bv2.getBlockX(), bv2.getBlockY(), bv2.getBlockZ());
|
||||
if (current.from == null || !adjacent.equals(current.from)) {
|
||||
if (!adjacent.equals(current.from)) {
|
||||
AtomicInteger adjacentCount = visited.get(adjacent);
|
||||
if (adjacentCount == null) {
|
||||
if (countAdd++ < maxBranch) {
|
||||
@ -200,6 +200,10 @@ public abstract class DFSVisitor implements Operation {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Node other = (Node) obj;
|
||||
return other.x == x && other.z == z && other.y == y;
|
||||
}
|
||||
|
Reference in New Issue
Block a user