|
37 | 37 | */ |
38 | 38 | @API |
39 | 39 | public interface CoreChunk { |
| 40 | + /** |
| 41 | + * @return Position of the chunk in world, where units of distance from origin are blocks |
| 42 | + */ |
40 | 43 | Vector3i getPosition(); |
41 | 44 |
|
| 45 | + /** |
| 46 | + * Returns block at given position relative to the chunk. |
| 47 | + * |
| 48 | + * @param pos Position of the block relative to corner of the chunk |
| 49 | + * @return Block at given position |
| 50 | + */ |
42 | 51 | Block getBlock(BaseVector3i pos); |
43 | 52 |
|
| 53 | + /** |
| 54 | + * Returns block at given position relative to the chunk. |
| 55 | + * |
| 56 | + * @param x X offset from the corner of the chunk |
| 57 | + * @param y Y offset from the corner of the chunk |
| 58 | + * @param z Z offset from the corner of the chunk |
| 59 | + * @return Block at given position |
| 60 | + */ |
44 | 61 | Block getBlock(int x, int y, int z); |
45 | 62 |
|
| 63 | + /** |
| 64 | + * Sets type of block at given position relative to the chunk. |
| 65 | + * |
| 66 | + * @param x X offset from the corner of the chunk |
| 67 | + * @param y Y offset from the corner of the chunk |
| 68 | + * @param z Z offset from the corner of the chunk |
| 69 | + * @param block Block to set block at given position to |
| 70 | + * @return Old Block at given position |
| 71 | + */ |
46 | 72 | Block setBlock(int x, int y, int z, Block block); |
47 | 73 |
|
| 74 | + /** |
| 75 | + * Sets type of block at given position relative to the chunk. |
| 76 | + * |
| 77 | + * @param pos Position of the block relative to corner of the chunk |
| 78 | + * @param block Block to set block at given position to |
| 79 | + * @return Old Block at given position |
| 80 | + */ |
48 | 81 | Block setBlock(BaseVector3i pos, Block block); |
49 | 82 |
|
| 83 | + /** |
| 84 | + * Sets biome at given position relative to the chunk. |
| 85 | + * |
| 86 | + * @param x X offset from the corner of the chunk |
| 87 | + * @param y Y offset from the corner of the chunk |
| 88 | + * @param z Z offset from the corner of the chunk |
| 89 | + * @param biome Biome to set block at given position to |
| 90 | + * @return Old Biome at given position |
| 91 | + */ |
50 | 92 | Biome setBiome(int x, int y, int z, Biome biome); |
51 | 93 |
|
| 94 | + /** |
| 95 | + * Sets biome at given position relative to the chunk. |
| 96 | + * |
| 97 | + * @param pos Position of the block relative to corner of the chunk |
| 98 | + * @param biome Biome to set block at given position to |
| 99 | + * @return Old Biome at given position |
| 100 | + */ |
52 | 101 | Biome setBiome(BaseVector3i pos, Biome biome); |
53 | 102 |
|
| 103 | + /** |
| 104 | + * Returns Biome at given position relative to the chunk. |
| 105 | + * |
| 106 | + * @param x X offset from the corner of the chunk |
| 107 | + * @param y Y offset from the corner of the chunk |
| 108 | + * @param z Z offset from the corner of the chunk |
| 109 | + * @return Biome at given position |
| 110 | + */ |
54 | 111 | Biome getBiome(int x, int y, int z); |
55 | 112 |
|
| 113 | + /** |
| 114 | + * Returns Biome at given position relative to the chunk. |
| 115 | + * |
| 116 | + * @param pos Position of the block relative to corner of the chunk |
| 117 | + * @return Biome at given position |
| 118 | + */ |
56 | 119 | Biome getBiome(BaseVector3i pos); |
57 | 120 |
|
| 121 | + /** |
| 122 | + * Sets liquid state at given position relative to the chunk. |
| 123 | + * |
| 124 | + * @param pos Position of the block relative to corner of the chunk |
| 125 | + * @param state Liquid state to set the block to |
| 126 | + */ |
58 | 127 | void setLiquid(BaseVector3i pos, LiquidData state); |
59 | 128 |
|
| 129 | + /** |
| 130 | + * Sets liquid state at given position relative to the chunk. |
| 131 | + * |
| 132 | + * @param x X offset from the corner of the chunk |
| 133 | + * @param y Y offset from the corner of the chunk |
| 134 | + * @param z Z offset from the corner of the chunk |
| 135 | + * @param newState Liquid state to set the block to |
| 136 | + */ |
60 | 137 | void setLiquid(int x, int y, int z, LiquidData newState); |
61 | 138 |
|
| 139 | + /** |
| 140 | + * Returns liquid state at given position relative to the chunk. |
| 141 | + * |
| 142 | + * @param pos Position of the block relative to corner of the chunk |
| 143 | + * @return Liquid state currently assigned to the block |
| 144 | + */ |
62 | 145 | LiquidData getLiquid(BaseVector3i pos); |
63 | 146 |
|
| 147 | + /** |
| 148 | + * Returns liquid state at given position relative to the chunk. |
| 149 | + * |
| 150 | + * @param x X offset from the corner of the chunk |
| 151 | + * @param y Y offset from the corner of the chunk |
| 152 | + * @param z Z offset from the corner of the chunk |
| 153 | + * @return Liquid state currently assigned to the block |
| 154 | + */ |
64 | 155 | LiquidData getLiquid(int x, int y, int z); |
65 | 156 |
|
| 157 | + /** |
| 158 | + * Returns offset of this chunk to the world center (0:0:0), with one unit being one chunk. |
| 159 | + * |
| 160 | + * @return Offset of this chunk from world center in chunks |
| 161 | + */ |
66 | 162 | Vector3i getChunkWorldOffset(); |
67 | 163 |
|
| 164 | + /** |
| 165 | + * Returns X offset of this chunk to the world center (0:0:0), with one unit being one chunk. |
| 166 | + * |
| 167 | + * @return X offset of this chunk from world center in chunks |
| 168 | + */ |
68 | 169 | int getChunkWorldOffsetX(); |
69 | 170 |
|
| 171 | + /** |
| 172 | + * Returns Y offset of this chunk to the world center (0:0:0), with one unit being one chunk. |
| 173 | + * |
| 174 | + * @return Y offset of this chunk from world center in chunks |
| 175 | + */ |
70 | 176 | int getChunkWorldOffsetY(); |
71 | 177 |
|
| 178 | + /** |
| 179 | + * Returns Z offset of this chunk to the world center (0:0:0), with one unit being one chunk. |
| 180 | + * |
| 181 | + * @return Z offset of this chunk from world center in chunks |
| 182 | + */ |
72 | 183 | int getChunkWorldOffsetZ(); |
73 | 184 |
|
| 185 | + /** |
| 186 | + * Returns position in this chunk transformed to world coordinates. |
| 187 | + * |
| 188 | + * @param blockPos Position in this chunk you want to transform |
| 189 | + * @return Transformed position |
| 190 | + */ |
74 | 191 | Vector3i chunkToWorldPosition(BaseVector3i blockPos); |
75 | 192 |
|
| 193 | + /** |
| 194 | + * Returns position in this chunk transformed to world coordinates. |
| 195 | + * |
| 196 | + * @param x X position in this chunk you want to transform |
| 197 | + * @param y Y position in this chunk you want to transform |
| 198 | + * @param z Z position in this chunk you want to transform |
| 199 | + * @return Transformed position |
| 200 | + */ |
76 | 201 | Vector3i chunkToWorldPosition(int x, int y, int z); |
77 | 202 |
|
| 203 | + /** |
| 204 | + * Returns X position in this chunk transformed to world coordinate. |
| 205 | + * |
| 206 | + * @param x X position in this chunk you want to transform |
| 207 | + * @return Transformed position |
| 208 | + */ |
78 | 209 | int chunkToWorldPositionX(int x); |
79 | 210 |
|
| 211 | + /** |
| 212 | + * Returns Y position in this chunk transformed to world coordinate. |
| 213 | + * |
| 214 | + * @param y Y position in this chunk you want to transform |
| 215 | + * @return Transformed position |
| 216 | + */ |
80 | 217 | int chunkToWorldPositionY(int y); |
81 | 218 |
|
| 219 | + /** |
| 220 | + * Returns Z position in this chunk transformed to world coordinate. |
| 221 | + * |
| 222 | + * @param z Z position in this chunk you want to transform |
| 223 | + * @return Transformed position |
| 224 | + */ |
82 | 225 | int chunkToWorldPositionZ(int z); |
83 | 226 |
|
| 227 | + /** |
| 228 | + * @return Size of the chunk along the X axis. |
| 229 | + */ |
84 | 230 | int getChunkSizeX(); |
85 | 231 |
|
| 232 | + /** |
| 233 | + * @return Size of the chunk along the Y axis. |
| 234 | + */ |
86 | 235 | int getChunkSizeY(); |
87 | 236 |
|
| 237 | + /** |
| 238 | + * @return Size of the chunk along the Z axis. |
| 239 | + */ |
88 | 240 | int getChunkSizeZ(); |
89 | 241 |
|
| 242 | + /** |
| 243 | + * @return Chunk's Region |
| 244 | + */ |
90 | 245 | Region3i getRegion(); |
91 | 246 |
|
92 | 247 | int getEstimatedMemoryConsumptionInBytes(); |
|
0 commit comments