类 ChunkMap
java.lang.Object
net.minecraft.world.level.chunk.storage.ChunkStorage
net.minecraft.server.level.ChunkMap
public class ChunkMap
extends ChunkStorage
implements ChunkHolder.PlayerProvider, GeneratingChunkMap
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private final AtomicInteger
private static final int
private static final int
private static final byte
private static final byte
private static final byte
private final ChunkGeneratorStructureState
private final ChunkStatusUpdateListener
private final it.unimi.dsi.fastutil.longs.LongSet
private final it.unimi.dsi.fastutil.longs.Long2ByteMap
private final ChunkMap.DistanceManager
private static final int
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap
<ChunkMap.TrackedEntity> static final int
(专用程序包) final ServerLevel
private final ThreadedLevelLightEngine
private final ChunkTaskDispatcher
private static final org.slf4j.Logger
private final BlockableEventLoop
<Runnable> private static final int
static final int
static final int
private boolean
private final it.unimi.dsi.fastutil.longs.Long2LongMap
private final Supplier
<DimensionDataStorage> private final List
<ChunkGenerationTask> private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap
<ChunkHolder> private final PlayerMap
private final PoiManager
private final ChunkProgressListener
private final RandomState
private int
private final String
private final AtomicInteger
(专用程序包) final it.unimi.dsi.fastutil.longs.LongSet
private static final CompletableFuture
<ChunkResult<List<ChunkAccess>>> private static final ChunkResult
<List<ChunkAccess>> private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap
<ChunkHolder> private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap
<ChunkHolder> private final WorldGenContext
private final ChunkTaskDispatcher
从类继承的字段 net.minecraft.world.level.chunk.storage.ChunkStorage
fixerUpper, LAST_MONOLYTH_STRUCTURE_DATA_VERSION
-
构造器概要
构造器构造器说明ChunkMap
(ServerLevel p_214836_, LevelStorageSource.LevelStorageAccess p_214837_, com.mojang.datafixers.DataFixer p_214838_, StructureTemplateManager p_214839_, Executor p_214840_, BlockableEventLoop<Runnable> p_214841_, LightChunkGetter p_214842_, ChunkGenerator p_214843_, ChunkProgressListener p_214844_, ChunkStatusUpdateListener p_214845_, Supplier<DimensionDataStorage> p_214846_, int p_214847_, boolean p_214848_) -
方法概要
修饰符和类型方法说明acquireGeneration
(long p_344717_) protected void
(专用程序包) boolean
anyPlayerCloseEnoughForSpawning
(ChunkPos p_183880_) private boolean
anyPlayerCloseEnoughForSpawningInternal
(ChunkPos p_365445_) private void
applyChunkTrackingView
(ServerPlayer p_301380_, ChunkTrackingView p_301057_) applyStep
(GenerationChunkHolder p_344519_, ChunkStep p_344471_, StaticCache2D<GenerationChunkHolder> p_343410_) void
protected void
broadcastAndSend
(Entity p_140334_, Packet<?> p_140335_) void
close()
private ChunkAccess
createEmptyChunk
(ChunkPos p_214962_) debugFuturesAndCreateReportedException
(IllegalStateException p_203752_, String p_203753_) private static void
dropChunk
(ServerPlayer p_300364_, ChunkPos p_299541_) (专用程序包) void
dumpChunks
(Writer p_140275_) private static double
euclideanDistanceSquared
(ChunkPos p_140227_, Entity p_140228_) private void
forEachChunk
(it.unimi.dsi.fastutil.longs.LongIterator longiterator, Predicate<ChunkPos> filter, Consumer<ChunkHolder> p_364582_) FORGE: commonize logic between forEachSpawnCandidateChunk and forEachForcedChunk(专用程序包) void
forEachForcedChunk
(Consumer<ChunkHolder> callback) FORGE: grab forced chunks, use forEachChunk to avoid duplicate logic(专用程序包) void
forEachSpawnCandidateChunk
(Consumer<ChunkHolder> p_364582_) protected ChunkGenerator
protected ChunkGeneratorStructureState
getChunkDebugData
(ChunkPos p_140205_) protected IntSupplier
getChunkQueueLevel
(long p_140372_) private CompletableFuture
<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture
(ChunkHolder p_281446_, int p_282030_, IntFunction<ChunkStatus> p_282923_) protected Iterable
<ChunkHolder> getChunkToSend
(long p_299683_) protected ThreadedLevelLightEngine
getPlayers
(ChunkPos p_183801_, boolean p_183802_) getPlayersCloseForSpawning
(ChunkPos p_183889_) (专用程序包) int
getPlayerViewDistance
(ServerPlayer p_298592_) protected PoiManager
int
protected ChunkHolder
getUpdatingChunkIfPresent
(long p_140175_) protected ChunkHolder
getVisibleChunkIfPresent
(long p_140328_) private ChunkAccess
handleChunkLoadFailure
(Throwable p_214902_, ChunkPos p_214903_) (专用程序包) boolean
FORGE: check if there are any forced chunksboolean
hasWork()
private boolean
isChunkOnTrackedBorder
(ServerPlayer p_299796_, int p_300477_, int p_298067_) (专用程序包) boolean
isChunkTracked
(ServerPlayer p_297550_, int p_301041_, int p_300379_) private boolean
isExistingChunkFull
(ChunkPos p_140426_) private static void
markChunkPendingToSend
(ServerPlayer p_299135_, LevelChunk p_301128_) private void
markChunkPendingToSend
(ServerPlayer p_297974_, ChunkPos p_298062_) private byte
markPosition
(ChunkPos p_140230_, ChunkType p_328844_) private void
markPositionReplaceable
(ChunkPos p_140423_) void
move
(ServerPlayer p_140185_) private void
onChunkReadyToSend
(ChunkHolder p_370260_, LevelChunk p_299599_) (专用程序包) void
onFullChunkStatusChange
(ChunkPos p_287612_, FullChunkStatus p_287685_) private void
onLevelChange
(ChunkPos p_364597_, IntSupplier p_362051_, int p_368537_, IntConsumer p_367036_) private boolean
playerIsCloseEnoughForSpawning
(ServerPlayer p_183752_, ChunkPos p_183753_) prepareAccessibleChunk
(ChunkHolder p_143110_) prepareEntityTickingChunk
(ChunkHolder p_281455_) prepareTickingChunk
(ChunkHolder p_143054_) private static String
printFuture
(CompletableFuture<ChunkResult<LevelChunk>> p_140279_) private void
processUnloads
(BooleanSupplier p_140354_) protected boolean
protected RandomState
private CompletableFuture
<Optional<CompoundTag>> void
releaseGeneration
(GenerationChunkHolder p_343926_) protected void
removeEntity
(Entity p_140332_) void
resendBiomesForChunks
(List<ChunkAccess> p_275577_) private void
runGenerationTask
(ChunkGenerationTask p_344392_) void
private boolean
save
(ChunkAccess p_140259_) protected void
saveAllChunks
(boolean p_140319_) private boolean
saveChunkIfNeeded
(ChunkHolder p_198875_, long p_368144_) private void
saveChunksEagerly
(BooleanSupplier p_362354_) private CompletableFuture
<ChunkAccess> scheduleChunkLoad
(ChunkPos p_140418_) scheduleGenerationTask
(ChunkStatus p_345229_, ChunkPos p_342957_) private void
scheduleUnload
(long p_140182_, ChunkHolder p_140183_) private void
setChunkUnsaved
(ChunkPos p_366347_) protected void
setServerViewDistance
(int p_300944_) int
size()
private boolean
skipPlayer
(ServerPlayer p_140330_) protected void
tick()
protected void
tick
(BooleanSupplier p_140281_) (专用程序包) ChunkHolder
updateChunkScheduling
(long p_140177_, int p_140178_, ChunkHolder p_140179_, int p_140180_) private void
updateChunkTracking
(ServerPlayer p_183755_) private void
updatePlayerPos
(ServerPlayer p_140374_) (专用程序包) void
updatePlayerStatus
(ServerPlayer p_140193_, boolean p_140194_) private CompoundTag
upgradeChunkTag
(CompoundTag p_214948_) void
waitForLightBeforeSending
(ChunkPos p_297696_, int p_300649_) 从类继承的方法 net.minecraft.world.level.chunk.storage.ChunkStorage
chunkScanner, flushWorker, getVersion, handleLegacyStructureIndex, injectDatafixingContext, isOldChunkAround, read, storageInfo, upgradeChunkTag, write
-
字段详细资料
-
UNLOADED_CHUNK_LIST_RESULT
-
UNLOADED_CHUNK_LIST_FUTURE
-
CHUNK_TYPE_REPLACEABLE
private static final byte CHUNK_TYPE_REPLACEABLE- 另请参阅:
-
CHUNK_TYPE_UNKNOWN
private static final byte CHUNK_TYPE_UNKNOWN- 另请参阅:
-
CHUNK_TYPE_FULL
private static final byte CHUNK_TYPE_FULL- 另请参阅:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CHUNK_SAVED_PER_TICK
private static final int CHUNK_SAVED_PER_TICK- 另请参阅:
-
CHUNK_SAVED_EAGERLY_PER_TICK
private static final int CHUNK_SAVED_EAGERLY_PER_TICK- 另请参阅:
-
EAGER_CHUNK_SAVE_COOLDOWN_IN_MILLIS
private static final int EAGER_CHUNK_SAVE_COOLDOWN_IN_MILLIS- 另请参阅:
-
MAX_ACTIVE_CHUNK_WRITES
private static final int MAX_ACTIVE_CHUNK_WRITES- 另请参阅:
-
MIN_VIEW_DISTANCE
public static final int MIN_VIEW_DISTANCE- 另请参阅:
-
MAX_VIEW_DISTANCE
public static final int MAX_VIEW_DISTANCE- 另请参阅:
-
FORCED_TICKET_LEVEL
public static final int FORCED_TICKET_LEVEL -
updatingChunkMap
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> updatingChunkMap -
visibleChunkMap
private volatile it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> visibleChunkMap -
pendingUnloads
-
pendingGenerationTasks
-
level
-
lightEngine
-
mainThreadExecutor
-
randomState
-
chunkGeneratorState
-
overworldDataStorage
-
poiManager
-
toDrop
final it.unimi.dsi.fastutil.longs.LongSet toDrop -
modified
private boolean modified -
worldgenTaskDispatcher
-
lightTaskDispatcher
-
progressListener
-
chunkStatusListener
-
distanceManager
-
tickingGenerated
-
storageName
-
playerMap
-
entityMap
-
chunkTypeCache
private final it.unimi.dsi.fastutil.longs.Long2ByteMap chunkTypeCache -
nextChunkSaveTime
private final it.unimi.dsi.fastutil.longs.Long2LongMap nextChunkSaveTime -
chunksToEagerlySave
private final it.unimi.dsi.fastutil.longs.LongSet chunksToEagerlySave -
unloadQueue
-
activeChunkWrites
-
serverViewDistance
private int serverViewDistance -
worldGenContext
-
-
构造器详细资料
-
ChunkMap
public ChunkMap(ServerLevel p_214836_, LevelStorageSource.LevelStorageAccess p_214837_, com.mojang.datafixers.DataFixer p_214838_, StructureTemplateManager p_214839_, Executor p_214840_, BlockableEventLoop<Runnable> p_214841_, LightChunkGetter p_214842_, ChunkGenerator p_214843_, ChunkProgressListener p_214844_, ChunkStatusUpdateListener p_214845_, Supplier<DimensionDataStorage> p_214846_, int p_214847_, boolean p_214848_)
-
-
方法详细资料
-
setChunkUnsaved
-
generator
-
generatorState
-
randomState
-
euclideanDistanceSquared
-
isChunkTracked
-
isChunkOnTrackedBorder
-
getLightEngine
-
getUpdatingChunkIfPresent
-
getVisibleChunkIfPresent
-
getChunkQueueLevel
-
getChunkDebugData
-
getChunkRangeFuture
private CompletableFuture<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture(ChunkHolder p_281446_, int p_282030_, IntFunction<ChunkStatus> p_282923_) -
debugFuturesAndCreateReportedException
public ReportedException debugFuturesAndCreateReportedException(IllegalStateException p_203752_, String p_203753_) -
prepareEntityTickingChunk
-
updateChunkScheduling
@Nullable ChunkHolder updateChunkScheduling(long p_140177_, int p_140178_, @Nullable ChunkHolder p_140179_, int p_140180_) -
onLevelChange
private void onLevelChange(ChunkPos p_364597_, IntSupplier p_362051_, int p_368537_, IntConsumer p_367036_) -
close
- 指定者:
close
在接口中AutoCloseable
- 覆盖:
close
在类中ChunkStorage
- 抛出:
IOException
-
saveAllChunks
protected void saveAllChunks(boolean p_140319_) -
tick
-
hasWork
public boolean hasWork() -
processUnloads
-
saveChunksEagerly
-
scheduleUnload
-
promoteChunkMap
protected boolean promoteChunkMap() -
scheduleChunkLoad
-
handleChunkLoadFailure
-
createEmptyChunk
-
markPositionReplaceable
-
markPosition
-
acquireGeneration
- 指定者:
acquireGeneration
在接口中GeneratingChunkMap
-
releaseGeneration
- 指定者:
releaseGeneration
在接口中GeneratingChunkMap
-
applyStep
public CompletableFuture<ChunkAccess> applyStep(GenerationChunkHolder p_344519_, ChunkStep p_344471_, StaticCache2D<GenerationChunkHolder> p_343410_) - 指定者:
applyStep
在接口中GeneratingChunkMap
-
scheduleGenerationTask
- 指定者:
scheduleGenerationTask
在接口中GeneratingChunkMap
-
runGenerationTask
-
runGenerationTasks
public void runGenerationTasks()- 指定者:
runGenerationTasks
在接口中GeneratingChunkMap
-
prepareTickingChunk
-
onChunkReadyToSend
-
prepareAccessibleChunk
-
getTickingGenerated
public int getTickingGenerated() -
saveChunkIfNeeded
-
save
-
isExistingChunkFull
-
setServerViewDistance
protected void setServerViewDistance(int p_300944_) -
getPlayerViewDistance
-
markChunkPendingToSend
-
markChunkPendingToSend
-
dropChunk
-
getChunkToSend
-
size
public int size() -
getDistanceManager
-
getChunks
-
dumpChunks
- 抛出:
IOException
-
printFuture
-
readChunk
-
upgradeChunkTag
-
forEachSpawnCandidateChunk
-
forEachForcedChunk
FORGE: grab forced chunks, use forEachChunk to avoid duplicate logic -
hasForcedChunks
boolean hasForcedChunks()FORGE: check if there are any forced chunks -
forEachChunk
private void forEachChunk(it.unimi.dsi.fastutil.longs.LongIterator longiterator, Predicate<ChunkPos> filter, Consumer<ChunkHolder> p_364582_) FORGE: commonize logic between forEachSpawnCandidateChunk and forEachForcedChunk -
anyPlayerCloseEnoughForSpawning
-
anyPlayerCloseEnoughForSpawningInternal
-
getPlayersCloseForSpawning
-
playerIsCloseEnoughForSpawning
-
skipPlayer
-
updatePlayerStatus
-
updatePlayerPos
-
move
-
updateChunkTracking
-
applyChunkTrackingView
-
getPlayers
- 指定者:
getPlayers
在接口中ChunkHolder.PlayerProvider
-
addEntity
-
removeEntity
-
tick
protected void tick() -
broadcast
-
broadcastAndSend
-
resendBiomesForChunks
-
getPoiManager
-
getStorageName
-
onFullChunkStatusChange
-
waitForLightBeforeSending
-