Package net.minecraft.server.level
Class ChunkMap
java.lang.Object
net.minecraft.world.level.chunk.storage.ChunkStorage
net.minecraft.server.level.ChunkMap
- All Implemented Interfaces:
- AutoCloseable,- ChunkHolder.PlayerProvider
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescription(package private) class(package private) class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final byteprivate static final byteprivate static final byteprivate final ChunkGeneratorStructureStateprivate final it.unimi.dsi.fastutil.longs.Long2LongMapprivate final ChunkStatusUpdateListenerprivate final it.unimi.dsi.fastutil.longs.Long2ByteMapprivate final ChunkMap.DistanceManagerprivate static final intprivate final it.unimi.dsi.fastutil.longs.LongSetprivate final it.unimi.dsi.fastutil.ints.Int2ObjectMap<ChunkMap.TrackedEntity>static final intprivate ChunkGenerator(package private) final ServerLevelprivate final ThreadedLevelLightEngineprivate static final org.slf4j.Loggerprivate final BlockableEventLoop<Runnable>private final ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>>static final intstatic final intprivate booleanprivate final Supplier<DimensionDataStorage>private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>private final PlayerMapprivate final PoiManagerprivate final ChunkProgressListenerprivate final ChunkTaskPriorityQueueSorterprivate final RandomStateprivate intprivate final Stringprivate final StructureTemplateManagerprivate final AtomicInteger(package private) final it.unimi.dsi.fastutil.longs.LongSetprivate final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>private final ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>>Fields inherited from class net.minecraft.world.level.chunk.storage.ChunkStoragefixerUpper, LAST_MONOLYTH_STRUCTURE_DATA_VERSION
- 
Constructor SummaryConstructorsConstructorDescriptionChunkMap(ServerLevel p_214836_, LevelStorageSource.LevelStorageAccess p_214837_, com.mojang.datafixers.DataFixer p_214838_, StructureTemplateManager p_214839_, Executor p_214840_, BlockableEventLoop<Runnable> p_214841_, LightChunkGetter p_214842_, ChunkGenerator p_214843_, ChunkProgressListener p_214844_, ChunkStatusUpdateListener p_214845_, Supplier<DimensionDataStorage> p_214846_, int p_214847_, boolean p_214848_) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected void(package private) booleananyPlayerCloseEnoughForSpawning(ChunkPos p_183880_) private voidapplyChunkTrackingView(ServerPlayer p_294188_, ChunkTrackingView p_294174_) voidprotected voidbroadcastAndSend(Entity p_140334_, Packet<?> p_140335_) voidclose()private ChunkAccesscreateEmptyChunk(ChunkPos p_214962_) debugFuturesAndCreateReportedException(IllegalStateException p_203752_, String p_203753_) voidprivate static voiddropChunk(ServerPlayer p_294215_, ChunkPos p_294758_) (package private) voiddumpChunks(Writer p_140275_) private static doubleeuclideanDistanceSquared(ChunkPos p_140227_, Entity p_140228_) protected ChunkGeneratorprotected ChunkGeneratorStructureStategetChunkDebugData(ChunkPos p_140205_) protected IntSuppliergetChunkQueueLevel(long p_140372_) private CompletableFuture<com.mojang.datafixers.util.Either<List<ChunkAccess>,ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkHolder p_281446_, int p_282030_, IntFunction<ChunkStatus> p_282923_) protected Iterable<ChunkHolder>getChunkToSend(long p_300929_) private ChunkStatusgetDependencyStatus(ChunkStatus p_140263_, int p_140264_) protected ThreadedLevelLightEnginegetPlayers(ChunkPos p_183801_, boolean p_183802_) getPlayersCloseForSpawning(ChunkPos p_183889_) (package private) intgetPlayerViewDistance(ServerPlayer p_295024_) protected PoiManagerintprotected ChunkHoldergetUpdatingChunkIfPresent(long p_140175_) getVisibleChunkIfPresent(long p_140328_) private com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure> handleChunkLoadFailure(Throwable p_214902_, ChunkPos p_214903_) booleanhasWork()private static booleanisChunkDataValid(CompoundTag p_214941_) private booleanisChunkOnTrackedBorder(ServerPlayer p_295596_, int p_294838_, int p_295212_) (package private) booleanisChunkTracked(ServerPlayer p_295366_, int p_294911_, int p_296247_) private booleanisExistingChunkFull(ChunkPos p_140426_) private static voidmarkChunkPendingToSend(ServerPlayer p_295834_, LevelChunk p_296281_) private voidmarkChunkPendingToSend(ServerPlayer p_294638_, ChunkPos p_296183_) private bytemarkPosition(ChunkPos p_140230_, ChunkStatus.ChunkType p_140231_) private voidmarkPositionReplaceable(ChunkPos p_140423_) voidmove(ServerPlayer p_140185_) private voidonChunkReadyToSend(LevelChunk p_296003_) (package private) voidonFullChunkStatusChange(ChunkPos p_287612_, FullChunkStatus p_287685_) private booleanplayerIsCloseEnoughForSpawning(ServerPlayer p_183752_, ChunkPos p_183753_) private static voidpostLoadProtoChunk(ServerLevel p_143065_, List<CompoundTag> p_143066_) CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareAccessibleChunk(ChunkHolder p_143110_) CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareEntityTickingChunk(ChunkHolder p_281455_) CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareTickingChunk(ChunkHolder p_143054_) private static StringprintFuture(CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> p_140279_) private voidprocessUnloads(BooleanSupplier p_140354_) protected booleanprivate CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> protoChunkToFullChunk(ChunkHolder p_140384_) protected RandomStateprivate CompletableFuture<Optional<CompoundTag>>protected voidreleaseLightTicket(ChunkPos p_140376_) protected voidremoveEntity(Entity p_140332_) voidresendBiomesForChunks(List<ChunkAccess> p_275577_) private booleansave(ChunkAccess p_140259_) protected voidsaveAllChunks(boolean p_140319_) private booleansaveChunkIfNeeded(ChunkHolder p_198875_) CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> schedule(ChunkHolder p_140293_, ChunkStatus p_140294_) private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> scheduleChunkGeneration(ChunkHolder p_140361_, ChunkStatus p_140362_) private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos p_140418_) private voidscheduleUnload(long p_140182_, ChunkHolder p_140183_) protected voidsetServerViewDistance(int p_295758_) intsize()private booleanskipPlayer(ServerPlayer p_140330_) protected voidtick()protected voidtick(BooleanSupplier p_140281_) (package private) ChunkHolderupdateChunkScheduling(long p_140177_, int p_140178_, ChunkHolder p_140179_, int p_140180_) private voidupdateChunkTracking(ServerPlayer p_183755_) private voidupdatePlayerPos(ServerPlayer p_140374_) (package private) voidupdatePlayerStatus(ServerPlayer p_140193_, boolean p_140194_) private CompoundTagupgradeChunkTag(CompoundTag p_214948_) voidwaitForLightBeforeSending(ChunkPos p_301194_, int p_301130_) Methods inherited from class net.minecraft.world.level.chunk.storage.ChunkStoragechunkScanner, flushWorker, getVersion, injectDatafixingContext, isOldChunkAround, read, upgradeChunkTag, write
- 
Field Details- 
CHUNK_TYPE_REPLACEABLEprivate static final byte CHUNK_TYPE_REPLACEABLE- See Also:
 
