public class ProtoChunk extends Object implements Chunk
| Modifier and Type | Field and Description |
|---|---|
private BiomeArray |
biomes |
private Map<BlockPos,BlockEntity> |
blockEntities |
private Map<BlockPos,CompoundTag> |
blockEntityTags |
private ChunkTickScheduler<Block> |
blockTickScheduler |
private Map<GenerationStep.Carver,BitSet> |
carvingMasks |
private List<CompoundTag> |
entities |
private ChunkTickScheduler<Fluid> |
fluidTickScheduler |
private Map<Heightmap.Type,Heightmap> |
heightmaps |
private long |
inhabitedTime |
private LightingProvider |
lightingProvider |
private boolean |
lightOn |
private List<BlockPos> |
lightSources |
private static Logger |
LOGGER |
private ChunkPos |
pos |
private it.unimi.dsi.fastutil.shorts.ShortList[] |
postProcessingLists |
private ChunkSection[] |
sections |
private boolean |
shouldSave |
private ChunkStatus |
status |
private Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> |
structureReferences |
private Map<StructureFeature<?>,StructureStart<?>> |
structureStarts |
private UpgradeData |
upgradeData |
| Constructor and Description |
|---|
ProtoChunk(ChunkPos pos,
UpgradeData upgradeData) |
ProtoChunk(ChunkPos pos,
UpgradeData upgradeData,
ChunkSection[] sections,
ChunkTickScheduler<Block> blockTickScheduler,
ChunkTickScheduler<Fluid> fluidTickScheduler) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitareSectionsEmptyBetween, getHighestNonEmptySection, getHighestNonEmptySectionYOffset, getListgetDismountHeight, getDismountHeight, getHeight, getLuminance, getMaxLightLevel, method_29546, raycast, raycast, raycastBlockprivate static final Logger LOGGER
private final ChunkPos pos
private volatile boolean shouldSave
@Nullable private BiomeArray biomes
@Nullable private volatile LightingProvider lightingProvider
private final Map<Heightmap.Type,Heightmap> heightmaps
private volatile ChunkStatus status
private final Map<BlockPos,BlockEntity> blockEntities
private final Map<BlockPos,CompoundTag> blockEntityTags
private final ChunkSection[] sections
private final List<CompoundTag> entities
private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingLists
private final Map<StructureFeature<?>,StructureStart<?>> structureStarts
private final Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> structureReferences
private final UpgradeData upgradeData
private final ChunkTickScheduler<Block> blockTickScheduler
private final ChunkTickScheduler<Fluid> fluidTickScheduler
private long inhabitedTime
private final Map<GenerationStep.Carver,BitSet> carvingMasks
private volatile boolean lightOn
public ProtoChunk(ChunkPos pos, UpgradeData upgradeData)
public ProtoChunk(ChunkPos pos, UpgradeData upgradeData, @Nullable ChunkSection[] sections, ChunkTickScheduler<Block> blockTickScheduler, ChunkTickScheduler<Fluid> fluidTickScheduler)
public BlockState getBlockState(BlockPos pos)
getBlockState in interface BlockViewpublic FluidState getFluidState(BlockPos pos)
getFluidState in interface BlockViewpublic Stream<BlockPos> getLightSourcesStream()
getLightSourcesStream in interface Chunkpublic it.unimi.dsi.fastutil.shorts.ShortList[] getLightSourcesBySection()
public void addLightSource(short chunkSliceRel,
int sectionY)
public void addLightSource(BlockPos pos)
@Nullable public BlockState setBlockState(BlockPos pos, BlockState state, boolean moved)
setBlockState in interface Chunkpublic ChunkSection getSection(int y)
public void setBlockEntity(BlockPos pos, BlockEntity blockEntity)
setBlockEntity in interface Chunkpublic Set<BlockPos> getBlockEntityPositions()
getBlockEntityPositions in interface Chunk@Nullable public BlockEntity getBlockEntity(BlockPos pos)
getBlockEntity in interface BlockViewpublic Map<BlockPos,BlockEntity> getBlockEntities()
public void addEntity(CompoundTag entityTag)
public List<CompoundTag> getEntities()
public void setBiomes(BiomeArray biomes)
@Nullable public BiomeArray getBiomeArray()
getBiomeArray in interface Chunkpublic void setShouldSave(boolean shouldSave)
setShouldSave in interface Chunkpublic boolean needsSaving()
needsSaving in interface Chunkpublic ChunkStatus getStatus()
public void setStatus(ChunkStatus status)
public ChunkSection[] getSectionArray()
getSectionArray in interface Chunk@Nullable public LightingProvider getLightingProvider()
public Collection<Map.Entry<Heightmap.Type,Heightmap>> getHeightmaps()
getHeightmaps in interface Chunkpublic void setHeightmap(Heightmap.Type type, long[] heightmap)
setHeightmap in interface Chunkpublic Heightmap getHeightmap(Heightmap.Type type)
getHeightmap in interface Chunkpublic int sampleHeightmap(Heightmap.Type type, int x, int z)
sampleHeightmap in interface Chunkpublic void setLastSaveTime(long lastSaveTime)
setLastSaveTime 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 static short getPackedSectionRelative(BlockPos pos)
public void markBlockForPostProcessing(BlockPos pos)
markBlockForPostProcessing in interface Chunkpublic it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessingLists()
getPostProcessingLists in interface Chunkpublic void markBlockForPostProcessing(short short2,
int int2)
markBlockForPostProcessing in interface Chunkpublic ChunkTickScheduler<Block> getBlockTickScheduler()
getBlockTickScheduler in interface Chunkpublic ChunkTickScheduler<Fluid> getFluidTickScheduler()
getFluidTickScheduler in interface Chunkpublic UpgradeData getUpgradeData()
getUpgradeData in interface Chunkpublic void setInhabitedTime(long inhabitedTime)
setInhabitedTime in interface Chunkpublic long getInhabitedTime()
getInhabitedTime in interface Chunkpublic void addPendingBlockEntityTag(CompoundTag tag)
addPendingBlockEntityTag in interface Chunkpublic Map<BlockPos,CompoundTag> getBlockEntityTags()
public CompoundTag getBlockEntityTag(BlockPos pos)
getBlockEntityTag in interface Chunk@Nullable public CompoundTag getPackedBlockEntityTag(BlockPos pos)
getPackedBlockEntityTag in interface Chunkpublic void removeBlockEntity(BlockPos pos)
removeBlockEntity in interface Chunk@Nullable public BitSet getCarvingMask(GenerationStep.Carver carver)
public BitSet getOrCreateCarvingMask(GenerationStep.Carver carver)
public void setCarvingMask(GenerationStep.Carver carver, BitSet mask)
public void setLightingProvider(LightingProvider lightingProvider)
public void setLightOn(boolean lightOn)
setLightOn in interface Chunk