Package net.minecraft.server.level
Class ServerChunkCache
java.lang.Object
net.minecraft.world.level.chunk.ChunkSource
net.minecraft.server.level.ServerChunkCache
- All Implemented Interfaces:
- AutoCloseable,- LightChunkGetter,- IServerChunkCacheExtension
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescription(package private) static final record(package private) final class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final intprivate static final List<ChunkStatus>final ChunkMapprivate final DimensionDataStorageprivate final DistanceManagerprivate final ChunkAccess[]private final long[]private final ChunkStatus[]private longprivate NaturalSpawner.SpawnStatefinal ServerLevel(package private) final ThreadedLevelLightEngine(package private) final Threadprivate final ServerChunkCache.MainThreadExecutorprivate booleanprivate boolean
- 
Constructor SummaryConstructorsConstructorDescriptionServerChunkCache(ServerLevel p_214982_, LevelStorageSource.LevelStorageAccess p_214983_, com.mojang.datafixers.DataFixer p_214984_, StructureTemplateManager p_214985_, Executor p_214986_, ChunkGenerator p_214987_, int p_214988_, int p_214989_, boolean p_214990_, ChunkProgressListener p_214991_, ChunkStatusUpdateListener p_214992_, Supplier<DimensionDataStorage> p_214993_) 
- 
Method SummaryModifier and TypeMethodDescriptionvoid<T> voidaddRegionTicket(TicketType<T> p_8388_, ChunkPos p_8389_, int p_8390_, T p_8391_) <T> voidaddRegionTicket(TicketType<T> p_8388_, ChunkPos p_8389_, int p_8390_, T p_8391_, boolean forceTicks) voidblockChanged(BlockPos p_8451_) voidvoidbroadcastAndSend(Entity p_8395_, Packet<?> p_8396_) private booleanchunkAbsent(ChunkHolder p_8417_, int p_8418_) private voidvoidclose()getChunk(int p_8360_, int p_8361_, ChunkStatus p_8362_, boolean p_8363_) getChunkDebugData(ChunkPos p_8449_) getChunkForLighting(int p_8454_, int p_8455_) CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int p_8432_, int p_8433_, ChunkStatus p_8434_, boolean p_8435_) private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread(int p_8457_, int p_8458_, ChunkStatus p_8459_, boolean p_8460_) getChunkNow(int p_8357_, int p_8358_) private voidgetFullChunk(long p_8371_, Consumer<LevelChunk> p_8372_) getLevel()intintintprivate ChunkHoldergetVisibleChunkIfPresent(long p_8365_) booleanhasChunk(int p_8429_, int p_8430_) booleanisPositionTicking(long p_143240_) voidmove(ServerPlayer p_8386_) voidonLightUpdate(LightLayer p_8403_, SectionPos p_8404_) booleanpollTask()voidremoveEntity(Entity p_8444_) <T> voidremoveRegionTicket(TicketType<T> p_8439_, ChunkPos p_8440_, int p_8441_, T p_8442_) <T> voidremoveRegionTicket(TicketType<T> p_8439_, ChunkPos p_8440_, int p_8441_, T p_8442_, boolean forceTicks) void(package private) booleanvoidsave(boolean p_8420_) voidsetSimulationDistance(int p_184027_) voidsetSpawnSettings(boolean p_8425_, boolean p_8426_) voidsetViewDistance(int p_8355_) private voidstoreInCache(long p_8367_, ChunkAccess p_8368_, ChunkStatus p_8369_) voidtick(BooleanSupplier p_201913_, boolean p_201914_) private voidvoidupdateChunkForced(ChunkPos p_8400_, boolean p_8401_) Methods inherited from class net.minecraft.world.level.chunk.ChunkSourcegetChunkMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.IServerChunkCacheExtensionbroadcast, broadcastAndSend, self
- 
Field Details- 
CHUNK_STATUSES
- 
distanceManager
- 
level
- 
mainThread
- 
lightEngine
- 
mainThreadProcessor
- 
chunkMap
- 
dataStorage
- 
lastInhabitedUpdateprivate long lastInhabitedUpdate
- 
spawnEnemiesprivate boolean spawnEnemies
- 
spawnFriendliesprivate boolean spawnFriendlies
- 
CACHE_SIZEprivate static final int CACHE_SIZE- See Also:
 
