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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static intprivate static List<ChunkStatus>private DimensionDataStorageprivate DistanceManagerprivate ChunkAccess[]private long[]private ChunkStatus[]private longprivate NaturalSpawner.SpawnState(package private) ThreadedLevelLightEngine(package private) Threadprivate booleanprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionServerChunkCache(ServerLevel p_143228_, LevelStorageSource.LevelStorageAccess p_143229_, com.mojang.datafixers.DataFixer p_143230_, StructureManager p_143231_, Executor p_143232_, ChunkGenerator p_143233_, int p_143234_, boolean p_143235_, ChunkProgressListener p_143236_, ChunkStatusUpdateListener p_143237_, Supplier<DimensionDataStorage> p_143238_) -
Method Summary
Modifier and TypeMethodDescriptionvoid<T> voidaddRegionTicket(TicketType<T> p_8388_, ChunkPos p_8389_, int p_8390_, T p_8391_)voidblockChanged(BlockPos p_8451_)voidvoidbroadcastAndSend(Entity p_8395_, Packet<?> p_8396_)private booleancheckChunkFuture(long p_8374_, Function<ChunkHolder,CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>>> p_8375_)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()<T> voidregisterTickingTicket(TicketType<T> type, ChunkPos pos, int distance, T value)<T> voidreleaseTickingTicket(TicketType<T> type, ChunkPos pos, int distance, T value)voidremoveEntity(Entity p_8444_)<T> voidremoveRegionTicket(TicketType<T> p_8439_, ChunkPos p_8440_, int p_8441_, T p_8442_)(package private) booleanvoidsave(boolean p_8420_)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_8415_)private voidvoidupdateChunkForced(ChunkPos p_8400_, boolean p_8401_)Methods inherited from class net.minecraft.world.level.chunk.ChunkSource
getChunk
-
Field Details
-
CHUNK_STATUSES
-
distanceManager
-
generator
-
level
-
mainThread
-
lightEngine
-
mainThreadProcessor
-
chunkMap
-
dataStorage
-
lastInhabitedUpdate
private long lastInhabitedUpdate -
spawnEnemies
private boolean spawnEnemies -
spawnFriendlies
private boolean spawnFriendlies -
CACHE_SIZE
private static final int CACHE_SIZE- See Also:
- Constant Field Values
-
lastChunkPos
private final long[] lastChunkPos -
lastChunkStatus
-
lastChunk
-
lastSpawnState
-
-
Constructor Details
-
ServerChunkCache
public ServerChunkCache(ServerLevel p_143228_, LevelStorageSource.LevelStorageAccess p_143229_, com.mojang.datafixers.DataFixer p_143230_, StructureManager p_143231_, Executor p_143232_, ChunkGenerator p_143233_, int p_143234_, boolean p_143235_, ChunkProgressListener p_143236_, ChunkStatusUpdateListener p_143237_, Supplier<DimensionDataStorage> p_143238_)
-
-
Method Details
-
getLightEngine
- Specified by:
getLightEnginein classChunkSource
-
getVisibleChunkIfPresent
-
getTickingGenerated
public int getTickingGenerated() -
storeInCache
-
getChunk
@Nullable public ChunkAccess getChunk(int p_8360_, int p_8361_, ChunkStatus p_8362_, boolean p_8363_)- Specified by:
getChunkin classChunkSource
-
getChunkNow
- Overrides:
getChunkNowin classChunkSource
-
clearCache
private void clearCache() -
getChunkFuture
public CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int p_8432_, int p_8433_, ChunkStatus p_8434_, boolean p_8435_) -
getChunkFutureMainThread
private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread(int p_8457_, int p_8458_, ChunkStatus p_8459_, boolean p_8460_) -
chunkAbsent
-
hasChunk
public boolean hasChunk(int p_8429_, int p_8430_)- Overrides:
hasChunkin classChunkSource
-
getChunkForLighting
- Specified by:
getChunkForLightingin interfaceLightChunkGetter- Overrides:
getChunkForLightingin classChunkSource
-
getLevel
-
pollTask
public boolean pollTask() -
runDistanceManagerUpdates
boolean runDistanceManagerUpdates() -
isPositionTicking
public boolean isPositionTicking(long p_143240_) -
checkChunkFuture
private boolean checkChunkFuture(long p_8374_, Function<ChunkHolder,CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>>> p_8375_) -
save
public void save(boolean p_8420_) -
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classChunkSource- Throws:
IOException
-
tick
- Specified by:
tickin classChunkSource
-
tickChunks
private void tickChunks() -
getFullChunk
-
gatherStats
- Specified by:
gatherStatsin classChunkSource
-
getPendingTasksCount
public int getPendingTasksCount() -
getGenerator
-
getLoadedChunksCount
public int getLoadedChunksCount()- Specified by:
getLoadedChunksCountin classChunkSource
-
blockChanged
-
onLightUpdate
-
addRegionTicket
-
removeRegionTicket
public <T> void removeRegionTicket(TicketType<T> p_8439_, ChunkPos p_8440_, int p_8441_, T p_8442_) -
registerTickingTicket
-
releaseTickingTicket
-
updateChunkForced
- Overrides:
updateChunkForcedin classChunkSource
-
move
-
removeEntity
-
addEntity
-
broadcastAndSend
-
broadcast
-
setViewDistance
public void setViewDistance(int p_8355_) -
setSpawnSettings
public void setSpawnSettings(boolean p_8425_, boolean p_8426_)- Overrides:
setSpawnSettingsin classChunkSource
-
getChunkDebugData
-
getDataStorage
-
getPoiManager
-
getLastSpawnState
-