This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/kotlin/scpsharp/content/facility/generator Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ class FacilityGenerator(
73
73
fun isChunkLoaded (pos : BlockPos ) =
74
74
isChunkLoaded(ChunkSectionPos .getSectionCoord(pos.x), ChunkSectionPos .getSectionCoord(pos.z))
75
75
76
+ fun isChunkLoadedAtBlock (x : Int , z : Int ) =
77
+ isChunkLoaded(ChunkSectionPos .getSectionCoord(x), ChunkSectionPos .getSectionCoord(z))
78
+
76
79
fun getSurfaceHeight (pos : BlockPos ) = getSurfaceHeight(pos.x, pos.z)
77
80
78
81
fun getSurfaceHeight (x : Int , z : Int ) = chunkGenerator.getHeight(
@@ -92,11 +95,16 @@ class FacilityGenerator(
92
95
extraValidator = extraValidator
93
96
)
94
97
95
- fun validateBlock (pos : BlockPos ) = isChunkLoaded(pos) && validateBlock(get(pos))
98
+ fun validateBlock (pos : BlockPos ) = validateBlock(get(pos))
96
99
97
100
fun validateBlock (state : BlockState ): Boolean = ! state.isIn(ComponentTags .FACILITY_KEEP )
98
101
99
102
fun validateSpace (box : BlockBox ): Boolean {
103
+ for (x in box.minX.. box.maxX step 16 ) {
104
+ for (z in box.minZ.. box.maxZ step 16 ) {
105
+ if (! isChunkLoadedAtBlock(x, z)) return false
106
+ }
107
+ }
100
108
for (x in box.minX.. box.maxX) {
101
109
for (y in box.minY.. box.maxY) {
102
110
for (z in box.minZ.. box.maxZ) {
You can’t perform that action at this time.
0 commit comments