mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
block delet
This commit is contained in:
@ -22,6 +22,14 @@ public struct Chunk {
|
||||
}
|
||||
|
||||
mutating func setBlockInternally(at position: SIMD3<Int>, type: BlockType) {
|
||||
if position.x >= Chunk.chunkSize || position.y >= Chunk.chunkSize || position.z >= Chunk.chunkSize {
|
||||
return
|
||||
}
|
||||
|
||||
if position.x < 0 || position.y < 0 || position.z < 0 {
|
||||
return
|
||||
}
|
||||
|
||||
blocks[position.x + position.y * Chunk.chunkSize + position.z * Chunk.chunkSize * Chunk.chunkSize].type = type
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user