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:
DebugValueSource,BiomeManager.NoiseBiomeSource,BlockGetter,LightChunk,StructureAccess,LevelHeightAccessor,IAttachmentHolder,IBlockGetterExtension
- Direct Known Subclasses:
EmptyLevelChunk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classstatic enumstatic interface(package private) static classstatic interfaceNested classes/interfaces inherited from class net.minecraft.world.level.chunk.ChunkAccess
ChunkAccess.ChunkPathElement, ChunkAccess.PackedTicksNested classes/interfaces inherited from interface net.minecraft.world.level.BlockGetter
BlockGetter.BlockStepVisitorNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LevelChunkAuxiliaryLightManagerprivate final LevelChunkTicks<Block> private final LevelChunkTicks<Fluid> private Supplier<FullChunkStatus> private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<GameEventListenerRegistry> (package private) final Levelprivate boolean(package private) static final org.slf4j.Loggerprivate static final TickingBlockEntityprivate LevelChunk.PostLoadProcessorprivate final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> private LevelChunk.UnsavedListenerFields inherited from class net.minecraft.world.level.chunk.ChunkAccess
blendingData, blockEntities, chunkPos, heightmaps, levelHeightAccessor, NO_FILLED_SECTION, noiseChunk, pendingBlockEntities, postProcessing, sections, skyLightSources, 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 TypeMethodDescriptionvoidaddAndRegisterBlockEntity(BlockEntity pBlockEntity) voidDeprecated.private <T extends BlockEntity>
voidaddGameEventListener(T pBlockEntity, ServerLevel pLevel) voidprivate BlockEntitycreateBlockEntity(BlockPos pPos) private <T extends BlockEntity>
TickingBlockEntitycreateTicker(T pBlockEntity, BlockEntityTicker<T> pTicker) Get theAuxiliaryLightManagerof the chunk at the givenChunkPos.getBlockEntity(BlockPos p_62912_) getBlockEntity(BlockPos pPos, LevelChunk.EntityCreationType pCreationType) getBlockEntityNbtForSaving(BlockPos p_62932_, HolderLookup.Provider p_323699_) getBlockState(BlockPos p_62923_) getFluidState(int pX, int pY, int pZ) getFluidState(BlockPos p_62895_) getLevel()getListenerRegistry(int p_251193_) getTicksForSerialization(long p_361545_) booleanisEmpty()private boolean(package private) booleanvoidvoidpostProcessGeneration(ServerLevel pLevel) private BlockEntitypromotePendingBlockEntity(BlockPos pPos, CompoundTag pTag) voidvoidregisterDebugValues(ServerLevel p_449159_, DebugValueSource.Registration p_449975_) voidvoidremoveBlockEntity(BlockPos p_62919_) private voidprivate <T extends BlockEntity>
voidremoveGameEventListener(T pBlockEntity, ServerLevel pLevel) private voidremoveGameEventListenerRegistry(int pSectionY) voidreplaceBiomes(FriendlyByteBuf pBuffer) voidreplaceWithPacketData(FriendlyByteBuf pBuffer, Map<Heightmap.Types, long[]> pHeightmaps, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> pOutputTagConsumer) voidvoidsetBlockEntity(BlockEntity p_156374_) setBlockState(BlockPos p_62865_, BlockState p_62866_, int p_393859_) voidsetFullStatus(Supplier<FullChunkStatus> pFullStatus) voidsetLoaded(boolean pLoaded) voidsetUnsavedListener(LevelChunk.UnsavedListener pUnsavedListener) final voidsyncData(AttachmentType<?> type) Syncs a data attachment of the given type with all relevant clients.voidunpackTicks(long pPos) voidprivate <T extends BlockEntity>
voidupdateBlockEntityTicker(T pBlockEntity) Methods inherited from class net.minecraft.world.level.chunk.ChunkAccess
addPackedPostProcess, addReferenceForStructure, canBeSerialized, carverBiome, fillBiomesFromNoise, findBlockLightSources, findBlocks, findBlocks, getAllReferences, getAllStarts, getAttachmentHolder, getBelowZeroRetrogen, getBlendingData, getBlockEntitiesPos, getBlockEntityNbt, getData, getExistingDataOrNull, getHeight, getHeight, getHeightAccessorForGeneration, getHeightmaps, getHighestFilledSectionIndex, getHighestGeneratedStatus, getHighestSectionPosition, getInhabitedTime, getMinY, getNoiseBiome, getOrCreateHeightmapUnprimed, getOrCreateNoiseChunk, getOrCreateOffsetList, getPos, getPostProcessing, getReferencesForStructure, getSection, getSections, getSkyLightSources, getStartForStructure, getUpgradeData, hasAnyStructureReferences, hasAttachments, hasData, hasPrimedHeightmap, incrementInhabitedTime, initializeLightSources, isLightCorrect, isOldNoiseGeneration, isUnsaved, isUpgrading, isYSpaceEmpty, markPosForPostprocessing, problemPath, problemPath, readAttachmentsFromNBT, removeData, setAllReferences, setAllStarts, setBlockEntityNbt, setBlockState, setData, setHeightmap, setInhabitedTime, setLightCorrect, setStartForStructure, tryMarkSaved, writeAttachmentsToNBTMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, isBlockInLineMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getData, getExistingData, getExistingData, getExistingDataOrNull, getExistingDataOrNull, hasAttachments, hasData, hasData, removeData, removeData, setData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getModelDataMethods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxSectionY, getMaxY, getMinSectionY, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isInsideBuildHeight, 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
-
unsavedListener
-
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
-
setUnsavedListener
-
markUnsaved
public void markUnsaved()- Overrides:
markUnsavedin classChunkAccess
-
getBlockTicks
- Specified by:
getBlockTicksin classChunkAccess
-
getFluidTicks
- Specified by:
getFluidTicksin classChunkAccess
-
getTicksForSerialization
- Specified by:
getTicksForSerializationin classChunkAccess
-
getListenerRegistry
- Overrides:
getListenerRegistryin classChunkAccess
-
getBlockState
- Specified by:
getBlockStatein interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidStatein interfaceBlockGetter
-
getFluidState
-
setBlockState
- Specified by:
setBlockStatein classChunkAccess
-
addEntity
Deprecated.- Specified by:
addEntityin classChunkAccess
-
createBlockEntity
-
getBlockEntity
- Specified by:
getBlockEntityin interfaceBlockGetter
-
getBlockEntity
@Nullable public BlockEntity getBlockEntity(BlockPos pPos, LevelChunk.EntityCreationType pCreationType) -
addAndRegisterBlockEntity
-
isInLevel
private boolean isInLevel() -
isTicking
-
setBlockEntity
- Specified by:
setBlockEntityin classChunkAccess
-
getBlockEntityNbtForSaving
@Nullable public CompoundTag getBlockEntityNbtForSaving(BlockPos p_62932_, HolderLookup.Provider p_323699_) - Specified by:
getBlockEntityNbtForSavingin classChunkAccess
-
removeBlockEntity
- Specified by:
removeBlockEntityin classChunkAccess
-
removeGameEventListener
-
removeGameEventListenerRegistry
private void removeGameEventListenerRegistry(int pSectionY) -
removeBlockEntityTicker
-
runPostLoad
public void runPostLoad() -
isEmpty
public boolean isEmpty() -
replaceWithPacketData
public void replaceWithPacketData(FriendlyByteBuf pBuffer, Map<Heightmap.Types, long[]> pHeightmaps, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> pOutputTagConsumer) -
replaceBiomes
-
setLoaded
public void setLoaded(boolean pLoaded) -
getLevel
- Overrides:
getLevelin classChunkAccess
-
getBlockEntities
-
postProcessGeneration
-
promotePendingBlockEntity
-
unpackTicks
public void unpackTicks(long pPos) -
registerTickContainerInLevel
-
unregisterTickContainerFromLevel
-
registerDebugValues
- Specified by:
registerDebugValuesin interfaceDebugValueSource
-
getPersistedStatus
- Specified by:
getPersistedStatusin 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:IBlockGetterExtensionGet theAuxiliaryLightManagerof the chunk at the givenChunkPos.The light manager must be used to hold light values controlled by dynamic data from
BlockEntitys to ensure access to the light data is thread-safe and the data is available during chunk load from disk whereBlockEntitys are not yet added to the chunk.- Specified by:
getAuxLightManagerin interfaceIBlockGetterExtension- Parameters:
pos- The position of the chunk from which the light manager is requested- Returns:
- the light manager or
nullif the chunk is not accessible (ChunkSource.getChunkForLighting(int, int)returnednull) or the given implementation ofBlockGetterdoes not implement this method
-
syncData
Description copied from interface:IAttachmentHolderSyncs a data attachment of the given type with all relevant clients.If there is currently no attachment of the given type, the removal of the attachment is synced to the client.
- Specified by:
syncDatain interfaceIAttachmentHolder- See Also:
-