Skip to content

Commit

Permalink
feat: disable map unloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce0203 committed Aug 8, 2023
1 parent e37f26d commit 1f31437
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions modules/world/src/main/kotlin/io/github/inggameteam/world/Fawe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ open class FaweImpl(val plugin: Plugin) : Fawe {
}

override fun unloadChunk(location: Location, file: File) {
// try {
// if (file.exists().not()) return
// FaweAPI.load(file).apply {
// measureTimeMillis {
// for (addX in minimumPoint.x..maximumPoint.x)
// for (addY in minimumPoint.y..maximumPoint.y)
// {
// val world = location.world!!
// PaperLib.getChunkAtAsync(world, location.blockX + addX, location.blockZ + addY, false).get().unload(false)
//// world.unloadChunk(location.blockX + addX, location.blockZ + addY)
// }
// }.apply { println("measureChunkUnloadTimeMillis: $this") }
// }
// } catch (e: Exception) {
// e.printStackTrace()
// }
try {
if (file.exists().not()) return
FaweAPI.load(file).apply {
measureTimeMillis {
for (addX in minimumPoint.x..maximumPoint.x)
for (addY in minimumPoint.y..maximumPoint.y)
{
val world = location.world!!
PaperLib.getChunkAtAsync(world, location.blockX + addX, location.blockZ + addY, false).get().unload(false)
// world.unloadChunk(location.blockX + addX, location.blockZ + addY)
}
}.apply { println("measureChunkUnloadTimeMillis: $this") }
}
} catch (e: Exception) {
e.printStackTrace()
}
}

override fun paste(location: Location, file: File) {
Expand Down

0 comments on commit 1f31437

Please sign in to comment.