Package net.minecraft.world.level.chunk
Class LevelChunk
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<LevelChunk>
net.minecraft.world.level.chunk.LevelChunk
- All Implemented Interfaces:
BlockGetter
,ChunkAccess
,FeatureAccess
,LevelHeightAccessor
,ICapabilityProvider
,IForgeLevelChunk
- Direct Known Subclasses:
EmptyLevelChunk
public class LevelChunk
extends CapabilityProvider<LevelChunk>
implements ChunkAccess, IForgeLevelChunk
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
static class
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate ChunkBiomeContainer
private Map<BlockPos,BlockEntity>
private ChunkPos
static LevelChunkSection
private Supplier<ChunkHolder.FullChunkStatus>
private it.unimi.dsi.fastutil.ints.Int2ObjectMap<GameEventDispatcher>
private Map<Heightmap.Types,Heightmap>
private long
private boolean
(package private) Level
private boolean
(package private) static org.apache.logging.log4j.Logger
private static TickingBlockEntity
private Map<BlockPos,CompoundTag>
private Consumer<LevelChunk>
private it.unimi.dsi.fastutil.shorts.ShortList[]
private LevelChunkSection[]
private Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet>
private Map<StructureFeature<?>,StructureStart<?>>
private boolean
private UpgradeData
-
Constructor Summary
ConstructorDescriptionLevelChunk(ServerLevel p_156365_, ProtoChunk p_156366_, Consumer<LevelChunk> p_156367_)
LevelChunk(Level p_62796_, ChunkPos p_62797_, ChunkBiomeContainer p_62798_)
LevelChunk(Level p_62800_, ChunkPos p_62801_, ChunkBiomeContainer p_62802_, UpgradeData p_62803_, TickList<Block> p_62804_, TickList<Fluid> p_62805_, long p_62806_, LevelChunkSection[] p_62807_, Consumer<LevelChunk> p_62808_)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAndRegisterBlockEntity(BlockEntity p_156391_)
void
Deprecated.private <T extends BlockEntity>
voidaddGameEventListener(T p_156405_)
void
addReferenceForFeature(StructureFeature<?> p_62856_, long p_62857_)
private BlockEntity
createBlockEntity(BlockPos p_62935_)
private <T extends BlockEntity>
TickingBlockEntitycreateTicker(T p_156376_, BlockEntityTicker<T> p_156377_)
Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet>
Map<StructureFeature<?>,StructureStart<?>>
getBlockEntity(BlockPos p_62912_)
getBlockEntity(BlockPos p_62868_, LevelChunk.EntityCreationType p_62869_)
getBlockEntityNbt(BlockPos p_62929_)
getBlockEntityNbtForSaving(BlockPos p_62932_)
getBlockState(BlockPos p_62923_)
getEventDispatcher(int p_156372_)
getFluidState(int p_62815_, int p_62816_, int p_62817_)
getFluidState(BlockPos p_62895_)
getHeighestPosition(Heightmap.Types p_156393_)
int
int
getHeight(Heightmap.Types p_62847_, int p_62848_, int p_62849_)
long
getLevel()
int
getOrCreateHeightmapUnprimed(Heightmap.Types p_62845_)
getPos()
it.unimi.dsi.fastutil.shorts.ShortList[]
it.unimi.dsi.fastutil.longs.LongSet
getReferencesForFeature(StructureFeature<?> p_62893_)
getStartForFeature(StructureFeature<?> p_62854_)
void
boolean
isEmpty()
private boolean
boolean
(package private) boolean
boolean
void
private void
onBlockEntityRemove(BlockEntity p_156401_)
void
packTicks(ServerLevel p_62824_)
void
private BlockEntity
promotePendingBlockEntity(BlockPos p_62871_, CompoundTag p_62872_)
void
readCapsFromNBT(CompoundTag tag)
Deprecated.void
void
removeBlockEntity(BlockPos p_62919_)
private void
removeBlockEntityTicker(BlockPos p_156413_)
private <T extends BlockEntity>
voidremoveGameEventListener(T p_156397_)
void
replaceWithPacketData(ChunkBiomeContainer p_156384_, FriendlyByteBuf p_156385_, CompoundTag p_156386_, BitSet p_156387_)
void
void
setAllReferences(Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> p_62897_)
void
setAllStarts(Map<StructureFeature<?>,StructureStart<?>> p_62878_)
void
setBlockEntity(BlockEntity p_156374_)
void
setBlockEntityNbt(CompoundTag p_62882_)
setBlockState(BlockPos p_62865_, BlockState p_62866_, boolean p_62867_)
void
setFullStatus(Supplier<ChunkHolder.FullChunkStatus> p_62880_)
void
setInhabitedTime(long p_62890_)
void
setLightCorrect(boolean p_62899_)
void
setLoaded(boolean p_62914_)
void
setStartForFeature(StructureFeature<?> p_62859_, StructureStart<?> p_62860_)
void
setUnsaved(boolean p_62884_)
void
private <T extends BlockEntity>
voidupdateBlockEntityTicker(T p_156407_)
Deprecated.Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
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.minecraft.world.level.chunk.ChunkAccess
addPackedPostProcess, getHighestSection, getHighestSectionPosition, getOrCreateSection, isYSpaceEmpty, markPosForPostprocessing, setHeightmap
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
-
Field Details
-
LOGGER
static final org.apache.logging.log4j.Logger LOGGER -
NULL_TICKER
-
EMPTY_SECTION
-
sections
-
biomes
-
pendingBlockEntities
-
tickersInLevel
-
loaded
private boolean loaded -
level
-
heightmaps
-
upgradeData
-
blockEntities
-
structureStarts
-
structuresRefences
-
postProcessing
private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessing -
blockTicks
-
liquidTicks
-
unsaved
private volatile boolean unsaved -
inhabitedTime
private long inhabitedTime -
fullStatus
-
postLoad
-
chunkPos
-
isLightCorrect
private volatile boolean isLightCorrect -
gameEventDispatcherSections
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<GameEventDispatcher> gameEventDispatcherSections
-
-
Constructor Details
-
LevelChunk
-
LevelChunk
public LevelChunk(Level p_62800_, ChunkPos p_62801_, ChunkBiomeContainer p_62802_, UpgradeData p_62803_, TickList<Block> p_62804_, TickList<Fluid> p_62805_, long p_62806_, @Nullable LevelChunkSection[] p_62807_, @Nullable Consumer<LevelChunk> p_62808_) -
LevelChunk
public LevelChunk(ServerLevel p_156365_, ProtoChunk p_156366_, @Nullable Consumer<LevelChunk> p_156367_)
-
-
Method Details
-
getEventDispatcher
- Specified by:
getEventDispatcher
in interfaceChunkAccess
-
getOrCreateHeightmapUnprimed
- Specified by:
getOrCreateHeightmapUnprimed
in interfaceChunkAccess
-
getBlockEntitiesPos
- Specified by:
getBlockEntitiesPos
in interfaceChunkAccess
-
getSections
- Specified by:
getSections
in interfaceChunkAccess
-
getBlockState
- Specified by:
getBlockState
in interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidState
in interfaceBlockGetter
-
getFluidState
-
setBlockState
@Nullable public BlockState setBlockState(BlockPos p_62865_, BlockState p_62866_, boolean p_62867_)- Specified by:
setBlockState
in interfaceChunkAccess
-
addEntity
Deprecated.- Specified by:
addEntity
in interfaceChunkAccess
-
getHeight
- Specified by:
getHeight
in interfaceChunkAccess
-
getHeighestPosition
- Specified by:
getHeighestPosition
in interfaceChunkAccess
-
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 interfaceChunkAccess
-
setBlockEntityNbt
- Specified by:
setBlockEntityNbt
in interfaceChunkAccess
-
getBlockEntityNbtForSaving
- Specified by:
getBlockEntityNbtForSaving
in interfaceChunkAccess
-
removeBlockEntity
- Specified by:
removeBlockEntity
in interfaceChunkAccess
-
removeGameEventListener
-
removeBlockEntityTicker
-
runPostLoad
public void runPostLoad() -
markUnsaved
public void markUnsaved() -
isEmpty
public boolean isEmpty() -
getPos
- Specified by:
getPos
in interfaceChunkAccess
-
replaceWithPacketData
public void replaceWithPacketData(@Nullable ChunkBiomeContainer p_156384_, FriendlyByteBuf p_156385_, CompoundTag p_156386_, BitSet p_156387_) -
onBlockEntityRemove
-
getBiomes
- Specified by:
getBiomes
in interfaceChunkAccess
-
setLoaded
public void setLoaded(boolean p_62914_) -
getLevel
-
getHeightmaps
- Specified by:
getHeightmaps
in interfaceChunkAccess
-
getBlockEntities
-
getBlockEntityNbt
- Specified by:
getBlockEntityNbt
in interfaceChunkAccess
-
getLights
- Specified by:
getLights
in interfaceChunkAccess
-
getBlockTicks
- Specified by:
getBlockTicks
in interfaceChunkAccess
-
getLiquidTicks
- Specified by:
getLiquidTicks
in interfaceChunkAccess
-
setUnsaved
public void setUnsaved(boolean p_62884_)- Specified by:
setUnsaved
in interfaceChunkAccess
-
isUnsaved
public boolean isUnsaved()- Specified by:
isUnsaved
in interfaceChunkAccess
-
getStartForFeature
- Specified by:
getStartForFeature
in interfaceFeatureAccess
-
setStartForFeature
- Specified by:
setStartForFeature
in interfaceFeatureAccess
-
getAllStarts
- Specified by:
getAllStarts
in interfaceChunkAccess
-
setAllStarts
- Specified by:
setAllStarts
in interfaceChunkAccess
-
getReferencesForFeature
- Specified by:
getReferencesForFeature
in interfaceFeatureAccess
-
addReferenceForFeature
- Specified by:
addReferenceForFeature
in interfaceFeatureAccess
-
getAllReferences
- Specified by:
getAllReferences
in interfaceFeatureAccess
-
setAllReferences
public void setAllReferences(Map<StructureFeature<?>,it.unimi.dsi.fastutil.longs.LongSet> p_62897_)- Specified by:
setAllReferences
in interfaceFeatureAccess
-
getInhabitedTime
public long getInhabitedTime()- Specified by:
getInhabitedTime
in interfaceChunkAccess
-
setInhabitedTime
public void setInhabitedTime(long p_62890_)- Specified by:
setInhabitedTime
in interfaceChunkAccess
-
postProcessGeneration
public void postProcessGeneration() -
promotePendingBlockEntity
-
getUpgradeData
- Specified by:
getUpgradeData
in interfaceChunkAccess
-
getPostProcessing
public it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessing()- Specified by:
getPostProcessing
in interfaceChunkAccess
-
unpackTicks
public void unpackTicks() -
packTicks
-
getMinBuildHeight
public int getMinBuildHeight()- Specified by:
getMinBuildHeight
in interfaceLevelHeightAccessor
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceLevelHeightAccessor
-
getStatus
- Specified by:
getStatus
in interfaceChunkAccess
-
getFullStatus
-
setFullStatus
-
isLightCorrect
public boolean isLightCorrect()- Specified by:
isLightCorrect
in interfaceChunkAccess
-
setLightCorrect
public void setLightCorrect(boolean p_62899_)- Specified by:
setLightCorrect
in interfaceChunkAccess
-
invalidateAllBlockEntities
public void invalidateAllBlockEntities() -
registerAllBlockEntitiesAfterLevelLoad
public void registerAllBlockEntitiesAfterLevelLoad() -
addGameEventListener
-
updateBlockEntityTicker
-
createTicker
private <T extends BlockEntity> TickingBlockEntity createTicker(T p_156376_, BlockEntityTicker<T> p_156377_) -
writeCapsToNBT
Deprecated.FOR INTERNAL USE ONLYOnly public for use in
ChunkSerializer
. -
readCapsFromNBT
Deprecated.FOR INTERNAL USE ONLYOnly public for use in
ChunkSerializer
. -
getWorldForge
- Specified by:
getWorldForge
in interfaceChunkAccess
-