mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
f
This commit is contained in:
parent
b11aaf3f0c
commit
e2d2dcf337
@ -21,18 +21,18 @@ package com.volmit.iris.util.data;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class HeightMap {
|
public class HeightMap {
|
||||||
private final byte[] height;
|
private final int[] height;
|
||||||
|
|
||||||
public HeightMap() {
|
public HeightMap() {
|
||||||
height = new byte[256];
|
height = new int[256];
|
||||||
Arrays.fill(height, Byte.MIN_VALUE);
|
Arrays.fill(height, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHeight(int x, int z, int h) {
|
public void setHeight(int x, int z, int h) {
|
||||||
height[x * 16 + z] = (byte) (h + Byte.MIN_VALUE);
|
height[x * 16 + z] = (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight(int x, int z) {
|
public int getHeight(int x, int z) {
|
||||||
return height[x * 16 + z] - Byte.MIN_VALUE;
|
return height[x * 16 + z];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user