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) classstatic enumstatic interface(package private) classNested classes/interfaces inherited from class net.minecraft.world.level.chunk.ChunkAccess
ChunkAccess.TicksToSave -
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> 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 level, ProtoChunk chunk, LevelChunk.PostLoadProcessor postLoad) LevelChunk(Level level, ChunkPos pos) LevelChunk(Level level, ChunkPos pos, UpgradeData data, LevelChunkTicks<Block> blockTicks, LevelChunkTicks<Fluid> fluidTicks, long inhabitedTime, LevelChunkSection[] sections, LevelChunk.PostLoadProcessor postLoad, BlendingData blendingData) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAndRegisterBlockEntity(BlockEntity blockEntity) voidDeprecated.private <T extends BlockEntity>
voidaddGameEventListener(T blockEntity, ServerLevel level) voidprivate BlockEntityprivate <T extends BlockEntity>
TickingBlockEntitycreateTicker(T blockEntity, BlockEntityTicker<T> ticker) Get theAuxiliaryLightManagerof the chunk at the givenChunkPos.getBlockEntity(BlockPos pos) getBlockEntity(BlockPos pos, LevelChunk.EntityCreationType creationType) getBlockEntityNbtForSaving(BlockPos pos, HolderLookup.Provider registries) getBlockState(BlockPos pos) getFluidState(int x, int y, int z) getFluidState(BlockPos pos) getLevel()getListenerRegistry(int sectionY) booleanisEmpty()private boolean(package private) booleanvoidprivate BlockEntitypromotePendingBlockEntity(BlockPos pos, CompoundTag tag) voidvoidvoidprivate voidprivate <T extends BlockEntity>
voidremoveGameEventListener(T blockEntity, ServerLevel level) private voidremoveGameEventListenerRegistry(int sectionY) voidreplaceBiomes(FriendlyByteBuf buffer) voidreplaceWithPacketData(FriendlyByteBuf buffer, CompoundTag tag, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> outputTagConsumer) voidvoidsetBlockEntity(BlockEntity blockEntity) setBlockState(BlockPos pos, BlockState state, boolean isMoving) voidsetFullStatus(Supplier<FullChunkStatus> fullStatus) voidsetLoaded(boolean loaded) voidunpackTicks(long pos) voidprivate <T extends BlockEntity>
voidupdateBlockEntityTicker(T blockEntity) 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, 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, getMaxLightLevel, isBlockInLineMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getData, getExistingData, getExistingData, getExistingDataOrNull, getExistingDataOrNull, hasAttachments, hasData, hasData, removeData, removeData, setData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getModelDataMethods 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 level, ChunkPos pos, UpgradeData data, LevelChunkTicks<Block> blockTicks, LevelChunkTicks<Fluid> fluidTicks, long inhabitedTime, @Nullable LevelChunkSection[] sections, @Nullable LevelChunk.PostLoadProcessor postLoad, @Nullable BlendingData blendingData) -
LevelChunk
public LevelChunk(ServerLevel level, ProtoChunk chunk, @Nullable LevelChunk.PostLoadProcessor postLoad)
-
-
Method Details
-
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 pos, LevelChunk.EntityCreationType creationType) -
addAndRegisterBlockEntity
-
isInLevel
private boolean isInLevel() -
isTicking
-
setBlockEntity
- Specified by:
setBlockEntityin classChunkAccess
-
getBlockEntityNbtForSaving
@Nullable public CompoundTag getBlockEntityNbtForSaving(BlockPos pos, HolderLookup.Provider registries) - Specified by:
getBlockEntityNbtForSavingin classChunkAccess
-
removeBlockEntity
- Specified by:
removeBlockEntityin classChunkAccess
-
removeGameEventListener
-
removeGameEventListenerRegistry
private void removeGameEventListenerRegistry(int sectionY) -
removeBlockEntityTicker
-
runPostLoad
public void runPostLoad() -
isEmpty
public boolean isEmpty() -
replaceWithPacketData
public void replaceWithPacketData(FriendlyByteBuf buffer, CompoundTag tag, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> outputTagConsumer) -
replaceBiomes
-
setLoaded
public void setLoaded(boolean loaded) -
getLevel
- Overrides:
getLevelin classChunkAccess
-
getBlockEntities
-
postProcessGeneration
public void postProcessGeneration() -
promotePendingBlockEntity
-
unpackTicks
public void unpackTicks(long pos) -
registerTickContainerInLevel
-
unregisterTickContainerFromLevel
-
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 blockEntity, BlockEntityTicker<T> ticker) -
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
-