File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
src/main/java/org/crafter/engine/chunk Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .crafter .engine .chunk ;
2
+
3
+ import org .joml .Vector2f ;
4
+ import org .joml .Vector2fc ;
5
+ import org .joml .Vector2i ;
6
+ import org .joml .Vector2ic ;
7
+
8
+ /**
9
+ * A chunk of map data. It is 16 wide, 128 high, and 16 long.
10
+ */
11
+ public class Chunk {
12
+
13
+ private static final int arraySize = 16 *16 *128 ;
14
+ private final Vector2ic position ;
15
+
16
+ // Consists of bit shifted integral values
17
+ private final int [] data ;
18
+
19
+ public Chunk (Vector2i position ) {
20
+ this .position = position ;
21
+ this .data = new int [arraySize ];
22
+ }
23
+
24
+ public Vector2ic getPosition () {
25
+ return position ;
26
+ }
27
+
28
+ public int getX () {
29
+ return position .x ();
30
+ }
31
+
32
+ public int getY () {
33
+ return position .y ();
34
+ }
35
+
36
+ //Todo: idea: metadata arraymap
37
+ //Todo: bitshift light, block id, state
38
+ }
You can’t perform that action at this time.
0 commit comments