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
Used to represent a chunk that has not been loaded yet.
|
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 pendingBlockUpdates
blockUpdatesBySection
contains at least one entry.private final it.unimi.dsi.fastutil.shorts.ShortSet[] blockUpdatesBySection
markForBlockUpdate(net.minecraft.util.math.BlockPos)
, grouped by their vertical chunk section.
Entries for a section are null if the section has no positions marked for update.
private int blockLightUpdateBits
private int skyLightUpdateBits
private final LightingProvider lightingProvider
private final ChunkHolder.LevelUpdateListener levelUpdateListener
private final ChunkHolder.PlayersWatchingChunkProvider playersWatchingChunkProvider
private boolean accessible
private boolean field_26744
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)
y
- chunk section y coordinatepublic void flushUpdates(WorldChunk chunk)
private void tryUpdateBlockEntityAt(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 setCompletedChunk(ReadOnlyChunk readOnlyChunk)