File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/main/kotlin/com/github/zly2006/enclosure Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ import net.minecraft.util.Identifier
6464import net.minecraft.util.hit.BlockHitResult
6565import net.minecraft.util.hit.HitResult
6666import net.minecraft.util.math.BlockPos
67+ import net.minecraft.util.math.ChunkPos
6768import net.minecraft.world.PersistentState
6869import net.minecraft.world.RaycastContext
6970import net.minecraft.world.World
@@ -283,7 +284,7 @@ object ServerMain: ModInitializer {
283284 }
284285
285286 fun getSmallestEnclosure (world : ServerWorld , pos : BlockPos ? ): EnclosureArea ? {
286- return (world.getChunk( pos) as ? ChunkAccess )?.cache
287+ return (world.getChunkAsView( ChunkPos ( pos).x, ChunkPos (pos).z ) as ? ChunkAccess )?.cache
287288 ?.firstOrNull { it.contains(pos!! ) }
288289 ?.areaOf(pos!! )
289290 }
You can’t perform that action at this time.
0 commit comments