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
,StructureAccess
,LevelHeightAccessor
,ICapabilityProvider
,ICapabilityProviderImpl<LevelChunk>
,IForgeBlockGetter
- Direct Known Subclasses:
EmptyLevelChunk
-
Nested Class Summary
Modifier 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
Modifier and TypeFieldDescriptionprivate final LevelChunkTicks<Block>
private final CapabilityProvider.AsField<LevelChunk>
private boolean
private final LevelChunkTicks<Fluid>
private Supplier<ChunkHolder.FullChunkStatus>
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<GameEventDispatcher>
(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, noiseChunk, pendingBlockEntities, postProcessing, sections, unsaved, upgradeData
-
Constructor Summary
ConstructorDescriptionLevelChunk
(ServerLevel p_196850_, ProtoChunk p_196851_, LevelChunk.PostLoadProcessor p_196852_) LevelChunk
(Level p_187945_, ChunkPos p_187946_) LevelChunk
(Level p_196854_, ChunkPos p_196855_, UpgradeData p_196856_, LevelChunkTicks<Block> p_196857_, LevelChunkTicks<Fluid> p_196858_, long p_196859_, LevelChunkSection[] p_196860_, LevelChunk.PostLoadProcessor p_196861_, BlendingData p_196862_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAndRegisterBlockEntity
(BlockEntity p_156391_) void
Deprecated.private <T extends BlockEntity>
voidaddGameEventListener
(T p_223416_, ServerLevel p_223417_) boolean
boolean
void
private BlockEntity
createBlockEntity
(BlockPos p_62935_) private <T extends BlockEntity>
TickingBlockEntitycreateTicker
(T p_156376_, BlockEntityTicker<T> p_156377_) getBlockEntity
(BlockPos p_62912_) getBlockEntity
(BlockPos p_62868_, LevelChunk.EntityCreationType p_62869_) getBlockEntityNbtForSaving
(BlockPos p_62932_) getBlockState
(BlockPos p_62923_) <T> LazyOptional<T>
getCapability
(Capability<T> cap, Direction side) Retrieves the Optional handler for the capability requested on the specific side.getEventDispatcher
(int p_156372_) getFluidState
(int p_62815_, int p_62816_, int p_62817_) getFluidState
(BlockPos p_62895_) getLevel()
void
boolean
boolean
isEmpty()
private boolean
(package private) boolean
void
private BlockEntity
promotePendingBlockEntity
(BlockPos p_62871_, CompoundTag p_62872_) final void
Deprecated.void
void
registerTickContainerInLevel
(ServerLevel p_187959_) void
removeBlockEntity
(BlockPos p_62919_) private void
removeBlockEntityTicker
(BlockPos p_156413_) private <T extends BlockEntity>
voidremoveGameEventListener
(T p_223413_, ServerLevel p_223414_) void
replaceWithPacketData
(FriendlyByteBuf p_187972_, CompoundTag p_187973_, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> p_187974_) void
void
void
setBlockEntity
(BlockEntity p_156374_) setBlockState
(BlockPos p_62865_, BlockState p_62866_, boolean p_62867_) void
setClientLightReady
(boolean p_196865_) void
setFullStatus
(Supplier<ChunkHolder.FullChunkStatus> p_62880_) void
setLoaded
(boolean p_62914_) void
unpackTicks
(long p_187986_) void
unregisterTickContainerFromLevel
(ServerLevel p_187980_) private <T extends BlockEntity>
voidupdateBlockEntityTicker
(T p_156407_) final @Nullable CompoundTag
Deprecated.Methods inherited from class net.minecraft.world.level.chunk.ChunkAccess
addPackedPostProcess, addReferenceForStructure, carverBiome, fillBiomesFromNoise, getAllReferences, getAllStarts, getBelowZeroRetrogen, getBlendingData, getBlockEntitiesPos, getBlockEntityNbt, getHeight, getHeight, getHeightAccessorForGeneration, getHeightmaps, getHighestSection, getHighestSectionPosition, getInhabitedTime, getMinBuildHeight, getNoiseBiome, getOrCreateHeightmapUnprimed, getOrCreateNoiseChunk, getOrCreateOffsetList, getPos, getPostProcessing, getReferencesForStructure, getSection, getSections, getStartForStructure, getUpgradeData, hasAnyStructureReferences, hasPrimedHeightmap, incrementInhabitedTime, isLightCorrect, isOldNoiseGeneration, isUnsaved, isUpgrading, isYSpaceEmpty, markPosForPostprocessing, setAllReferences, setAllStarts, setBlendingData, setBlockEntityNbt, setHeightmap, setInhabitedTime, setLightCorrect, setStartForStructure, setUnsaved
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.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockGetter
getExistingBlockEntity, getModelDataManager
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 -
clientLightReady
private boolean clientLightReady -
level
-
fullStatus
-
postLoad
-
gameEventDispatcherSections
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<GameEventDispatcher> gameEventDispatcherSections -
blockTicks
-
fluidTicks
-
capProvider
-
-
Constructor Details
-
LevelChunk
-
LevelChunk
public LevelChunk(Level p_196854_, ChunkPos p_196855_, UpgradeData p_196856_, LevelChunkTicks<Block> p_196857_, LevelChunkTicks<Fluid> p_196858_, long p_196859_, @Nullable LevelChunkSection[] p_196860_, @Nullable LevelChunk.PostLoadProcessor p_196861_, @Nullable BlendingData p_196862_) -
LevelChunk
public LevelChunk(ServerLevel p_196850_, ProtoChunk p_196851_, @Nullable LevelChunk.PostLoadProcessor p_196852_)
-
-
Method Details
-
getBlockTicks
- Specified by:
getBlockTicks
in classChunkAccess
-
getFluidTicks
- Specified by:
getFluidTicks
in classChunkAccess
-
getTicksForSerialization
- Specified by:
getTicksForSerialization
in classChunkAccess
-
getEventDispatcher
- Overrides:
getEventDispatcher
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 p_62868_, LevelChunk.EntityCreationType p_62869_) -
addAndRegisterBlockEntity
-
isInLevel
private boolean isInLevel() -
isTicking
-
setBlockEntity
- Specified by:
setBlockEntity
in classChunkAccess
-
getBlockEntityNbtForSaving
- Specified by:
getBlockEntityNbtForSaving
in classChunkAccess
-
removeBlockEntity
- Specified by:
removeBlockEntity
in classChunkAccess
-
removeGameEventListener
-
removeBlockEntityTicker
-
runPostLoad
public void runPostLoad() -
isEmpty
public boolean isEmpty() -
replaceWithPacketData
public void replaceWithPacketData(FriendlyByteBuf p_187972_, CompoundTag p_187973_, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> p_187974_) -
setLoaded
public void setLoaded(boolean p_62914_) -
getLevel
-
getBlockEntities
-
getLights
- Specified by:
getLights
in classChunkAccess
-
postProcessGeneration
public void postProcessGeneration() -
promotePendingBlockEntity
-
unpackTicks
public void unpackTicks(long p_187986_) -
registerTickContainerInLevel
-
unregisterTickContainerFromLevel
-
getStatus
- Specified by:
getStatus
in classChunkAccess
-
getFullStatus
-
setFullStatus
-
clearAllBlockEntities
public void clearAllBlockEntities() -
registerAllBlockEntitiesAfterLevelLoad
public void registerAllBlockEntitiesAfterLevelLoad() -
addGameEventListener
-
updateBlockEntityTicker
-
createTicker
private <T extends BlockEntity> TickingBlockEntity createTicker(T p_156376_, BlockEntityTicker<T> p_156377_) -
isClientLightReady
public boolean isClientLightReady() -
setClientLightReady
public void setClientLightReady(boolean p_196865_) -
getCapability
@NotNull public <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) Description copied from interface:ICapabilityProvider
Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.- Specified by:
getCapability
in interfaceICapabilityProvider
- Parameters:
cap
- The capability to checkside
- The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'- Returns:
- The requested an optional holding the requested capability.
-
areCapsCompatible
- Specified by:
areCapsCompatible
in interfaceICapabilityProviderImpl<LevelChunk>
-
areCapsCompatible
- Specified by:
areCapsCompatible
in interfaceICapabilityProviderImpl<LevelChunk>
-
invalidateCaps
public void invalidateCaps()- Specified by:
invalidateCaps
in interfaceICapabilityProviderImpl<LevelChunk>
-
reviveCaps
public void reviveCaps()- Specified by:
reviveCaps
in interfaceICapabilityProviderImpl<LevelChunk>
-
writeCapsToNBT
Deprecated.FOR INTERNAL USE ONLYOnly public for use in
ChunkSerializer
. -
readCapsFromNBT
Deprecated.FOR INTERNAL USE ONLYOnly public for use in
ChunkSerializer
. -
getWorldForge
- Overrides:
getWorldForge
in classChunkAccess
-