This commit is contained in:
DBotThePony 2025-03-25 11:52:59 +07:00
parent 9577e205e7
commit 2993ae61ca
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -16,6 +16,7 @@ import net.minecraft.Util
import net.minecraft.core.BlockPos import net.minecraft.core.BlockPos
import net.minecraft.core.Holder import net.minecraft.core.Holder
import net.minecraft.core.SectionPos import net.minecraft.core.SectionPos
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.level.ChunkPos import net.minecraft.world.level.ChunkPos
import net.minecraft.world.level.WorldGenLevel import net.minecraft.world.level.WorldGenLevel
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature import net.minecraft.world.level.levelgen.feature.ConfiguredFeature
@ -173,10 +174,10 @@ object EnhancedPlacedFeature : Feature<EnhancedPlacedFeature.Config>(
.executor(Util.backgroundExecutor()) .executor(Util.backgroundExecutor())
.expireAfterAccess(Duration.ofMinutes(10)) .expireAfterAccess(Duration.ofMinutes(10))
.weakKeys() .weakKeys()
.build<WorldGenLevel, Cache<ChunkPos, GeneratedChunk>>() .build<ServerLevel, Cache<ChunkPos, GeneratedChunk>>()
private fun getCache(level: WorldGenLevel): Cache<ChunkPos, GeneratedChunk> { private fun getCache(level: WorldGenLevel): Cache<ChunkPos, GeneratedChunk> {
return level2cache.get(level) { return level2cache.get(level.level) {
Caffeine.newBuilder() Caffeine.newBuilder()
.scheduler(Scheduler.systemScheduler()) .scheduler(Scheduler.systemScheduler())
.executor(Util.backgroundExecutor()) .executor(Util.backgroundExecutor())