Package net.minecraft.world.server
Class ServerChunkProvider
java.lang.Object
net.minecraft.world.chunk.AbstractChunkProvider
net.minecraft.world.server.ServerChunkProvider
- All Implemented Interfaces:
AutoCloseable,IChunkLightProvider
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<ChunkStatus>final ChunkManagerprivate final DimensionSavedDataManagerprivate final TicketManagerfinal ChunkGeneratorprivate final IChunk[]private final long[]private final ChunkStatus[]private longfinal ServerWorldprivate final ServerWorldLightManagerprivate final Threadprivate final ServerChunkProvider.ChunkExecutorprivate booleanprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionServerChunkProvider(ServerWorld p_i232603_1_, SaveFormat.LevelSave p_i232603_2_, com.mojang.datafixers.DataFixer p_i232603_3_, TemplateManager p_i232603_4_, Executor p_i232603_5_, ChunkGenerator p_i232603_6_, int p_i232603_7_, boolean p_i232603_8_, IChunkStatusListener p_i232603_9_, Supplier<DimensionSavedDataManager> p_i232603_10_) -
Method Summary
Modifier and TypeMethodDescriptionvoid<T> voidaddRegionTicket(TicketType<T> p_217228_1_, ChunkPos p_217228_2_, int p_217228_3_, T p_217228_4_) voidblockChanged(BlockPos p_217217_1_) voidvoidbroadcastAndSend(Entity p_217216_1_, IPacket<?> p_217216_2_) private booleancheckChunkFuture(long p_222872_1_, Function<ChunkHolder, CompletableFuture<com.mojang.datafixers.util.Either<Chunk, ChunkHolder.IChunkLoadingError>>> p_222872_3_) private booleanchunkAbsent(ChunkHolder p_217224_1_, int p_217224_2_) private voidvoidclose()getChunk(int p_212849_1_, int p_212849_2_, ChunkStatus p_212849_3_, boolean p_212849_4_) getChunkDebugData(ChunkPos p_217208_1_) getChunkForLighting(int p_217202_1_, int p_217202_2_) CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> getChunkFuture(int p_217232_1_, int p_217232_2_, ChunkStatus p_217232_3_, boolean p_217232_4_) private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> getChunkFutureMainThread(int p_217233_1_, int p_217233_2_, ChunkStatus p_217233_3_, boolean p_217233_4_) getChunkNow(int p_225313_1_, int p_225313_2_) private voidgetFullChunk(long p_241098_1_, Consumer<Chunk> p_241098_3_) getLevel()intintintprivate ChunkHoldergetVisibleChunkIfPresent(long p_217213_1_) booleanhasChunk(int p_73149_1_, int p_73149_2_) booleanisEntityTickingChunk(Entity p_217204_1_) booleanisEntityTickingChunk(ChunkPos p_222865_1_) booleanisTickingChunk(BlockPos p_222866_1_) voidmove(ServerPlayerEntity p_217221_1_) voidonLightUpdate(LightType p_217201_1_, SectionPos p_217201_2_) 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_217226_1_) <T> voidremoveRegionTicket(TicketType<T> p_217222_1_, ChunkPos p_217222_2_, int p_217222_3_, T p_217222_4_) private booleanvoidsave(boolean p_217210_1_) voidsetSpawnSettings(boolean p_217203_1_, boolean p_217203_2_) voidsetViewDistance(int p_217219_1_) private voidstoreInCache(long p_225315_1_, IChunk p_225315_3_, ChunkStatus p_225315_4_) voidtick(BooleanSupplier p_217207_1_) private voidvoidupdateChunkForced(ChunkPos p_217206_1_, boolean p_217206_2_) Methods inherited from class net.minecraft.world.chunk.AbstractChunkProvider
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 -
lastChunkPos
private final long[] lastChunkPos -
lastChunkStatus
-
lastChunk
-
lastSpawnState
-
-
Constructor Details
-
ServerChunkProvider
public ServerChunkProvider(ServerWorld p_i232603_1_, SaveFormat.LevelSave p_i232603_2_, com.mojang.datafixers.DataFixer p_i232603_3_, TemplateManager p_i232603_4_, Executor p_i232603_5_, ChunkGenerator p_i232603_6_, int p_i232603_7_, boolean p_i232603_8_, IChunkStatusListener p_i232603_9_, Supplier<DimensionSavedDataManager> p_i232603_10_)
-
-
Method Details
-
getLightEngine
- Specified by:
getLightEnginein classAbstractChunkProvider
-
getVisibleChunkIfPresent
-
getTickingGenerated
public int getTickingGenerated() -
storeInCache
-
getChunk
@Nullable public IChunk getChunk(int p_212849_1_, int p_212849_2_, ChunkStatus p_212849_3_, boolean p_212849_4_) - Specified by:
getChunkin classAbstractChunkProvider
-
getChunkNow
- Overrides:
getChunkNowin classAbstractChunkProvider
-
clearCache
private void clearCache() -
getChunkFuture
public CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> getChunkFuture(int p_217232_1_, int p_217232_2_, ChunkStatus p_217232_3_, boolean p_217232_4_) -
getChunkFutureMainThread
private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> getChunkFutureMainThread(int p_217233_1_, int p_217233_2_, ChunkStatus p_217233_3_, boolean p_217233_4_) -
chunkAbsent
-
hasChunk
public boolean hasChunk(int p_73149_1_, int p_73149_2_) - Overrides:
hasChunkin classAbstractChunkProvider
-
getChunkForLighting
- Specified by:
getChunkForLightingin interfaceIChunkLightProvider- Overrides:
getChunkForLightingin classAbstractChunkProvider
-
getLevel
-
pollTask
public boolean pollTask() -
runDistanceManagerUpdates
private boolean runDistanceManagerUpdates() -
isEntityTickingChunk
- Overrides:
isEntityTickingChunkin classAbstractChunkProvider
-
isEntityTickingChunk
- Overrides:
isEntityTickingChunkin classAbstractChunkProvider
-
isTickingChunk
- Overrides:
isTickingChunkin classAbstractChunkProvider
-
checkChunkFuture
private boolean checkChunkFuture(long p_222872_1_, Function<ChunkHolder, CompletableFuture<com.mojang.datafixers.util.Either<Chunk, ChunkHolder.IChunkLoadingError>>> p_222872_3_) -
save
public void save(boolean p_217210_1_) -
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractChunkProvider- Throws:
IOException
-
tick
-
tickChunks
private void tickChunks() -
getFullChunk
-
gatherStats
- Specified by:
gatherStatsin classAbstractChunkProvider
-
getPendingTasksCount
public int getPendingTasksCount() -
getGenerator
-
getLoadedChunksCount
public int getLoadedChunksCount() -
blockChanged
-
onLightUpdate
-
addRegionTicket
public <T> void addRegionTicket(TicketType<T> p_217228_1_, ChunkPos p_217228_2_, int p_217228_3_, T p_217228_4_) -
removeRegionTicket
public <T> void removeRegionTicket(TicketType<T> p_217222_1_, ChunkPos p_217222_2_, int p_217222_3_, T p_217222_4_) -
registerTickingTicket
-
releaseTickingTicket
-
updateChunkForced
- Overrides:
updateChunkForcedin classAbstractChunkProvider
-
move
-
removeEntity
-
addEntity
-
broadcastAndSend
-
broadcast
-
setViewDistance
public void setViewDistance(int p_217219_1_) -
setSpawnSettings
public void setSpawnSettings(boolean p_217203_1_, boolean p_217203_2_) - Overrides:
setSpawnSettingsin classAbstractChunkProvider
-
getChunkDebugData
-
getDataStorage
-
getPoiManager
-
getLastSpawnState
-