Package net.minecraft.world.server
Class ChunkManager
java.lang.Object
net.minecraft.world.chunk.storage.ChunkLoader
net.minecraft.world.server.ChunkManager
- All Implemented Interfaces:
AutoCloseable
,ChunkHolder.IPlayerProvider
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.longs.Long2ByteMap
private final ChunkManager.ProxyTicketManager
private final it.unimi.dsi.fastutil.longs.LongSet
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<ChunkManager.EntityTracker>
private final ChunkGenerator
private final ServerWorld
private final ServerWorldLightManager
private static final org.apache.logging.log4j.Logger
private final ThreadTaskExecutor<Runnable>
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.FunctionEntry<Runnable>>
static final int
private boolean
private final Supplier<DimensionSavedDataManager>
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>
private final PlayerGenerationTracker
private final PointOfInterestManager
private final IChunkStatusListener
private final ChunkTaskPriorityQueueSorter
private final File
private final TemplateManager
private final AtomicInteger
private final it.unimi.dsi.fastutil.longs.LongSet
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>
private int
private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.FunctionEntry<Runnable>>
Fields inherited from class net.minecraft.world.chunk.storage.ChunkLoader
fixerUpper
-
Constructor Summary
ConstructorDescriptionChunkManager
(ServerWorld p_i232602_1_, SaveFormat.LevelSave p_i232602_2_, com.mojang.datafixers.DataFixer p_i232602_3_, TemplateManager p_i232602_4_, Executor p_i232602_5_, ThreadTaskExecutor<Runnable> p_i232602_6_, IChunkLightProvider p_i232602_7_, ChunkGenerator p_i232602_8_, IChunkStatusListener p_i232602_9_, Supplier<DimensionSavedDataManager> p_i232602_10_, int p_i232602_11_, boolean p_i232602_12_) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
broadcastAndSend
(Entity p_219225_1_, IPacket<?> p_219225_2_) private static int
checkerboardDistance
(ChunkPos p_219232_0_, int p_219232_1_, int p_219232_2_) private static int
checkerboardDistance
(ChunkPos p_219215_0_, ServerPlayerEntity p_219215_1_, boolean p_219215_2_) void
close()
(package private) void
dumpChunks
(Writer p_225406_1_) private static double
euclideanDistanceSquared
(ChunkPos p_219217_0_, Entity p_219217_1_) getChunkDebugData
(ChunkPos p_219170_1_) protected IntSupplier
getChunkQueueLevel
(long p_219191_1_) private CompletableFuture<com.mojang.datafixers.util.Either<List<IChunk>,
ChunkHolder.IChunkLoadingError>> getChunkRangeFuture
(ChunkPos p_219236_1_, int p_219236_2_, IntFunction<ChunkStatus> p_219236_3_) protected Iterable<ChunkHolder>
private ChunkStatus
getDependencyStatus
(ChunkStatus p_219205_1_, int p_219205_2_) protected ChunkManager.ProxyTicketManager
CompletableFuture<com.mojang.datafixers.util.Either<Chunk,
ChunkHolder.IChunkLoadingError>> getEntityTickingRangeFuture
(ChunkPos p_219188_1_) protected ServerWorldLightManager
getPlayers
(ChunkPos p_219097_1_, boolean p_219097_2_) protected PointOfInterestManager
int
protected ChunkHolder
getUpdatingChunkIfPresent
(long p_219220_1_) protected ChunkHolder
getVisibleChunkIfPresent
(long p_219219_1_) private boolean
isExistingChunkFull
(ChunkPos p_241090_1_) private byte
markPosition
(ChunkPos p_241088_1_, ChunkStatus.Type p_241088_2_) private void
markPositionReplaceable
(ChunkPos p_241089_1_) void
move
(ServerPlayerEntity p_219183_1_) (package private) boolean
noPlayersCloseForSpawning
(ChunkPos p_219243_1_) private void
playerLoadedChunk
(ServerPlayerEntity p_219180_1_, IPacket<?>[] p_219180_2_, Chunk p_219180_3_) CompletableFuture<com.mojang.datafixers.util.Either<Chunk,
ChunkHolder.IChunkLoadingError>> postProcess
(ChunkHolder p_219179_1_) private static String
printFuture
(CompletableFuture<com.mojang.datafixers.util.Either<Chunk, ChunkHolder.IChunkLoadingError>> p_225402_0_) private void
processUnloads
(BooleanSupplier p_223155_1_) protected boolean
private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,
ChunkHolder.IChunkLoadingError>> protoChunkToFullChunk
(ChunkHolder p_219200_1_) private CompoundNBT
protected void
releaseLightTicket
(ChunkPos p_219209_1_) protected void
removeEntity
(Entity p_219231_1_) private boolean
protected void
saveAllChunks
(boolean p_219177_1_) CompletableFuture<com.mojang.datafixers.util.Either<IChunk,
ChunkHolder.IChunkLoadingError>> schedule
(ChunkHolder p_219244_1_, ChunkStatus p_219244_2_) private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,
ChunkHolder.IChunkLoadingError>> scheduleChunkGeneration
(ChunkHolder p_223156_1_, ChunkStatus p_223156_2_) private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,
ChunkHolder.IChunkLoadingError>> scheduleChunkLoad
(ChunkPos p_223172_1_) private void
scheduleUnload
(long p_219212_1_, ChunkHolder p_219212_3_) protected void
setViewDistance
(int p_219175_1_) int
size()
private boolean
skipPlayer
(ServerPlayerEntity p_219187_1_) protected void
tick()
protected void
tick
(BooleanSupplier p_219204_1_) CompletableFuture<com.mojang.datafixers.util.Either<Chunk,
ChunkHolder.IChunkLoadingError>> unpackTicks
(ChunkHolder p_222961_1_) private ChunkHolder
updateChunkScheduling
(long p_219213_1_, int p_219213_3_, ChunkHolder p_219213_4_, int p_219213_5_) protected void
updateChunkTracking
(ServerPlayerEntity p_219199_1_, ChunkPos p_219199_2_, IPacket<?>[] p_219199_3_, boolean p_219199_4_, boolean p_219199_5_) private SectionPos
updatePlayerPos
(ServerPlayerEntity p_223489_1_) (package private) void
updatePlayerStatus
(ServerPlayerEntity p_219234_1_, boolean p_219234_2_) Methods inherited from class net.minecraft.world.chunk.storage.ChunkLoader
flushWorker, getVersion, read, upgradeChunkTag, write
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
MAX_CHUNK_DISTANCE
public static final int MAX_CHUNK_DISTANCE -
updatingChunkMap
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> updatingChunkMap -
visibleChunkMap
private volatile it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> visibleChunkMap -
pendingUnloads
-
entitiesInLevel
private final it.unimi.dsi.fastutil.longs.LongSet entitiesInLevel -
level
-
lightEngine
-
mainThreadExecutor
-
generator
-
overworldDataStorage
-
poiManager
-
toDrop
private final it.unimi.dsi.fastutil.longs.LongSet toDrop -
modified
private boolean modified -
queueSorter
-
worldgenMailbox
-
mainThreadMailbox
-
progressListener
-
distanceManager
-
tickingGenerated
-
structureManager
-
storageFolder
-
playerMap
-
entityMap
-
chunkTypeCache
private final it.unimi.dsi.fastutil.longs.Long2ByteMap chunkTypeCache -
unloadQueue
-
viewDistance
private int viewDistance
-
-
Constructor Details
-
ChunkManager
public ChunkManager(ServerWorld p_i232602_1_, SaveFormat.LevelSave p_i232602_2_, com.mojang.datafixers.DataFixer p_i232602_3_, TemplateManager p_i232602_4_, Executor p_i232602_5_, ThreadTaskExecutor<Runnable> p_i232602_6_, IChunkLightProvider p_i232602_7_, ChunkGenerator p_i232602_8_, IChunkStatusListener p_i232602_9_, Supplier<DimensionSavedDataManager> p_i232602_10_, int p_i232602_11_, boolean p_i232602_12_)
-
-
Method Details
-
euclideanDistanceSquared
-
checkerboardDistance
private static int checkerboardDistance(ChunkPos p_219215_0_, ServerPlayerEntity p_219215_1_, boolean p_219215_2_) -
checkerboardDistance
-
getLightEngine
-
getUpdatingChunkIfPresent
-
getVisibleChunkIfPresent
-
getChunkQueueLevel
-
getChunkDebugData
-
getChunkRangeFuture
private CompletableFuture<com.mojang.datafixers.util.Either<List<IChunk>,ChunkHolder.IChunkLoadingError>> getChunkRangeFuture(ChunkPos p_219236_1_, int p_219236_2_, IntFunction<ChunkStatus> p_219236_3_) -
getEntityTickingRangeFuture
public CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.IChunkLoadingError>> getEntityTickingRangeFuture(ChunkPos p_219188_1_) -
updateChunkScheduling
@Nullable private ChunkHolder updateChunkScheduling(long p_219213_1_, int p_219213_3_, @Nullable ChunkHolder p_219213_4_, int p_219213_5_) -
close
- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classChunkLoader
- Throws:
IOException
-
saveAllChunks
protected void saveAllChunks(boolean p_219177_1_) -
tick
-
processUnloads
-
scheduleUnload
-
promoteChunkMap
protected boolean promoteChunkMap() -
schedule
public CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> schedule(ChunkHolder p_219244_1_, ChunkStatus p_219244_2_) -
scheduleChunkLoad
private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> scheduleChunkLoad(ChunkPos p_223172_1_) -
markPositionReplaceable
-
markPosition
-
scheduleChunkGeneration
private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> scheduleChunkGeneration(ChunkHolder p_223156_1_, ChunkStatus p_223156_2_) -
releaseLightTicket
-
getDependencyStatus
-
protoChunkToFullChunk
private CompletableFuture<com.mojang.datafixers.util.Either<IChunk,ChunkHolder.IChunkLoadingError>> protoChunkToFullChunk(ChunkHolder p_219200_1_) -
postProcess
public CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.IChunkLoadingError>> postProcess(ChunkHolder p_219179_1_) -
unpackTicks
public CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.IChunkLoadingError>> unpackTicks(ChunkHolder p_222961_1_) -
getTickingGenerated
public int getTickingGenerated() -
save
-
isExistingChunkFull
-
setViewDistance
protected void setViewDistance(int p_219175_1_) -
updateChunkTracking
protected void updateChunkTracking(ServerPlayerEntity p_219199_1_, ChunkPos p_219199_2_, IPacket<?>[] p_219199_3_, boolean p_219199_4_, boolean p_219199_5_) -
size
public int size() -
getDistanceManager
-
getChunks
-
dumpChunks
- Throws:
IOException
-
printFuture
private static String printFuture(CompletableFuture<com.mojang.datafixers.util.Either<Chunk, ChunkHolder.IChunkLoadingError>> p_225402_0_) -
readChunk
- Throws:
IOException
-
noPlayersCloseForSpawning
-
skipPlayer
-
updatePlayerStatus
-
updatePlayerPos
-
move
-
getPlayers
- Specified by:
getPlayers
in interfaceChunkHolder.IPlayerProvider
-
addEntity
-
removeEntity
-
tick
protected void tick() -
broadcast
-
broadcastAndSend
-
playerLoadedChunk
private void playerLoadedChunk(ServerPlayerEntity p_219180_1_, IPacket<?>[] p_219180_2_, Chunk p_219180_3_) -
getPoiManager
-
packTicks
-