mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-22 08:07:51 +00:00
add caching option to config pack
This commit is contained in:
1 parent
8a2024e8d8
commit
78d34498d9
3 files changed
+12
-1
No files matched your search
+3
@@ -5,6 +5,7 @@ import com.dfsek.terra.api.world.biome.Biome;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import com.github.benmanes.caffeine.cache.Scheduler;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -25,6 +26,8 @@ public class CachingBiomeProvider implements BiomeProvider, Handle {
|
||||
this.res = delegate.resolution();
|
||||
this.cache = Caffeine
|
||||
.newBuilder()
|
||||
.scheduler(Scheduler.disabledScheduler())
|
||||
.initialCapacity(98304)
|
||||
.maximumSize(98304) // 1 full chunk (high res)
|
||||
.build(vec -> delegate.getBiome(vec.x * res, vec.y * res, vec.z * res, vec.seed));
|
||||
|
||||
|
||||
Reference in new issue
Block a user