public class WorldChunk extends Object implements Chunk
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
WorldChunk.class_5563<T extends BlockEntity> |
(package private) class |
WorldChunk.class_5564 |
static class |
WorldChunk.CreationType |
| 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, raycastBlockmethod_31597, method_31598, method_31599, method_31600, method_31601, method_31602, method_31603, method_31604, method_31606private static final Logger LOGGER
private static final class_5562 field_27221
@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.class_5564> field_27222
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 method_31715()
private boolean method_31724(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 method_31725(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 method_31607()
method_31607 in interface class_5539public int method_31605()
method_31605 in interface class_5539public 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 method_31713()
private <T extends BlockEntity> void method_31723(T t)
private <T extends BlockEntity> class_5562 method_31718(T t, class_5558<T> class_5558)