类 ServerChunkCache
java.lang.Object
net.minecraft.world.level.chunk.ChunkSource
net.minecraft.server.level.ServerChunkCache
- 所有已实现的接口:
AutoCloseable
,LightChunkGetter
-
嵌套类概要
嵌套类修饰符和类型类说明(专用程序包) static final record
(专用程序包) final class
-
字段概要
字段修饰符和类型字段说明private static final int
private static final List<ChunkStatus>
final ChunkMap
private final DimensionDataStorage
private final DistanceManager
private final ChunkAccess[]
private final long[]
private final ChunkStatus[]
private long
private NaturalSpawner.SpawnState
final ServerLevel
(专用程序包) final ThreadedLevelLightEngine
(专用程序包) final Thread
private final ServerChunkCache.MainThreadExecutor
private boolean
private boolean
-
构造器概要
构造器构造器说明ServerChunkCache
(ServerLevel pLevel, LevelStorageSource.LevelStorageAccess pLevelStorageAccess, com.mojang.datafixers.DataFixer pFixerUpper, StructureTemplateManager pStructureManager, Executor pDispatcher, ChunkGenerator pGenerator, int pViewDistance, int pSimulationDistance, boolean pSync, ChunkProgressListener pProgressListener, ChunkStatusUpdateListener pChunkStatusListener, Supplier<DimensionDataStorage> pOverworldDataStorage) -
方法概要
修饰符和类型方法说明void
<T> void
addRegionTicket
(TicketType<T> pType, ChunkPos pPos, int pDistance, T pValue) <T> void
addRegionTicket
(TicketType<T> pType, ChunkPos pPos, int pDistance, T pValue, boolean forceTicks) void
blockChanged
(BlockPos pPos) void
void
broadcastAndSend
(Entity pEntity, Packet<?> pPacket) private boolean
chunkAbsent
(ChunkHolder pChunkHolder, int p_8418_) private void
void
close()
getChunk
(int pChunkX, int pChunkZ, ChunkStatus pRequiredStatus, boolean pLoad) getChunkDebugData
(ChunkPos pChunkPos) getChunkForLighting
(int pChunkX, int pChunkZ) CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,
ChunkHolder.ChunkLoadingFailure>> getChunkFuture
(int pX, int pY, ChunkStatus p_8434_, boolean p_8435_) private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,
ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread
(int pX, int pY, ChunkStatus p_8459_, boolean p_8460_) getChunkNow
(int pChunkX, int pChunkZ) private void
getFullChunk
(long p_8371_, Consumer<LevelChunk> p_8372_) getLevel()
int
int
int
private ChunkHolder
getVisibleChunkIfPresent
(long p_8365_) boolean
hasChunk
(int pX, int pZ) boolean
isPositionTicking
(long pChunkPos) void
move
(ServerPlayer pPlayer) void
onLightUpdate
(LightLayer pType, SectionPos pPos) boolean
pollTask()
void
removeEntity
(Entity pEntity) <T> void
removeRegionTicket
(TicketType<T> pType, ChunkPos pPos, int pDistance, T pValue) <T> void
removeRegionTicket
(TicketType<T> pType, ChunkPos pPos, int pDistance, T pValue, boolean forceTicks) void
(专用程序包) boolean
void
save
(boolean pFlush) void
setSimulationDistance
(int pSimulationDistance) void
setSpawnSettings
(boolean pHostile, boolean pPeaceful) void
setViewDistance
(int pViewDistance) private void
storeInCache
(long pChunkPos, ChunkAccess pChunk, ChunkStatus pChunkStatus) void
tick
(BooleanSupplier pHasTimeLeft, boolean pTickChunks) private void
void
updateChunkForced
(ChunkPos pPos, boolean pAdd) 从类继承的方法 net.minecraft.world.level.chunk.ChunkSource
getChunk
-
字段详细资料
-
CHUNK_STATUSES
-
distanceManager
-
level
-
mainThread
-
lightEngine
-
mainThreadProcessor
-
chunkMap
-
dataStorage
-
lastInhabitedUpdate
private long lastInhabitedUpdate -
spawnEnemies
private boolean spawnEnemies -
spawnFriendlies
private boolean spawnFriendlies -
CACHE_SIZE
private static final int CACHE_SIZE- 另请参阅:
-
lastChunkPos
private final long[] lastChunkPos -
lastChunkStatus
-
lastChunk
-
lastSpawnState
-
-
构造器详细资料
-
ServerChunkCache
public ServerChunkCache(ServerLevel pLevel, LevelStorageSource.LevelStorageAccess pLevelStorageAccess, com.mojang.datafixers.DataFixer pFixerUpper, StructureTemplateManager pStructureManager, Executor pDispatcher, ChunkGenerator pGenerator, int pViewDistance, int pSimulationDistance, boolean pSync, ChunkProgressListener pProgressListener, ChunkStatusUpdateListener pChunkStatusListener, Supplier<DimensionDataStorage> pOverworldDataStorage)
-
-
方法详细资料
-
getLightEngine
- 指定者:
getLightEngine
在类中ChunkSource
-
getVisibleChunkIfPresent
-
getTickingGenerated
public int getTickingGenerated() -
storeInCache
-
getChunk
@Nullable public ChunkAccess getChunk(int pChunkX, int pChunkZ, ChunkStatus pRequiredStatus, boolean pLoad) - 指定者:
getChunk
在类中ChunkSource
-
getChunkNow
- 覆盖:
getChunkNow
在类中ChunkSource
-
clearCache
private void clearCache() -
getChunkFuture
public CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int pX, int pY, ChunkStatus p_8434_, boolean p_8435_) -
getChunkFutureMainThread
private CompletableFuture<com.mojang.datafixers.util.Either<ChunkAccess,ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread(int pX, int pY, ChunkStatus p_8459_, boolean p_8460_) -
chunkAbsent
-
hasChunk
public boolean hasChunk(int pX, int pZ) - 覆盖:
hasChunk
在类中ChunkSource
-
getChunkForLighting
- 指定者:
getChunkForLighting
在接口中LightChunkGetter
- 覆盖:
getChunkForLighting
在类中ChunkSource
-
getLevel
-
pollTask
public boolean pollTask() -
runDistanceManagerUpdates
boolean runDistanceManagerUpdates() -
isPositionTicking
public boolean isPositionTicking(long pChunkPos) -
save
public void save(boolean pFlush) -
close
- 指定者:
close
在接口中AutoCloseable
- 覆盖:
close
在类中ChunkSource
- 抛出:
IOException
-
tick
- 指定者:
tick
在类中ChunkSource
-
tickChunks
private void tickChunks() -
getFullChunk
-
gatherStats
- 指定者:
gatherStats
在类中ChunkSource
-
getPendingTasksCount
public int getPendingTasksCount() -
getGenerator
-
getGeneratorState
-
randomState
-
getLoadedChunksCount
public int getLoadedChunksCount()- 指定者:
getLoadedChunksCount
在类中ChunkSource
-
blockChanged
-
onLightUpdate
-
addRegionTicket
-
addRegionTicket
public <T> void addRegionTicket(TicketType<T> pType, ChunkPos pPos, int pDistance, T pValue, boolean forceTicks) -
removeRegionTicket
-
removeRegionTicket
public <T> void removeRegionTicket(TicketType<T> pType, ChunkPos pPos, int pDistance, T pValue, boolean forceTicks) -
updateChunkForced
- 覆盖:
updateChunkForced
在类中ChunkSource
-
move
-
removeEntity
-
addEntity
-
broadcastAndSend
-
broadcast
-
setViewDistance
public void setViewDistance(int pViewDistance) -
setSimulationDistance
public void setSimulationDistance(int pSimulationDistance) -
setSpawnSettings
public void setSpawnSettings(boolean pHostile, boolean pPeaceful) - 覆盖:
setSpawnSettings
在类中ChunkSource
-
getChunkDebugData
-
getDataStorage
-
getPoiManager
-
chunkScanner
-
getLastSpawnState
-
removeTicketsOnClosing
public void removeTicketsOnClosing()
-