Package net.minecraft.world.chunk
Class ChunkPrimer
- java.lang.Object
-
- net.minecraft.world.chunk.ChunkPrimer
-
- All Implemented Interfaces:
IChunk
,IBlockReader
,IStructureReader
- Direct Known Subclasses:
ChunkPrimerWrapper
public class ChunkPrimer extends java.lang.Object implements IChunk
-
-
Field Summary
Fields Modifier and Type Field Description private BiomeContainer
biomes
private java.util.Map<BlockPos,TileEntity>
blockEntities
private java.util.Map<BlockPos,CompoundNBT>
blockEntityNbts
private ChunkPrimerTickList<Block>
blockTicks
private java.util.Map<GenerationStage.Carving,java.util.BitSet>
carvingMasks
private ChunkPos
chunkPos
private java.util.List<CompoundNBT>
entities
private java.util.Map<Heightmap.Type,Heightmap>
heightmaps
private long
inhabitedTime
private boolean
isDirty
private boolean
isLightCorrect
private WorldLightManager
lightEngine
private java.util.List<BlockPos>
lights
private ChunkPrimerTickList<Fluid>
liquidTicks
private static org.apache.logging.log4j.Logger
LOGGER
private it.unimi.dsi.fastutil.shorts.ShortList[]
postProcessing
private ChunkSection[]
sections
private ChunkStatus
status
private java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet>
structuresRefences
private java.util.Map<Structure<?>,StructureStart<?>>
structureStarts
private UpgradeData
upgradeData
-
Constructor Summary
Constructors Constructor Description ChunkPrimer(ChunkPos p_i48700_1_, UpgradeData p_i48700_2_)
ChunkPrimer(ChunkPos p_i49941_1_, UpgradeData p_i49941_2_, ChunkSection[] p_i49941_3_, ChunkPrimerTickList<Block> p_i49941_4_, ChunkPrimerTickList<Fluid> p_i49941_5_)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.world.IBlockReader
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxBuildHeight, getMaxLightLevel
-
Methods inherited from interface net.minecraft.world.chunk.IChunk
getHighestSection, getHighestSectionPosition, getWorldForge, isYSpaceEmpty
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
chunkPos
private final ChunkPos chunkPos
-
isDirty
private volatile boolean isDirty
-
biomes
@Nullable private BiomeContainer biomes
-
lightEngine
@Nullable private volatile WorldLightManager lightEngine
-
heightmaps
private final java.util.Map<Heightmap.Type,Heightmap> heightmaps
-
status
private volatile ChunkStatus status
-
blockEntities
private final java.util.Map<BlockPos,TileEntity> blockEntities
-
blockEntityNbts
private final java.util.Map<BlockPos,CompoundNBT> blockEntityNbts
-
sections
private final ChunkSection[] sections
-
entities
private final java.util.List<CompoundNBT> entities
-
lights
private final java.util.List<BlockPos> lights
-
postProcessing
private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessing
-
structureStarts
private final java.util.Map<Structure<?>,StructureStart<?>> structureStarts
-
structuresRefences
private final java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> structuresRefences
-
upgradeData
private final UpgradeData upgradeData
-
blockTicks
private final ChunkPrimerTickList<Block> blockTicks
-
liquidTicks
private final ChunkPrimerTickList<Fluid> liquidTicks
-
inhabitedTime
private long inhabitedTime
-
carvingMasks
private final java.util.Map<GenerationStage.Carving,java.util.BitSet> carvingMasks
-
isLightCorrect
private volatile boolean isLightCorrect
-
-
Constructor Detail
-
ChunkPrimer
public ChunkPrimer(ChunkPos p_i48700_1_, UpgradeData p_i48700_2_)
-
ChunkPrimer
public ChunkPrimer(ChunkPos p_i49941_1_, UpgradeData p_i49941_2_, @Nullable ChunkSection[] p_i49941_3_, ChunkPrimerTickList<Block> p_i49941_4_, ChunkPrimerTickList<Fluid> p_i49941_5_)
-
-
Method Detail
-
getBlockState
public BlockState getBlockState(BlockPos p_180495_1_)
- Specified by:
getBlockState
in interfaceIBlockReader
-
getFluidState
public FluidState getFluidState(BlockPos p_204610_1_)
- Specified by:
getFluidState
in interfaceIBlockReader
-
getLights
public java.util.stream.Stream<BlockPos> getLights()
-
getPackedLights
public it.unimi.dsi.fastutil.shorts.ShortList[] getPackedLights()
-
addLight
public void addLight(short p_201646_1_, int p_201646_2_)
-
addLight
public void addLight(BlockPos p_201637_1_)
-
setBlockState
@Nullable public BlockState setBlockState(BlockPos p_177436_1_, BlockState p_177436_2_, boolean p_177436_3_)
- Specified by:
setBlockState
in interfaceIChunk
-
getOrCreateSection
public ChunkSection getOrCreateSection(int p_217332_1_)
-
setBlockEntity
public void setBlockEntity(BlockPos p_177426_1_, TileEntity p_177426_2_)
- Specified by:
setBlockEntity
in interfaceIChunk
-
getBlockEntitiesPos
public java.util.Set<BlockPos> getBlockEntitiesPos()
- Specified by:
getBlockEntitiesPos
in interfaceIChunk
-
getBlockEntity
@Nullable public TileEntity getBlockEntity(BlockPos p_175625_1_)
- Specified by:
getBlockEntity
in interfaceIBlockReader
-
getBlockEntities
public java.util.Map<BlockPos,TileEntity> getBlockEntities()
-
addEntity
public void addEntity(CompoundNBT p_201626_1_)
-
getEntities
public java.util.List<CompoundNBT> getEntities()
-
setBiomes
public void setBiomes(BiomeContainer p_225548_1_)
-
getBiomes
@Nullable public BiomeContainer getBiomes()
-
setUnsaved
public void setUnsaved(boolean p_177427_1_)
- Specified by:
setUnsaved
in interfaceIChunk
-
getStatus
public ChunkStatus getStatus()
-
setStatus
public void setStatus(ChunkStatus p_201574_1_)
-
getSections
public ChunkSection[] getSections()
- Specified by:
getSections
in interfaceIChunk
-
getLightEngine
@Nullable public WorldLightManager getLightEngine()
-
getHeightmaps
public java.util.Collection<java.util.Map.Entry<Heightmap.Type,Heightmap>> getHeightmaps()
- Specified by:
getHeightmaps
in interfaceIChunk
-
setHeightmap
public void setHeightmap(Heightmap.Type p_201607_1_, long[] p_201607_2_)
- Specified by:
setHeightmap
in interfaceIChunk
-
getOrCreateHeightmapUnprimed
public Heightmap getOrCreateHeightmapUnprimed(Heightmap.Type p_217303_1_)
- Specified by:
getOrCreateHeightmapUnprimed
in interfaceIChunk
-
getHeight
public int getHeight(Heightmap.Type p_201576_1_, int p_201576_2_, int p_201576_3_)
-
setLastSaveTime
public void setLastSaveTime(long p_177432_1_)
- Specified by:
setLastSaveTime
in interfaceIChunk
-
getStartForFeature
@Nullable public StructureStart<?> getStartForFeature(Structure<?> p_230342_1_)
- Specified by:
getStartForFeature
in interfaceIStructureReader
-
setStartForFeature
public void setStartForFeature(Structure<?> p_230344_1_, StructureStart<?> p_230344_2_)
- Specified by:
setStartForFeature
in interfaceIStructureReader
-
getAllStarts
public java.util.Map<Structure<?>,StructureStart<?>> getAllStarts()
- Specified by:
getAllStarts
in interfaceIChunk
-
setAllStarts
public void setAllStarts(java.util.Map<Structure<?>,StructureStart<?>> p_201612_1_)
- Specified by:
setAllStarts
in interfaceIChunk
-
getReferencesForFeature
public it.unimi.dsi.fastutil.longs.LongSet getReferencesForFeature(Structure<?> p_230346_1_)
- Specified by:
getReferencesForFeature
in interfaceIStructureReader
-
addReferenceForFeature
public void addReferenceForFeature(Structure<?> p_230343_1_, long p_230343_2_)
- Specified by:
addReferenceForFeature
in interfaceIStructureReader
-
getAllReferences
public java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> getAllReferences()
- Specified by:
getAllReferences
in interfaceIStructureReader
-
setAllReferences
public void setAllReferences(java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_)
- Specified by:
setAllReferences
in interfaceIStructureReader
-
packOffsetCoordinates
public static short packOffsetCoordinates(BlockPos p_201651_0_)
-
unpackOffsetCoordinates
public static BlockPos unpackOffsetCoordinates(short p_201635_0_, int p_201635_1_, ChunkPos p_201635_2_)
-
markPosForPostprocessing
public void markPosForPostprocessing(BlockPos p_201594_1_)
- Specified by:
markPosForPostprocessing
in interfaceIChunk
-
getPostProcessing
public it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessing()
- Specified by:
getPostProcessing
in interfaceIChunk
-
addPackedPostProcess
public void addPackedPostProcess(short p_201636_1_, int p_201636_2_)
- Specified by:
addPackedPostProcess
in interfaceIChunk
-
getBlockTicks
public ChunkPrimerTickList<Block> getBlockTicks()
- Specified by:
getBlockTicks
in interfaceIChunk
-
getLiquidTicks
public ChunkPrimerTickList<Fluid> getLiquidTicks()
- Specified by:
getLiquidTicks
in interfaceIChunk
-
getUpgradeData
public UpgradeData getUpgradeData()
- Specified by:
getUpgradeData
in interfaceIChunk
-
setInhabitedTime
public void setInhabitedTime(long p_177415_1_)
- Specified by:
setInhabitedTime
in interfaceIChunk
-
getInhabitedTime
public long getInhabitedTime()
- Specified by:
getInhabitedTime
in interfaceIChunk
-
setBlockEntityNbt
public void setBlockEntityNbt(CompoundNBT p_201591_1_)
- Specified by:
setBlockEntityNbt
in interfaceIChunk
-
getBlockEntityNbts
public java.util.Map<BlockPos,CompoundNBT> getBlockEntityNbts()
-
getBlockEntityNbt
public CompoundNBT getBlockEntityNbt(BlockPos p_201579_1_)
- Specified by:
getBlockEntityNbt
in interfaceIChunk
-
getBlockEntityNbtForSaving
@Nullable public CompoundNBT getBlockEntityNbtForSaving(BlockPos p_223134_1_)
- Specified by:
getBlockEntityNbtForSaving
in interfaceIChunk
-
removeBlockEntity
public void removeBlockEntity(BlockPos p_177425_1_)
- Specified by:
removeBlockEntity
in interfaceIChunk
-
getCarvingMask
@Nullable public java.util.BitSet getCarvingMask(GenerationStage.Carving p_205749_1_)
-
getOrCreateCarvingMask
public java.util.BitSet getOrCreateCarvingMask(GenerationStage.Carving p_230345_1_)
-
setCarvingMask
public void setCarvingMask(GenerationStage.Carving p_205767_1_, java.util.BitSet p_205767_2_)
-
setLightEngine
public void setLightEngine(WorldLightManager p_217306_1_)
-
isLightCorrect
public boolean isLightCorrect()
- Specified by:
isLightCorrect
in interfaceIChunk
-
setLightCorrect
public void setLightCorrect(boolean p_217305_1_)
- Specified by:
setLightCorrect
in interfaceIChunk
-
-