Skip to content

Commit

Permalink
Update ForEachCommand.java
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed May 17, 2013
1 parent 60339b4 commit 051f011
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -83,6 +83,8 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
+ script.debug());

if (type == Type.LOCATION) {

dB.echoDebug("Type Location...");

int x_inc = -1;
int y_inc = -1;
Expand All @@ -92,13 +94,19 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
if (loc_1.getBlockY() <= loc_2.getBlockY()) y_inc = 1;
if (loc_1.getBlockZ() <= loc_2.getBlockZ()) z_inc = 1;

dB.echoDebug("incs = " + x_inc + " " + y_inc + " " + z_inc);

int x_amt = Math.abs(loc_1.getBlockX() - loc_2.getBlockX());
int y_amt = Math.abs(loc_1.getBlockY() - loc_2.getBlockY());
int z_amt = Math.abs(loc_1.getBlockZ() - loc_2.getBlockZ());

dB.echoDebug("amts = " + x_amt + " " + y_amt + " " + z_amt);

for (int x = 0; x != x_amt; x = x + x_inc) {
for (int y = 0; x != y_amt; y = y + y_inc) {
for (int z = 0; x != z_amt; z = z + z_inc) {

dB.echoDebug("x,y,z = " + x + " " + y + " " + z);

dLocation loc = new dLocation(loc_1.add((double) x, (double) y, (double) z));

Expand All @@ -116,4 +124,4 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
}
}

}
}

0 comments on commit 051f011

Please sign in to comment.