Progress to Next Update #65

Merged
SenseiKiwi merged 12 commits from master into master 2013-08-04 03:29:02 +00:00
Showing only changes of commit 2dfabccaa9 - Show all commits

View File

@@ -175,7 +175,7 @@ public class BlockRift extends BlockContainer
//Perform a breadth-first search outwards from the point at which the rift is located. Record the distances //Perform a breadth-first search outwards from the point at which the rift is located. Record the distances
//of the points we visit to stop the search at its maximum range. //of the points we visit to stop the search at its maximum range.
pointDistances.put(new Point3D(x, y, z), 0); pointDistances.put(new Point3D(x, y, z), 0);
AddSurroundingBlocks(x, y, z, 0, pointDistances, points); addAdjacentBlocks(x, y, z, 0, pointDistances, points);
while (!points.isEmpty()) while (!points.isEmpty())
{ {
Point3D current = points.remove(); Point3D current = points.remove();
@@ -187,7 +187,7 @@ public class BlockRift extends BlockContainer
//Make sure we stay within the search range //Make sure we stay within the search range
if (distance < BLOCK_DESTRUCTION_RANGE) if (distance < BLOCK_DESTRUCTION_RANGE)
{ {
addSurroundingBlocks(current.getX(), current.getY(), current.getZ(), distance, pointDistances, points); addAdjacentBlocks(current.getX(), current.getY(), current.getZ(), distance, pointDistances, points);
} }
} }
else else
@@ -203,7 +203,7 @@ public class BlockRift extends BlockContainer
} }
} }
private void addSurroundingBlocks(int x, int y, int z, int distance, HashMap<Point3D, Integer> pointDistances, Queue<Point3D> points) private void addAdjacentBlocks(int x, int y, int z, int distance, HashMap<Point3D, Integer> pointDistances, Queue<Point3D> points)
{ {
Point3D[] neighbors = new Point3D[] { Point3D[] neighbors = new Point3D[] {
new Point3D(x - 1, y, z), new Point3D(x - 1, y, z),