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 Summary
Modifier and TypeClassDescription(package private) class
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static int
private static byte
private static byte
private static byte
private ChunkStatusUpdateListener
private it.unimi.dsi.fastutil.longs.Long2ByteMap
private ChunkMap.DistanceManager
private it.unimi.dsi.fastutil.longs.LongSet
private it.unimi.dsi.fastutil.ints.Int2ObjectMap<ChunkMap.TrackedEntity>
static int
private ChunkGenerator
(package private) ServerLevel
private ThreadedLevelLightEngine
private static org.apache.logging.log4j.Logger
private BlockableEventLoop<Runnable>
static int
static int
private static int
private boolean
private Supplier<DimensionDataStorage>
private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>
private PlayerMap
private PoiManager
private ChunkProgressListener
private ChunkTaskPriorityQueueSorter
private String
private StructureManager
private AtomicInteger
(package private) it.unimi.dsi.fastutil.longs.LongSet
private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>
(package private) int
private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder>
Fields inherited from class net.minecraft.world.level.chunk.storage.ChunkStorage
fixerUpper
-
Constructor Summary
ConstructorDescriptionChunkMap(ServerLevel p_143040_, LevelStorageSource.LevelStorageAccess p_143041_, com.mojang.datafixers.DataFixer p_143042_, StructureManager p_143043_, Executor p_143044_, BlockableEventLoop<Runnable> p_143045_, LightChunkGetter p_143046_, ChunkGenerator p_143047_, ChunkProgressListener p_143048_, ChunkStatusUpdateListener p_143049_, Supplier<DimensionDataStorage> p_143050_, int p_143051_, boolean p_143052_)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
protected void
broadcastAndSend(Entity p_140334_, Packet<?> p_140335_)
private static int
checkerboardDistance(ChunkPos p_140207_, int p_140208_, int p_140209_)
private static int
checkerboardDistance(ChunkPos p_140339_, ServerPlayer p_140340_, boolean p_140341_)
private static int
checkerboardDistance(ChunkPos p_143120_, Entity p_143121_)
void
close()
(package private) void
dumpChunks(Writer p_140275_)
private static double
euclideanDistanceSquared(ChunkPos p_140227_, Entity p_140228_)
getChunkDebugData(ChunkPos p_140205_)
protected IntSupplier
getChunkQueueLevel(long p_140372_)
private CompletableFuture<com.mojang.datafixers.util.Either<List<ChunkAccess>,ChunkHolder.ChunkLoadingFailure>>
getChunkRangeFuture(ChunkPos p_140211_, int p_140212_, IntFunction<ChunkStatus> p_140213_)
protected Iterable<ChunkHolder>
private ChunkStatus
getDependencyStatus(ChunkStatus p_140263_, int p_140264_)
protected DistanceManager
protected ThreadedLevelLightEngine
getPlayers(ChunkPos p_140252_, boolean p_140253_)
protected PoiManager
int
protected ChunkHolder
getUpdatingChunkIfPresent(long p_140175_)
protected ChunkHolder
getVisibleChunkIfPresent(long p_140328_)
private boolean
isExistingChunkFull(ChunkPos p_140426_)
private byte
markPosition(ChunkPos p_140230_, ChunkStatus.ChunkType p_140231_)
private void
markPositionReplaceable(ChunkPos p_140423_)
void
move(ServerPlayer p_140185_)
(package private) boolean
noPlayersCloseForSpawning(ChunkPos p_140398_)
(package private) void
onFullChunkStatusChange(ChunkPos p_143076_, ChunkHolder.FullChunkStatus p_143077_)
packTicks(LevelChunk p_140271_)
private void
playerLoadedChunk(ServerPlayer p_140196_, Packet<?>[] p_140197_, LevelChunk p_140198_)
private static void
postLoadProtoChunk(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(ChunkPos p_143118_)
CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>>
prepareTickingChunk(ChunkHolder p_143054_)
private static String
printFuture(CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> p_140279_)
private void
processUnloads(BooleanSupplier p_140354_)
protected boolean
private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>>
protoChunkToFullChunk(ChunkHolder p_140384_)
private CompoundTag
protected void
releaseLightTicket(ChunkPos p_140376_)
protected void
removeEntity(Entity p_140332_)
private boolean
save(ChunkAccess p_140259_)
protected void
saveAllChunks(boolean p_140319_)
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 void
scheduleUnload(long p_140182_, ChunkHolder p_140183_)
protected void
setViewDistance(int p_140168_)
int
size()
private boolean
skipPlayer(ServerPlayer p_140330_)
protected void
tick()
protected void
tick(BooleanSupplier p_140281_)
(package private) ChunkHolder
updateChunkScheduling(long p_140177_, int p_140178_, ChunkHolder p_140179_, int p_140180_)
protected void
updateChunkTracking(ServerPlayer p_140187_, ChunkPos p_140188_, Packet<?>[] p_140189_, boolean p_140190_, boolean p_140191_)
private SectionPos
updatePlayerPos(ServerPlayer p_140374_)
(package private) void
updatePlayerStatus(ServerPlayer p_140193_, boolean p_140194_)
Methods inherited from class net.minecraft.world.level.chunk.storage.ChunkStorage
flushWorker, getVersion, read, upgradeChunkTag, write
-
Field Details
-
CHUNK_TYPE_REPLACEABLE
private static final byte CHUNK_TYPE_REPLACEABLE- See Also:
- Constant Field Values
-
CHUNK_TYPE_UNKNOWN
private static final byte CHUNK_TYPE_UNKNOWN- See Also:
- Constant Field Values
-
CHUNK_TYPE_FULL
private static final byte CHUNK_TYPE_FULL- See Also:
- Constant Field Values
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
CHUNK_SAVED_PER_TICK
private static final int CHUNK_SAVED_PER_TICK- See Also:
- Constant Field Values
-
MIN_VIEW_DISTANCE
private static final int MIN_VIEW_DISTANCE- See Also:
- Constant Field Values
-
MAX_VIEW_DISTANCE
public static final int MAX_VIEW_DISTANCE- See Also:
- Constant Field Values
-
MAX_CHUNK_DISTANCE
public static final int MAX_CHUNK_DISTANCE -
FORCED_TICKET_LEVEL
public static final int FORCED_TICKET_LEVEL- See Also:
- Constant Field Values
-
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
final it.unimi.dsi.fastutil.longs.LongSet toDrop -
modified
private boolean modified -
queueSorter
-
worldgenMailbox
-
mainThreadMailbox
-
progressListener
-
chunkStatusListener
-
distanceManager
-
tickingGenerated
-
structureManager
-
storageName
-
playerMap
-
entityMap
-
chunkTypeCache
private final it.unimi.dsi.fastutil.longs.Long2ByteMap chunkTypeCache -
unloadQueue
-
viewDistance
int viewDistance
-
-
Constructor Details
-
ChunkMap
public ChunkMap(ServerLevel p_143040_, LevelStorageSource.LevelStorageAccess p_143041_, com.mojang.datafixers.DataFixer p_143042_, StructureManager p_143043_, Executor p_143044_, BlockableEventLoop<Runnable> p_143045_, LightChunkGetter p_143046_, ChunkGenerator p_143047_, ChunkProgressListener p_143048_, ChunkStatusUpdateListener p_143049_, Supplier<DimensionDataStorage> p_143050_, int p_143051_, boolean p_143052_)
-
-
Method Details
-
euclideanDistanceSquared
-
checkerboardDistance
private static int checkerboardDistance(ChunkPos p_140339_, ServerPlayer p_140340_, boolean p_140341_) -
checkerboardDistance
-
checkerboardDistance
-
getLightEngine
-
getUpdatingChunkIfPresent
-
getVisibleChunkIfPresent
-
getChunkQueueLevel
-
getChunkDebugData
-
getChunkRangeFuture
private CompletableFuture<com.mojang.datafixers.util.Either<List<ChunkAccess>,ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos p_140211_, int p_140212_, IntFunction<ChunkStatus> p_140213_) -
prepareEntityTickingChunk
public CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareEntityTickingChunk(ChunkPos p_143118_) -
updateChunkScheduling
@Nullable ChunkHolder updateChunkScheduling(long p_140177_, int p_140178_, @Nullable ChunkHolder p_140179_, int p_140180_) -
close
- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classChunkStorage
- Throws:
IOException
-
saveAllChunks
protected void saveAllChunks(boolean p_140319_) -
tick
-
processUnloads
-
scheduleUnload
-
promoteChunkMap
protected boolean promoteChunkMap() -
schedule
public CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> schedule(ChunkHolder p_140293_, ChunkStatus p_140294_) -
scheduleChunkLoad
private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos p_140418_) -
markPositionReplaceable
-
markPosition
-
scheduleChunkGeneration
private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> scheduleChunkGeneration(ChunkHolder p_140361_, ChunkStatus p_140362_) -
releaseLightTicket
-
getDependencyStatus
-
postLoadProtoChunk
-
protoChunkToFullChunk
private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> protoChunkToFullChunk(ChunkHolder p_140384_) -
prepareTickingChunk
public CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareTickingChunk(ChunkHolder p_143054_) -
prepareAccessibleChunk
public CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> prepareAccessibleChunk(ChunkHolder p_143110_) -
getTickingGenerated
public int getTickingGenerated() -
save
-
isExistingChunkFull
-
setViewDistance
protected void setViewDistance(int p_140168_) -
updateChunkTracking
protected void updateChunkTracking(ServerPlayer p_140187_, ChunkPos p_140188_, Packet<?>[] p_140189_, boolean p_140190_, boolean p_140191_) -
size
public int size() -
getDistanceManager
-
getChunks
-
dumpChunks
- Throws:
IOException
-
printFuture
private static String printFuture(CompletableFuture<com.mojang.datafixers.util.Either<LevelChunk,ChunkHolder.ChunkLoadingFailure>> p_140279_) -
readChunk
- Throws:
IOException
-
noPlayersCloseForSpawning
-
skipPlayer
-
updatePlayerStatus
-
updatePlayerPos
-
move
-
getPlayers
- Specified by:
getPlayers
in interfaceChunkHolder.PlayerProvider
-
addEntity
-
removeEntity
-
tick
protected void tick() -
broadcast
-
broadcastAndSend
-
playerLoadedChunk
private void playerLoadedChunk(ServerPlayer p_140196_, Packet<?>[] p_140197_, LevelChunk p_140198_) -
getPoiManager
-
getStorageName
-
packTicks
-
onFullChunkStatusChange
-