public class ChunkHolder extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ChunkHolder.LevelType |
static interface |
ChunkHolder.LevelUpdateListener |
static interface |
ChunkHolder.PlayersWatchingChunkProvider |
static interface |
ChunkHolder.Unloaded |
| Constructor and Description |
|---|
ChunkHolder(ChunkPos pos,
int level,
LightingProvider lightingProvider,
ChunkHolder.LevelUpdateListener levelUpdateListener,
ChunkHolder.PlayersWatchingChunkProvider playersWatchingChunkProvider) |
public static final com.mojang.datafixers.util.Either<Chunk,ChunkHolder.Unloaded> UNLOADED_CHUNK
public static final CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.Unloaded>> UNLOADED_CHUNK_FUTURE
public static final com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded> UNLOADED_WORLD_CHUNK
private static final CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> UNLOADED_WORLD_CHUNK_FUTURE
private static final List<ChunkStatus> CHUNK_STATUSES
private static final ChunkHolder.LevelType[] LEVEL_TYPES
private final AtomicReferenceArray<CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.Unloaded>>> futuresByStatus
private volatile CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> accessibleFuture
private volatile CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> tickingFuture
private volatile CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> entityTickingFuture
private CompletableFuture<Chunk> savingFuture
private int lastTickLevel
private int level
private int completedLevel
private final ChunkPos pos
private boolean field_25803
private final it.unimi.dsi.fastutil.shorts.ShortSet[] field_25804
private int blockLightUpdateBits
private int skyLightUpdateBits
private final LightingProvider lightingProvider
private final ChunkHolder.LevelUpdateListener levelUpdateListener
private final ChunkHolder.PlayersWatchingChunkProvider playersWatchingChunkProvider
private boolean accessible
public ChunkHolder(ChunkPos pos, int level, LightingProvider lightingProvider, ChunkHolder.LevelUpdateListener levelUpdateListener, ChunkHolder.PlayersWatchingChunkProvider playersWatchingChunkProvider)
public CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.Unloaded>> getFutureFor(ChunkStatus leastStatus)
public CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.Unloaded>> getValidFutureFor(ChunkStatus leastStatus)
public CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> getTickingFuture()
public CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> getEntityTickingFuture()
public CompletableFuture<com.mojang.datafixers.util.Either<WorldChunk,ChunkHolder.Unloaded>> getAccessibleFuture()
@Nullable public WorldChunk getWorldChunk()
@Environment(value=CLIENT) @Nullable public ChunkStatus getCurrentStatus()
public CompletableFuture<Chunk> getSavingFuture()
public void markForBlockUpdate(BlockPos blockPos)
public void markForLightUpdate(LightType type, int y)
public void flushUpdates(WorldChunk chunk)
private void method_30311(World world, BlockPos blockPos, BlockState blockState)
private void sendPacketToPlayersWatching(Packet<?> packet, boolean onlyOnWatchDistanceEdge)
public CompletableFuture<com.mojang.datafixers.util.Either<Chunk,ChunkHolder.Unloaded>> getChunkAt(ChunkStatus targetStatus, ThreadedAnvilChunkStorage chunkStorage)
private void combineSavingFuture(CompletableFuture<? extends com.mojang.datafixers.util.Either<? extends Chunk,ChunkHolder.Unloaded>> then)
@Environment(value=CLIENT) public ChunkHolder.LevelType getLevelType()
public ChunkPos getPos()
public int getLevel()
public int getCompletedLevel()
private void setCompletedLevel(int level)
public void setLevel(int level)
protected void tick(ThreadedAnvilChunkStorage chunkStorage)
public static ChunkStatus getTargetStatusForLevel(int level)
public static ChunkHolder.LevelType getLevelType(int distance)
public boolean isAccessible()
public void updateAccessibleStatus()
public void finalizeChunk(ReadOnlyChunk chunk)