- 
CHUNK_TYPE_UNKNOWNprivate static final byte CHUNK_TYPE_UNKNOWN- See Also:
 
- 
CHUNK_TYPE_FULLprivate static final byte CHUNK_TYPE_FULL- See Also:
 
- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
CHUNK_SAVED_PER_TICKprivate static final int CHUNK_SAVED_PER_TICK- See Also:
 
- 
CHUNK_SAVED_EAGERLY_PER_TICKprivate static final int CHUNK_SAVED_EAGERLY_PER_TICK- See Also:
 
- 
EAGER_CHUNK_SAVE_COOLDOWN_IN_MILLISprivate static final int EAGER_CHUNK_SAVE_COOLDOWN_IN_MILLIS- See Also:
 
- 
MIN_VIEW_DISTANCEpublic static final int MIN_VIEW_DISTANCE- See Also:
 
- 
MAX_VIEW_DISTANCEpublic static final int MAX_VIEW_DISTANCE- See Also:
 
- 
FORCED_TICKET_LEVELpublic static final int FORCED_TICKET_LEVEL
- 
updatingChunkMapprivate final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> updatingChunkMap
- 
visibleChunkMapprivate volatile it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> visibleChunkMap
- 
pendingUnloads
- 
entitiesInLevelprivate final it.unimi.dsi.fastutil.longs.LongSet entitiesInLevel
- 
level
- 
lightEngine
- 
mainThreadExecutor
- 
generator
- 
randomState
- 
chunkGeneratorState
- 
overworldDataStorage
- 
poiManager
- 
toDropfinal it.unimi.dsi.fastutil.longs.LongSet toDrop
- 
modifiedprivate boolean modified
- 
queueSorter
- 
worldgenMailbox
- 
mainThreadMailbox
- 
progressListener
- 
chunkStatusListener
- 
distanceManager
- 
tickingGenerated
- 
structureTemplateManager
- 
storageName
- 
playerMap
- 
entityMap
- 
chunkTypeCacheprivate final it.unimi.dsi.fastutil.longs.Long2ByteMap chunkTypeCache
- 
chunkSaveCooldownsprivate final it.unimi.dsi.fastutil.longs.Long2LongMap chunkSaveCooldowns
- 
unloadQueue
- 
serverViewDistanceprivate int serverViewDistance
 
