public class WorldChunk extends Object implements Chunk
| Modifier and Type | Class and Description |
|---|---|
static class |
WorldChunk.CreationType |
(package private) class |
WorldChunk.DirectBlockEntityTickInvoker<T extends BlockEntity> |
(package private) static class |
WorldChunk.EmptyBlockEntityTickInvoker |
(package private) class |
WorldChunk.WrappedBlockEntityTickInvoker |
| Constructor and Description |
|---|
WorldChunk(ServerWorld serverWorld,
ProtoChunk protoChunk,
Consumer<WorldChunk> consumer) |
WorldChunk(World world,
ChunkPos pos,
BiomeArray biomes) |
WorldChunk(World world,
ChunkPos pos,
BiomeArray biomes,
UpgradeData upgradeData,
TickScheduler<Block> blockTickScheduler,
TickScheduler<Fluid> fluidTickScheduler,
long inhabitedTime,
ChunkSection[] sections,
Consumer<WorldChunk> loadToWorldConsumer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitareSectionsEmptyBetween, getHighestNonEmptySection, getHighestNonEmptySectionYOffset, getList, markBlockForPostProcessing, markBlockForPostProcessinggetDismountHeight, getDismountHeight, getLuminance, getMaxLightLevel, method_29546, raycast, raycast, raycastBlockgetBottomHeightLimit, getHeight, getSection, getSectionIndex, getSectionIndexFromSection, getTopHeightLimit, getTopSectionLimit, isOutOfHeightLimit, isOutOfHeightLimitprivate static final Logger LOGGER
private static final BlockEntityTickInvoker EMPTY_BLOCK_ENTITY_TICKER
@Nullable public static final ChunkSection EMPTY_SECTION
private final ChunkSection[] sections
private BiomeArray biomeArray
private final Map<BlockPos,CompoundTag> pendingBlockEntityTags
private final Map<BlockPos,WorldChunk.WrappedBlockEntityTickInvoker> blockEntityTickers
private boolean loadedToWorld
private final World world
private final Map<Heightmap.Type,Heightmap> heightmaps
private final UpgradeData upgradeData
private final Map<BlockPos,BlockEntity> blockEntities
private final Map<StructureFeature<?>,StructureStart<?>> structureStarts
private final Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> structureReferences
private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingLists
private TickScheduler<Block> blockTickScheduler
private TickScheduler<Fluid> fluidTickScheduler
private volatile boolean shouldSave
private long inhabitedTime
@Nullable private Supplier<ChunkHolder.LevelType> levelTypeProvider
@Nullable private Consumer<WorldChunk> loadToWorldConsumer
private final ChunkPos pos
private volatile boolean lightOn
public WorldChunk(World world, ChunkPos pos, BiomeArray biomes)
public WorldChunk(World world, ChunkPos pos, BiomeArray biomes, UpgradeData upgradeData, TickScheduler<Block> blockTickScheduler, TickScheduler<Fluid> fluidTickScheduler, long inhabitedTime, @Nullable ChunkSection[] sections, @Nullable Consumer<WorldChunk> loadToWorldConsumer)
public WorldChunk(ServerWorld serverWorld, ProtoChunk protoChunk, @Nullable Consumer<WorldChunk> consumer)
public Heightmap getHeightmap(Heightmap.Type type)
getHeightmap in interface Chunkpublic Set<BlockPos> getBlockEntityPositions()
getBlockEntityPositions in interface Chunkpublic ChunkSection[] getSectionArray()
getSectionArray in interface Chunkpublic BlockState getBlockState(BlockPos pos)
getBlockState in interface BlockViewpublic FluidState getFluidState(BlockPos pos)
getFluidState in interface BlockViewpublic FluidState getFluidState(int x, int y, int z)
@Nullable public BlockState setBlockState(BlockPos pos, BlockState state, boolean moved)
setBlockState in interface Chunk@Nullable public LightingProvider getLightingProvider()
@Deprecated public void addEntity(Entity entity)
public void setHeightmap(Heightmap.Type type, long[] heightmap)
setHeightmap in interface Chunkpublic int sampleHeightmap(Heightmap.Type type, int x, int z)
sampleHeightmap in interface Chunk@Nullable private BlockEntity createBlockEntity(BlockPos pos)
@Nullable public BlockEntity getBlockEntity(BlockPos pos)
getBlockEntity in interface BlockView@Nullable public BlockEntity getBlockEntity(BlockPos pos, WorldChunk.CreationType creationType)
public void addBlockEntity(BlockEntity blockEntity)
private boolean canTickBlockEntities()
private boolean canTickBlockEntity(BlockPos blockPos)
public void setBlockEntity(BlockEntity blockEntity)
setBlockEntity in interface Chunkpublic void addPendingBlockEntityTag(CompoundTag tag)
addPendingBlockEntityTag in interface Chunk@Nullable public CompoundTag getPackedBlockEntityTag(BlockPos pos)
getPackedBlockEntityTag in interface Chunkpublic void removeBlockEntity(BlockPos pos)
removeBlockEntity in interface Chunkprivate void removeBlockEntityTicker(BlockPos blockPos)
public void loadToWorld()
public void markDirty()
public boolean isEmpty()
@Environment(value=CLIENT) public void loadFromPacket(@Nullable BiomeArray biomes, PacketByteBuf buf, CompoundTag tag, int verticalStripBitmask)
private void method_31722(BlockEntity blockEntity)
@Environment(value=CLIENT)
private boolean method_31717(int int2,
BlockPos blockPos)
public BiomeArray getBiomeArray()
getBiomeArray in interface Chunkpublic void setLoadedToWorld(boolean loaded)
public World getWorld()
public Collection<Map.Entry<Heightmap.Type,Heightmap>> getHeightmaps()
getHeightmaps in interface Chunkpublic Map<BlockPos,BlockEntity> getBlockEntities()
public CompoundTag getBlockEntityTag(BlockPos pos)
getBlockEntityTag in interface Chunkpublic Stream<BlockPos> getLightSourcesStream()
getLightSourcesStream in interface Chunkpublic TickScheduler<Block> getBlockTickScheduler()
getBlockTickScheduler in interface Chunkpublic TickScheduler<Fluid> getFluidTickScheduler()
getFluidTickScheduler in interface Chunkpublic void setShouldSave(boolean shouldSave)
setShouldSave in interface Chunkpublic boolean needsSaving()
needsSaving in interface Chunk@Nullable public StructureStart<?> getStructureStart(StructureFeature<?> structure)
getStructureStart in interface StructureHolderpublic void setStructureStart(StructureFeature<?> structure, StructureStart<?> start)
setStructureStart in interface StructureHolderpublic Map<StructureFeature<?>,StructureStart<?>> getStructureStarts()
getStructureStarts in interface Chunkpublic void setStructureStarts(Map<StructureFeature<?>,StructureStart<?>> structureStarts)
setStructureStarts in interface Chunkpublic it.unimi.dsi.fastutil.longs.LongSet getStructureReferences(StructureFeature<?> structure)
getStructureReferences in interface StructureHolderpublic void addStructureReference(StructureFeature<?> structure, long reference)
addStructureReference in interface StructureHolderpublic Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> getStructureReferences()
getStructureReferences in interface StructureHolderpublic void setStructureReferences(Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> structureReferences)
setStructureReferences in interface StructureHolderpublic long getInhabitedTime()
getInhabitedTime in interface Chunkpublic void setInhabitedTime(long inhabitedTime)
setInhabitedTime in interface Chunkpublic void runPostProcessing()
@Nullable private BlockEntity loadBlockEntity(BlockPos pos, CompoundTag tag)
public UpgradeData getUpgradeData()
getUpgradeData in interface Chunkpublic it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessingLists()
getPostProcessingLists in interface Chunkpublic void disableTickSchedulers()
public void enableTickSchedulers(ServerWorld world)
public int getSectionCount()
getSectionCount in interface HeightLimitViewpublic int getBottomSectionLimit()
getBottomSectionLimit in interface HeightLimitViewpublic ChunkStatus getStatus()
public ChunkHolder.LevelType getLevelType()
public void setLevelTypeProvider(Supplier<ChunkHolder.LevelType> levelTypeProvider)
public void setLightOn(boolean lightOn)
setLightOn in interface Chunkpublic void method_31712()
public void updateAllBlockEntityTickers()
private <T extends BlockEntity> void updateTicker(T t)
private <T extends BlockEntity> BlockEntityTickInvoker wrapTicker(T t, BlockEntityTicker<T> blockEntityTicker)