Package net.minecraft.world.level.chunk
Class LevelChunk
java.lang.Object
net.minecraft.world.level.chunk.ChunkAccess
net.minecraft.world.level.chunk.LevelChunk
- All Implemented Interfaces:
BiomeManager.NoiseBiomeSource
,BlockGetter
,LightChunk
,StructureAccess
,LevelHeightAccessor
,IAttachmentHolder
,IBlockGetterExtension
- Direct Known Subclasses:
EmptyLevelChunk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
static enum
static interface
(package private) class
Nested classes/interfaces inherited from class net.minecraft.world.level.chunk.ChunkAccess
ChunkAccess.TicksToSave
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LevelChunkAuxiliaryLightManager
private final LevelChunkTicks
<Block> private final LevelChunkTicks
<Fluid> private Supplier
<FullChunkStatus> private final it.unimi.dsi.fastutil.ints.Int2ObjectMap
<GameEventListenerRegistry> (package private) final Level
private boolean
(package private) static final org.slf4j.Logger
private static final TickingBlockEntity
private LevelChunk.PostLoadProcessor
private final Map
<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> Fields inherited from class net.minecraft.world.level.chunk.ChunkAccess
blendingData, blockEntities, chunkPos, heightmaps, levelHeightAccessor, NO_FILLED_SECTION, noiseChunk, pendingBlockEntities, postProcessing, sections, skyLightSources, unsaved, upgradeData
-
Constructor Summary
ConstructorsConstructorDescriptionLevelChunk
(ServerLevel pLevel, ProtoChunk pChunk, LevelChunk.PostLoadProcessor pPostLoad) LevelChunk
(Level pLevel, ChunkPos pPos) LevelChunk
(Level pLevel, ChunkPos pPos, UpgradeData pData, LevelChunkTicks<Block> pBlockTicks, LevelChunkTicks<Fluid> pFluidTicks, long pInhabitedTime, LevelChunkSection[] pSections, LevelChunk.PostLoadProcessor pPostLoad, BlendingData pBlendingData) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAndRegisterBlockEntity
(BlockEntity pBlockEntity) void
Deprecated.private <T extends BlockEntity>
voidaddGameEventListener
(T pBlockEntity, ServerLevel pLevel) void
private BlockEntity
createBlockEntity
(BlockPos pPos) private <T extends BlockEntity>
TickingBlockEntitycreateTicker
(T pBlockEntity, BlockEntityTicker<T> pTicker) Get theAuxiliaryLightManager
of the chunk at the givenChunkPos
.getBlockEntity
(BlockPos pPos) getBlockEntity
(BlockPos pPos, LevelChunk.EntityCreationType pCreationType) getBlockEntityNbtForSaving
(BlockPos pPos, HolderLookup.Provider pRegistries) getBlockState
(BlockPos pPos) getFluidState
(int pX, int pY, int pZ) getFluidState
(BlockPos pPos) getLevel()
getListenerRegistry
(int pSectionY) boolean
isEmpty()
private boolean
(package private) boolean
void
private BlockEntity
promotePendingBlockEntity
(BlockPos pPos, CompoundTag pTag) void
void
void
removeBlockEntity
(BlockPos pPos) private void
private <T extends BlockEntity>
voidremoveGameEventListener
(T pBlockEntity, ServerLevel pLevel) private void
removeGameEventListenerRegistry
(int p_283355_) void
replaceBiomes
(FriendlyByteBuf pBuffer) void
replaceWithPacketData
(FriendlyByteBuf pBuffer, CompoundTag pTag, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> pOutputTagConsumer) void
void
setBlockEntity
(BlockEntity pBlockEntity) setBlockState
(BlockPos pPos, BlockState pState, boolean pIsMoving) void
setFullStatus
(Supplier<FullChunkStatus> pFullStatus) void
setLoaded
(boolean pLoaded) void
unpackTicks
(long pPos) void
private <T extends BlockEntity>
voidupdateBlockEntityTicker
(T pBlockEntity) Methods inherited from class net.minecraft.world.level.chunk.ChunkAccess
addPackedPostProcess, addReferenceForStructure, carverBiome, fillBiomesFromNoise, findBlockLightSources, findBlocks, findBlocks, findBlocks, getAllReferences, getAllStarts, getAttachmentHolder, getBelowZeroRetrogen, getBlendingData, getBlockEntitiesPos, getBlockEntityNbt, getData, getExistingDataOrNull, getHeight, getHeight, getHeightAccessorForGeneration, getHeightmaps, getHighestFilledSectionIndex, getHighestGeneratedStatus, getHighestSectionPosition, getInhabitedTime, getMinBuildHeight, getNoiseBiome, getOrCreateHeightmapUnprimed, getOrCreateNoiseChunk, getOrCreateOffsetList, getPos, getPostProcessing, getReferencesForStructure, getSection, getSections, getSkyLightSources, getStartForStructure, getUpgradeData, hasAnyStructureReferences, hasAttachments, hasData, hasPrimedHeightmap, incrementInhabitedTime, initializeLightSources, isLightCorrect, isOldNoiseGeneration, isSectionEmpty, isUnsaved, isUpgrading, isYSpaceEmpty, markPosForPostprocessing, readAttachmentsFromNBT, removeData, setAllReferences, setAllStarts, setBlendingData, setBlockEntityNbt, setData, setHeightmap, setInhabitedTime, setLightCorrect, setStartForStructure, setUnsaved, writeAttachmentsToNBT
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.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLine
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getData, getExistingData, getExistingData, getExistingDataOrNull, getExistingDataOrNull, hasAttachments, hasData, hasData, removeData, removeData, setData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getModelData
Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
NULL_TICKER
-
tickersInLevel
-
loaded
private boolean loaded -
level
-
fullStatus
-
postLoad
-
gameEventListenerRegistrySections
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<GameEventListenerRegistry> gameEventListenerRegistrySections -
blockTicks
-
fluidTicks
-
auxLightManager
-
-
Constructor Details
-
LevelChunk
-
LevelChunk
public LevelChunk(Level pLevel, ChunkPos pPos, UpgradeData pData, LevelChunkTicks<Block> pBlockTicks, LevelChunkTicks<Fluid> pFluidTicks, long pInhabitedTime, @Nullable LevelChunkSection[] pSections, @Nullable LevelChunk.PostLoadProcessor pPostLoad, @Nullable BlendingData pBlendingData) -
LevelChunk
public LevelChunk(ServerLevel pLevel, ProtoChunk pChunk, @Nullable LevelChunk.PostLoadProcessor pPostLoad)
-
-
Method Details
-
getBlockTicks
- Specified by:
getBlockTicks
in classChunkAccess
-
getFluidTicks
- Specified by:
getFluidTicks
in classChunkAccess
-
getTicksForSerialization
- Specified by:
getTicksForSerialization
in classChunkAccess
-
getListenerRegistry
- Overrides:
getListenerRegistry
in classChunkAccess
-
getBlockState
- Specified by:
getBlockState
in interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidState
in interfaceBlockGetter
-
getFluidState
-
setBlockState
- Specified by:
setBlockState
in classChunkAccess
-
addEntity
Deprecated.- Specified by:
addEntity
in classChunkAccess
-
createBlockEntity
-
getBlockEntity
- Specified by:
getBlockEntity
in interfaceBlockGetter
-
getBlockEntity
@Nullable public BlockEntity getBlockEntity(BlockPos pPos, LevelChunk.EntityCreationType pCreationType) -
addAndRegisterBlockEntity
-
isInLevel
private boolean isInLevel() -
isTicking
-
setBlockEntity
- Specified by:
setBlockEntity
in classChunkAccess
-
getBlockEntityNbtForSaving
@Nullable public CompoundTag getBlockEntityNbtForSaving(BlockPos pPos, HolderLookup.Provider pRegistries) - Specified by:
getBlockEntityNbtForSaving
in classChunkAccess
-
removeBlockEntity
- Specified by:
removeBlockEntity
in classChunkAccess
-
removeGameEventListener
-
removeGameEventListenerRegistry
private void removeGameEventListenerRegistry(int p_283355_) -
removeBlockEntityTicker
-
runPostLoad
public void runPostLoad() -
isEmpty
public boolean isEmpty() -
replaceWithPacketData
public void replaceWithPacketData(FriendlyByteBuf pBuffer, CompoundTag pTag, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> pOutputTagConsumer) -
replaceBiomes
-
setLoaded
public void setLoaded(boolean pLoaded) -
getLevel
- Overrides:
getLevel
in classChunkAccess
-
getBlockEntities
-
postProcessGeneration
public void postProcessGeneration() -
promotePendingBlockEntity
-
unpackTicks
public void unpackTicks(long pPos) -
registerTickContainerInLevel
-
unregisterTickContainerFromLevel
-
getPersistedStatus
- Specified by:
getPersistedStatus
in classChunkAccess
-
getFullStatus
-
setFullStatus
-
clearAllBlockEntities
public void clearAllBlockEntities() -
registerAllBlockEntitiesAfterLevelLoad
public void registerAllBlockEntitiesAfterLevelLoad() -
addGameEventListener
-
updateBlockEntityTicker
-
createTicker
private <T extends BlockEntity> TickingBlockEntity createTicker(T pBlockEntity, BlockEntityTicker<T> pTicker) -
getAuxLightManager
Description copied from interface:IBlockGetterExtension
Get theAuxiliaryLightManager
of the chunk at the givenChunkPos
.The light manager must be used to hold light values controlled by dynamic data from
BlockEntity
s to ensure access to the light data is thread-safe and the data is available during chunk load from disk whereBlockEntity
s are not yet added to the chunk.- Specified by:
getAuxLightManager
in interfaceIBlockGetterExtension
- Parameters:
pos
- The position of the chunk from which the light manager is requested- Returns:
- the light manager or
null
if the chunk is not accessible (ChunkSource.getChunkForLighting(int, int)
returnednull
) or the given implementation ofBlockGetter
does not implement this method
-