mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Make slope method slightly more readable in AngleMask
This commit is contained in:
parent
a40d1ccf51
commit
3f28a5759d
@ -89,30 +89,38 @@ public class AngleMask extends AbstractExtentMask implements ResettableMask {
|
||||
if (slope >= min) {
|
||||
return lastValue = true;
|
||||
}
|
||||
slope = Math.max(slope, Math.abs(
|
||||
getHeight(extent, x, y, z + distance) - getHeight(extent, x, y, z - distance))
|
||||
* ADJACENT_MOD);
|
||||
slope = Math.max(slope, Math.abs(
|
||||
getHeight(extent, x + distance, y, z + distance) - getHeight(extent,
|
||||
x - distance, y, z - distance
|
||||
)) * DIAGONAL_MOD);
|
||||
slope = Math.max(slope, Math.abs(
|
||||
getHeight(extent, x - distance, y, z + distance) - getHeight(extent,
|
||||
x + distance, y, z - distance
|
||||
)) * DIAGONAL_MOD);
|
||||
slope = Math.max(
|
||||
slope,
|
||||
Math.abs(getHeight(extent, x, y, z + distance) - getHeight(extent, x, y, z - distance)) * ADJACENT_MOD
|
||||
);
|
||||
slope = Math.max(
|
||||
slope,
|
||||
Math.abs(
|
||||
getHeight(extent, x + distance, y, z + distance) -
|
||||
getHeight(extent, x - distance, y, z - distance)) * DIAGONAL_MOD
|
||||
);
|
||||
slope = Math.max(
|
||||
slope,
|
||||
Math.abs(
|
||||
getHeight(extent, x - distance, y, z + distance) -
|
||||
getHeight(extent, x + distance, y, z - distance)) * DIAGONAL_MOD
|
||||
);
|
||||
return lastValue = (slope >= min);
|
||||
} else {
|
||||
slope = Math.max(slope, Math.abs(
|
||||
getHeight(extent, x, y, z + distance) - getHeight(extent, x, y, z - distance))
|
||||
* ADJACENT_MOD);
|
||||
slope = Math.max(slope, Math.abs(
|
||||
getHeight(extent, x + distance, y, z + distance) - getHeight(extent,
|
||||
x - distance, y, z - distance
|
||||
)) * DIAGONAL_MOD);
|
||||
slope = Math.max(slope, Math.abs(
|
||||
getHeight(extent, x - distance, y, z + distance) - getHeight(extent,
|
||||
x + distance, y, z - distance
|
||||
)) * DIAGONAL_MOD);
|
||||
slope = Math.max(
|
||||
slope,
|
||||
Math.abs(getHeight(extent, x, y, z + distance) - getHeight(extent, x, y, z - distance)) * ADJACENT_MOD
|
||||
);
|
||||
slope = Math.max(
|
||||
slope,
|
||||
Math.abs(getHeight(extent, x + distance, y, z + distance) -
|
||||
getHeight(extent, x - distance, y, z - distance)) * DIAGONAL_MOD
|
||||
);
|
||||
slope = Math.max(
|
||||
slope,
|
||||
Math.abs(getHeight(extent, x - distance, y, z + distance) -
|
||||
getHeight(extent, x + distance, y, z - distance)) * DIAGONAL_MOD
|
||||
);
|
||||
return lastValue = (slope >= min && slope <= max);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user