- 
lastChunkPosprivate final long[] lastChunkPos
- 
lastChunkStatus
- 
lastChunk
- 
lastSpawnState
 
- 
- 
Constructor Details- 
ServerChunkCachepublic ServerChunkCache(ServerLevel p_214982_, LevelStorageSource.LevelStorageAccess p_214983_, com.mojang.datafixers.DataFixer p_214984_, StructureTemplateManager p_214985_, Executor p_214986_, ChunkGenerator p_214987_, int p_214988_, int p_214989_, boolean p_214990_, ChunkProgressListener p_214991_, ChunkStatusUpdateListener p_214992_, Supplier<DimensionDataStorage> p_214993_) 
 
- 
- 
Method Details- 
getLightEngine- Specified by:
- getLightEnginein class- ChunkSource
 
- 
getVisibleChunkIfPresent
- 
getTickingGeneratedpublic int getTickingGenerated()
- 
storeInCache
- 
getChunk@Nullable public ChunkAccess getChunk(int p_8360_, int p_8361_, ChunkStatus p_8362_, boolean p_8363_) - Specified by:
- getChunkin class- ChunkSource
 
- 
getChunkNow- Overrides:
- getChunkNowin class- ChunkSource
 
- 
clearCacheprivate void clearCache()
- 
getChunkFuturepublic CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int p_8432_, int p_8433_, ChunkStatus p_8434_, boolean p_8435_) 
- 
getChunkFutureMainThreadprivate CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread(int p_8457_, int p_8458_, ChunkStatus p_8459_, boolean p_8460_) 
- 
chunkAbsent
- 
hasChunkpublic boolean hasChunk(int p_8429_, int p_8430_) - Overrides:
- hasChunkin class- ChunkSource
 
- 
getChunkForLighting- Specified by:
- getChunkForLightingin interface- LightChunkGetter
- Overrides:
- getChunkForLightingin class- ChunkSource
 
- 
getLevel- Specified by:
- getLevelin interface- LightChunkGetter
 
- 
pollTaskpublic boolean pollTask()
- 
runDistanceManagerUpdatesboolean runDistanceManagerUpdates()
- 
isPositionTickingpublic boolean isPositionTicking(long p_143240_) 
- 
savepublic void save(boolean p_8420_) 
- 
close- Specified by:
- closein interface- AutoCloseable
- Overrides:
- closein class- ChunkSource
- Throws:
- IOException
 
- 
tick- Specified by:
- tickin class- ChunkSource
 
- 
tickChunksprivate void tickChunks()
- 
getFullChunk
- 
gatherStats- Specified by:
- gatherStatsin class- ChunkSource
 
- 
getPendingTasksCountpublic int getPendingTasksCount()
- 
getGenerator
- 
getGeneratorState
- 
randomState
- 
getLoadedChunksCountpublic int getLoadedChunksCount()- Specified by:
- getLoadedChunksCountin class- ChunkSource
 
- 
blockChanged
- 
onLightUpdate- Specified by:
- onLightUpdatein interface- LightChunkGetter
 
- 
addRegionTicket
- 
addRegionTicketpublic <T> void addRegionTicket(TicketType<T> p_8388_, ChunkPos p_8389_, int p_8390_, T p_8391_, boolean forceTicks) 
- 
removeRegionTicket
- 
removeRegionTicketpublic <T> void removeRegionTicket(TicketType<T> p_8439_, ChunkPos p_8440_, int p_8441_, T p_8442_, boolean forceTicks) 
- 
updateChunkForced- Overrides:
- updateChunkForcedin class- ChunkSource
 
- 
move
- 
removeEntity
- 
addEntity
- 
broadcastAndSend
- 
broadcast
- 
setViewDistancepublic void setViewDistance(int p_8355_) 
- 
setSimulationDistancepublic void setSimulationDistance(int p_184027_) 
- 
setSpawnSettingspublic void setSpawnSettings(boolean p_8425_, boolean p_8426_) - Overrides:
- setSpawnSettingsin class- ChunkSource
 
- 
getChunkDebugData
- 
getDataStorage
- 
getPoiManager
- 
chunkScanner
- 
getLastSpawnState
- 
removeTicketsOnClosingpublic void removeTicketsOnClosing()
 
-