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