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, wait
areSectionsEmptyBetween, getHighestNonEmptySection, getHighestNonEmptySectionYOffset, getList
getDismountHeight, getDismountHeight, getHeight, getLuminance, getMaxLightLevel, method_29546, raycast, raycast, raycastBlock
private 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 BlockView
public FluidState getFluidState(BlockPos pos)
getFluidState
in interface BlockView
public Stream<BlockPos> getLightSourcesStream()
getLightSourcesStream
in interface Chunk
public 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 Chunk
public ChunkSection getSection(int y)
public void setBlockEntity(BlockPos pos, BlockEntity blockEntity)
setBlockEntity
in interface Chunk
public Set<BlockPos> getBlockEntityPositions()
getBlockEntityPositions
in interface Chunk
@Nullable public BlockEntity getBlockEntity(BlockPos pos)
getBlockEntity
in interface BlockView
public 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 Chunk
public void setShouldSave(boolean shouldSave)
setShouldSave
in interface Chunk
public boolean needsSaving()
needsSaving
in interface Chunk
public 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 Chunk
public void setHeightmap(Heightmap.Type type, long[] heightmap)
setHeightmap
in interface Chunk
public Heightmap getHeightmap(Heightmap.Type type)
getHeightmap
in interface Chunk
public int sampleHeightmap(Heightmap.Type type, int x, int z)
sampleHeightmap
in interface Chunk
public void setLastSaveTime(long lastSaveTime)
setLastSaveTime
in interface Chunk
@Nullable public StructureStart<?> getStructureStart(StructureFeature<?> structure)
getStructureStart
in interface StructureHolder
public void setStructureStart(StructureFeature<?> structure, StructureStart<?> start)
setStructureStart
in interface StructureHolder
public Map<StructureFeature<?>,StructureStart<?>> getStructureStarts()
getStructureStarts
in interface Chunk
public void setStructureStarts(Map<StructureFeature<?>,StructureStart<?>> structureStarts)
setStructureStarts
in interface Chunk
public it.unimi.dsi.fastutil.longs.LongSet getStructureReferences(StructureFeature<?> structure)
getStructureReferences
in interface StructureHolder
public void addStructureReference(StructureFeature<?> structure, long reference)
addStructureReference
in interface StructureHolder
public Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> getStructureReferences()
getStructureReferences
in interface StructureHolder
public void setStructureReferences(Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> structureReferences)
setStructureReferences
in interface StructureHolder
public static short getPackedSectionRelative(BlockPos pos)
public void markBlockForPostProcessing(BlockPos pos)
markBlockForPostProcessing
in interface Chunk
public it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessingLists()
getPostProcessingLists
in interface Chunk
public void markBlockForPostProcessing(short short2, int int2)
markBlockForPostProcessing
in interface Chunk
public ChunkTickScheduler<Block> getBlockTickScheduler()
getBlockTickScheduler
in interface Chunk
public ChunkTickScheduler<Fluid> getFluidTickScheduler()
getFluidTickScheduler
in interface Chunk
public UpgradeData getUpgradeData()
getUpgradeData
in interface Chunk
public void setInhabitedTime(long inhabitedTime)
setInhabitedTime
in interface Chunk
public long getInhabitedTime()
getInhabitedTime
in interface Chunk
public void addPendingBlockEntityTag(CompoundTag tag)
addPendingBlockEntityTag
in interface Chunk
public Map<BlockPos,CompoundTag> getBlockEntityTags()
public CompoundTag getBlockEntityTag(BlockPos pos)
getBlockEntityTag
in interface Chunk
@Nullable public CompoundTag getPackedBlockEntityTag(BlockPos pos)
getPackedBlockEntityTag
in interface Chunk
public 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