Make angle pattern slope a little more readable

This commit is contained in:
dordsor21 2022-02-16 17:42:22 +00:00
parent cf0a21d312
commit 3e85369765
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -37,30 +37,14 @@ public abstract class AnglePattern extends AbstractPattern {
if (!block.getBlockType().getMaterial().isMovementBlocker()) { if (!block.getBlockType().getMaterial().isMovementBlocker()) {
return -1; return -1;
} }
int slope = Math.abs( int slope = Math.abs(extent.getNearestSurfaceTerrainBlock(x + distance, z, y, minY, maxY) -
extent.getNearestSurfaceTerrainBlock(x + distance, z, y, minY, maxY) - extent extent.getNearestSurfaceTerrainBlock(x - distance, z, y, minY, maxY)) * 7;
.getNearestSurfaceTerrainBlock(x - distance, z, y, minY, maxY)) * 7; slope += Math.abs(extent.getNearestSurfaceTerrainBlock(x, z + distance, y, minY, maxY) -
slope += Math.abs(extent.getNearestSurfaceTerrainBlock( extent.getNearestSurfaceTerrainBlock(x, z - distance, y, minY, maxY)) * 7;
x, slope += Math.abs(extent.getNearestSurfaceTerrainBlock(x + distance, z + distance, y, minY, maxY) -
z + distance, extent.getNearestSurfaceTerrainBlock(x - distance, z - distance, y, minY, maxY)) * 5;
y, slope += Math.abs(extent.getNearestSurfaceTerrainBlock(x - distance, z + distance, y, minY, maxY) -
minY, extent.getNearestSurfaceTerrainBlock(x + distance, z - distance, y, minY, maxY)) * 5;
maxY
) - extent.getNearestSurfaceTerrainBlock(x, z - distance, y, minY, maxY)) * 7;
slope += Math.abs(extent.getNearestSurfaceTerrainBlock(
x + distance,
z + distance,
y,
minY,
maxY
) - extent.getNearestSurfaceTerrainBlock(x - distance, z - distance, y, minY, maxY)) * 5;
slope += Math.abs(extent.getNearestSurfaceTerrainBlock(
x - distance,
z + distance,
y,
minY,
maxY
) - extent.getNearestSurfaceTerrainBlock(x + distance, z - distance, y, minY, maxY)) * 5;
return slope; return slope;
} }