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
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final List<ChunkStatus>
final ChunkManager
private final DimensionSavedDataManager
private final TicketManager
final ChunkGenerator
private final IChunk[]
private final long[]
private final ChunkStatus[]
private long
final ServerWorld
private final ServerWorldLightManager
private final Thread
private final ServerChunkProvider.ChunkExecutor
private boolean
private boolean
-
Constructor Summary
ConstructorDescriptionServerChunkProvider
(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> void
addRegionTicket
(TicketType<T> p_217228_1_, ChunkPos p_217228_2_, int p_217228_3_, T p_217228_4_) void
blockChanged
(BlockPos p_217217_1_) void
void
broadcastAndSend
(Entity p_217216_1_, IPacket<?> p_217216_2_) private boolean
checkChunkFuture
(long p_222872_1_, Function<ChunkHolder, CompletableFuture<com.mojang.datafixers.util.Either<Chunk, ChunkHolder.IChunkLoadingError>>> p_222872_3_) private boolean
chunkAbsent
(ChunkHolder p_217224_1_, int p_217224_2_) private void
void
close()
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 void
getFullChunk
(long p_241098_1_, Consumer<Chunk> p_241098_3_) getLevel()
int
int
int
private ChunkHolder
getVisibleChunkIfPresent
(long p_217213_1_) boolean
hasChunk
(int p_73149_1_, int p_73149_2_) boolean
isEntityTickingChunk
(Entity p_217204_1_) boolean
isEntityTickingChunk
(ChunkPos p_222865_1_) boolean
isTickingChunk
(BlockPos p_222866_1_) void
move
(ServerPlayerEntity p_217221_1_) void
onLightUpdate
(LightType p_217201_1_, SectionPos p_217201_2_) boolean
pollTask()
<T> void
registerTickingTicket
(TicketType<T> type, ChunkPos pos, int distance, T value) <T> void
releaseTickingTicket
(TicketType<T> type, ChunkPos pos, int distance, T value) void
removeEntity
(Entity p_217226_1_) <T> void
removeRegionTicket
(TicketType<T> p_217222_1_, ChunkPos p_217222_2_, int p_217222_3_, T p_217222_4_) private boolean
void
save
(boolean p_217210_1_) void
setSpawnSettings
(boolean p_217203_1_, boolean p_217203_2_) void
setViewDistance
(int p_217219_1_) private void
storeInCache
(long p_225315_1_, IChunk p_225315_3_, ChunkStatus p_225315_4_) void
tick
(BooleanSupplier p_217207_1_) private void
void
updateChunkForced
(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:
getLightEngine
in 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:
getChunk
in classAbstractChunkProvider
-
getChunkNow
- Overrides:
getChunkNow
in 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:
hasChunk
in classAbstractChunkProvider
-
getChunkForLighting
- Specified by:
getChunkForLighting
in interfaceIChunkLightProvider
- Overrides:
getChunkForLighting
in classAbstractChunkProvider
-
getLevel
-
pollTask
public boolean pollTask() -
runDistanceManagerUpdates
private boolean runDistanceManagerUpdates() -
isEntityTickingChunk
- Overrides:
isEntityTickingChunk
in classAbstractChunkProvider
-
isEntityTickingChunk
- Overrides:
isEntityTickingChunk
in classAbstractChunkProvider
-
isTickingChunk
- Overrides:
isTickingChunk
in 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:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractChunkProvider
- Throws:
IOException
-
tick
-
tickChunks
private void tickChunks() -
getFullChunk
-
gatherStats
- Specified by:
gatherStats
in 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:
updateChunkForced
in 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:
setSpawnSettings
in classAbstractChunkProvider
-
getChunkDebugData
-
getDataStorage
-
getPoiManager
-
getLastSpawnState
-