- 
- 
Constructor Details- 
ChunkMappublic ChunkMap(ServerLevel p_214836_, LevelStorageSource.LevelStorageAccess p_214837_, com.mojang.datafixers.DataFixer p_214838_, StructureTemplateManager p_214839_, Executor p_214840_, BlockableEventLoop<Runnable> p_214841_, LightChunkGetter p_214842_, ChunkGenerator p_214843_, ChunkProgressListener p_214844_, ChunkStatusUpdateListener p_214845_, Supplier<DimensionDataStorage> p_214846_, int p_214847_, boolean p_214848_) 
 
- 
- 
Method Details- 
generator
- 
generatorState
- 
randomState
- 
debugReloadGeneratorpublic void debugReloadGenerator()
- 
euclideanDistanceSquared
- 
isChunkTracked
- 
isChunkOnTrackedBorder
- 
getLightEngine
- 
getUpdatingChunkIfPresent
- 
getVisibleChunkIfPresent
- 
getChunkQueueLevel
- 
getChunkDebugData
- 
getChunkRangeFutureprivate CompletableFuture<com.mojang.datafixers.util.Either<List<ChunkAccess>,ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkHolder p_281446_, int p_282030_, IntFunction<ChunkStatus> p_282923_) 
- 
debugFuturesAndCreateReportedExceptionpublic ReportedException debugFuturesAndCreateReportedException(IllegalStateException p_203752_, String p_203753_) 
- 
prepareEntityTickingChunkpublic CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareEntityTickingChunk(ChunkHolder p_281455_) 
- 
updateChunkScheduling@Nullable ChunkHolder updateChunkScheduling(long p_140177_, int p_140178_, @Nullable ChunkHolder p_140179_, int p_140180_) 
- 
close- Specified by:
- closein interface- AutoCloseable
- Overrides:
- closein class- ChunkStorage
- Throws:
- IOException
 
- 
saveAllChunksprotected void saveAllChunks(boolean p_140319_) 
- 
tick
- 
hasWorkpublic boolean hasWork()
- 
processUnloads
- 
scheduleUnload
- 
promoteChunkMapprotected boolean promoteChunkMap()
- 
schedulepublic CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> schedule(ChunkHolder p_140293_, ChunkStatus p_140294_) 
- 
scheduleChunkLoadprivate CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos p_140418_) 
- 
isChunkDataValid
- 
handleChunkLoadFailureprivate com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure> handleChunkLoadFailure(Throwable p_214902_, ChunkPos p_214903_) 
- 
createEmptyChunk
- 
markPositionReplaceable
- 
markPosition
- 
scheduleChunkGenerationprivate CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> scheduleChunkGeneration(ChunkHolder p_140361_, ChunkStatus p_140362_) 
- 
releaseLightTicket
- 
getDependencyStatus
- 
postLoadProtoChunk
- 
protoChunkToFullChunkprivate CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> protoChunkToFullChunk(ChunkHolder p_140384_) 
- 
prepareTickingChunkpublic CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareTickingChunk(ChunkHolder p_143054_) 
- 
onChunkReadyToSend
- 
prepareAccessibleChunkpublic CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareAccessibleChunk(ChunkHolder p_143110_) 
- 
getTickingGeneratedpublic int getTickingGenerated()
- 
saveChunkIfNeeded
- 
save
- 
isExistingChunkFull
- 
setServerViewDistanceprotected void setServerViewDistance(int p_295758_) 
- 
getPlayerViewDistance
- 
markChunkPendingToSend
- 
markChunkPendingToSend
- 
dropChunk
- 
getChunkToSend
- 
sizepublic int size()
- 
getDistanceManager
- 
getChunks
- 
dumpChunks- Throws:
- IOException
 
- 
printFutureprivate static String printFuture(CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> p_140279_) 
- 
readChunk
- 
upgradeChunkTag
- 
anyPlayerCloseEnoughForSpawning
- 
getPlayersCloseForSpawning
- 
playerIsCloseEnoughForSpawning
- 
skipPlayer
- 
updatePlayerStatus
- 
updatePlayerPos
- 
move
- 
updateChunkTracking
- 
applyChunkTrackingView
- 
getPlayers- Specified by:
- getPlayersin interface- ChunkHolder.PlayerProvider
 
- 
addEntity
- 
removeEntity
- 
tickprotected void tick()
- 
broadcast
- 
broadcastAndSend
- 
resendBiomesForChunks
- 
getPoiManager
- 
getStorageName
- 
onFullChunkStatusChange
- 
waitForLightBeforeSending
 
-