2 * Decompiled with CFR 0.151.
4 package net
.encode
.wurmesp
.util
;
6 import net
.encode
.wurmesp
.WurmEspMod
;
8 public class TerrainUtils
{
9 public static boolean isFlat(float[] tile
) {
10 return tile
[1] == tile
[4] && tile
[4] == tile
[7] && tile
[7] == tile
[10];
13 public static boolean isNotRideable(float[] tile
) {
14 return TerrainUtils
.getTileSteepness(tile
)[1] >= WurmEspMod
.tilenotrideable
;
17 public static short[] getTileSteepness(float[] tile
) {
20 for (int i
= 1; i
<= 10; i
+= 3) {
22 height
= (short)(tile
[i
] * 10.0f);
23 if (height
> highest
) {
26 if (height
>= lowest
) continue;
29 int med
= (highest
+ lowest
) / 2;
30 return new short[]{(short)med
, (short)(highest
- lowest
)};