Package net.minecraft.world.chunk
Class Chunk
- java.lang.Object
-
- net.minecraftforge.common.capabilities.CapabilityProvider<Chunk>
-
- net.minecraft.world.chunk.Chunk
-
- All Implemented Interfaces:
IChunk,IBlockReader,IStructureReader,ICapabilityProvider,IForgeChunk
- Direct Known Subclasses:
EmptyChunk
public class Chunk extends CapabilityProvider<Chunk> implements IChunk, IForgeChunk
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChunk.CreateEntityType
-
Field Summary
Fields Modifier and Type Field Description private BiomeContainerbiomesprivate java.util.Map<BlockPos,TileEntity>blockEntitiesprivate ITickList<Block>blockTicksprivate ChunkPoschunkPosstatic ChunkSectionEMPTY_SECTIONprivate ClassInheritanceMultiMap<Entity>[]entitySectionsprivate java.util.function.Supplier<ChunkHolder.LocationType>fullStatusprivate java.util.Map<Heightmap.Type,Heightmap>heightmapsprivate longinhabitedTimeprivate booleanisLightCorrectprivate booleanlastSaveHadEntitiesprivate longlastSaveTimeprivate Worldlevelprivate ITickList<Fluid>liquidTicksprivate booleanloadedprivate static org.apache.logging.log4j.LoggerLOGGERprivate java.util.Map<BlockPos,CompoundNBT>pendingBlockEntitiesprivate java.util.function.Consumer<Chunk>postLoadprivate it.unimi.dsi.fastutil.shorts.ShortList[]postProcessingprivate ChunkSection[]sectionsprivate java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet>structuresRefencesprivate java.util.Map<Structure<?>,StructureStart<?>>structureStartsprivate booleanunsavedprivate UpgradeDataupgradeData
-
Constructor Summary
Constructors Constructor Description Chunk(World p_i225780_1_, ChunkPos p_i225780_2_, BiomeContainer p_i225780_3_)Chunk(World p_i225781_1_, ChunkPos p_i225781_2_, BiomeContainer p_i225781_3_, UpgradeData p_i225781_4_, ITickList<Block> p_i225781_5_, ITickList<Fluid> p_i225781_6_, long p_i225781_7_, ChunkSection[] p_i225781_9_, java.util.function.Consumer<Chunk> p_i225781_10_)Chunk(World p_i49947_1_, ChunkPrimer p_i49947_2_)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBlockEntity(TileEntity p_150813_1_)voidaddEntity(Entity p_76612_1_)voidaddReferenceForFeature(Structure<?> p_230343_1_, long p_230343_2_)private TileEntitycreateBlockEntity(BlockPos p_177422_1_)java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet>getAllReferences()java.util.Map<Structure<?>,StructureStart<?>>getAllStarts()BiomeContainergetBiomes()java.util.Map<BlockPos,TileEntity>getBlockEntities()java.util.Set<BlockPos>getBlockEntitiesPos()TileEntitygetBlockEntity(BlockPos p_175625_1_)TileEntitygetBlockEntity(BlockPos p_177424_1_, Chunk.CreateEntityType p_177424_2_)CompoundNBTgetBlockEntityNbt(BlockPos p_201579_1_)CompoundNBTgetBlockEntityNbtForSaving(BlockPos p_223134_1_)BlockStategetBlockState(BlockPos p_180495_1_)ITickList<Block>getBlockTicks()voidgetEntities(Entity p_177414_1_, AxisAlignedBB p_177414_2_, java.util.List<Entity> p_177414_3_, java.util.function.Predicate<? super Entity> p_177414_4_)<T extends Entity>
voidgetEntities(EntityType<?> p_217313_1_, AxisAlignedBB p_217313_2_, java.util.List<? super T> p_217313_3_, java.util.function.Predicate<? super T> p_217313_4_)<T extends Entity>
voidgetEntitiesOfClass(java.lang.Class<? extends T> p_177430_1_, AxisAlignedBB p_177430_2_, java.util.List<T> p_177430_3_, java.util.function.Predicate<? super T> p_177430_4_)ClassInheritanceMultiMap<Entity>[]getEntitySections()FluidStategetFluidState(int p_205751_1_, int p_205751_2_, int p_205751_3_)FluidStategetFluidState(BlockPos p_204610_1_)ChunkHolder.LocationTypegetFullStatus()intgetHeight(Heightmap.Type p_201576_1_, int p_201576_2_, int p_201576_3_)java.util.Collection<java.util.Map.Entry<Heightmap.Type,Heightmap>>getHeightmaps()longgetInhabitedTime()WorldgetLevel()WorldLightManagergetLightEngine()java.util.stream.Stream<BlockPos>getLights()ITickList<Fluid>getLiquidTicks()HeightmapgetOrCreateHeightmapUnprimed(Heightmap.Type p_217303_1_)ChunkPosgetPos()it.unimi.dsi.fastutil.shorts.ShortList[]getPostProcessing()it.unimi.dsi.fastutil.longs.LongSetgetReferencesForFeature(Structure<?> p_230346_1_)ChunkSection[]getSections()StructureStart<?>getStartForFeature(Structure<?> p_230342_1_)ChunkStatusgetStatus()UpgradeDatagetUpgradeData()WorldgetWorldForge()booleanisEmpty()booleanisLightCorrect()booleanisUnsaved()voidmarkUnsaved()voidpackTicks(ServerWorld p_222880_1_)voidpostProcessGeneration()private TileEntitypromotePendingBlockEntity(BlockPos p_212815_1_, CompoundNBT p_212815_2_)voidreadCapsFromNBT(CompoundNBT tag)Deprecated.voidremoveBlockEntity(BlockPos p_177425_1_)voidremoveEntity(Entity p_76622_1_)voidremoveEntity(Entity p_76608_1_, int p_76608_2_)voidreplaceWithPacketData(BiomeContainer p_227073_1_, PacketBuffer p_227073_2_, CompoundNBT p_227073_3_, int p_227073_4_)voidrunPostLoad()voidsetAllReferences(java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_)voidsetAllStarts(java.util.Map<Structure<?>,StructureStart<?>> p_201612_1_)voidsetBlockEntity(BlockPos p_177426_1_, TileEntity p_177426_2_)voidsetBlockEntityNbt(CompoundNBT p_201591_1_)BlockStatesetBlockState(BlockPos p_177436_1_, BlockState p_177436_2_, boolean p_177436_3_)voidsetFullStatus(java.util.function.Supplier<ChunkHolder.LocationType> p_217314_1_)voidsetHeightmap(Heightmap.Type p_201607_1_, long[] p_201607_2_)voidsetInhabitedTime(long p_177415_1_)voidsetLastSaveHadEntities(boolean p_177409_1_)voidsetLastSaveTime(long p_177432_1_)voidsetLightCorrect(boolean p_217305_1_)voidsetLoaded(boolean p_177417_1_)voidsetStartForFeature(Structure<?> p_230344_1_, StructureStart<?> p_230344_2_)voidsetUnsaved(boolean p_177427_1_)voidunpackTicks()CompoundNBTwriteCapsToNBT()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.IBlockReader
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxBuildHeight, getMaxLightLevel
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
-
Methods inherited from interface net.minecraft.world.chunk.IChunk
addPackedPostProcess, getHighestSection, getHighestSectionPosition, isYSpaceEmpty, markPosForPostprocessing
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
EMPTY_SECTION
@Nullable public static final ChunkSection EMPTY_SECTION
-
sections
private final ChunkSection[] sections
-
biomes
private BiomeContainer biomes
-
pendingBlockEntities
private final java.util.Map<BlockPos,CompoundNBT> pendingBlockEntities
-
loaded
private boolean loaded
-
level
private final World level
-
heightmaps
private final java.util.Map<Heightmap.Type,Heightmap> heightmaps
-
upgradeData
private final UpgradeData upgradeData
-
blockEntities
private final java.util.Map<BlockPos,TileEntity> blockEntities
-
entitySections
private final ClassInheritanceMultiMap<Entity>[] entitySections
-
structureStarts
private final java.util.Map<Structure<?>,StructureStart<?>> structureStarts
-
structuresRefences
private final java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> structuresRefences
-
postProcessing
private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessing
-
lastSaveHadEntities
private boolean lastSaveHadEntities
-
lastSaveTime
private long lastSaveTime
-
unsaved
private volatile boolean unsaved
-
inhabitedTime
private long inhabitedTime
-
fullStatus
@Nullable private java.util.function.Supplier<ChunkHolder.LocationType> fullStatus
-
postLoad
@Nullable private java.util.function.Consumer<Chunk> postLoad
-
chunkPos
private final ChunkPos chunkPos
-
isLightCorrect
private volatile boolean isLightCorrect
-
-
Constructor Detail
-
Chunk
public Chunk(World p_i225780_1_, ChunkPos p_i225780_2_, BiomeContainer p_i225780_3_)
-
Chunk
public Chunk(World p_i225781_1_, ChunkPos p_i225781_2_, BiomeContainer p_i225781_3_, UpgradeData p_i225781_4_, ITickList<Block> p_i225781_5_, ITickList<Fluid> p_i225781_6_, long p_i225781_7_, @Nullable ChunkSection[] p_i225781_9_, @Nullable java.util.function.Consumer<Chunk> p_i225781_10_)
-
Chunk
public Chunk(World p_i49947_1_, ChunkPrimer p_i49947_2_)
-
-
Method Detail
-
getOrCreateHeightmapUnprimed
public Heightmap getOrCreateHeightmapUnprimed(Heightmap.Type p_217303_1_)
- Specified by:
getOrCreateHeightmapUnprimedin interfaceIChunk
-
getBlockEntitiesPos
public java.util.Set<BlockPos> getBlockEntitiesPos()
- Specified by:
getBlockEntitiesPosin interfaceIChunk
-
getSections
public ChunkSection[] getSections()
- Specified by:
getSectionsin interfaceIChunk
-
getBlockState
public BlockState getBlockState(BlockPos p_180495_1_)
- Specified by:
getBlockStatein interfaceIBlockReader
-
getFluidState
public FluidState getFluidState(BlockPos p_204610_1_)
- Specified by:
getFluidStatein interfaceIBlockReader
-
getFluidState
public FluidState getFluidState(int p_205751_1_, int p_205751_2_, int p_205751_3_)
-
setBlockState
@Nullable public BlockState setBlockState(BlockPos p_177436_1_, BlockState p_177436_2_, boolean p_177436_3_)
- Specified by:
setBlockStatein interfaceIChunk
-
getLightEngine
@Nullable public WorldLightManager getLightEngine()
-
setHeightmap
public void setHeightmap(Heightmap.Type p_201607_1_, long[] p_201607_2_)
- Specified by:
setHeightmapin interfaceIChunk
-
removeEntity
public void removeEntity(Entity p_76622_1_)
-
removeEntity
public void removeEntity(Entity p_76608_1_, int p_76608_2_)
-
getHeight
public int getHeight(Heightmap.Type p_201576_1_, int p_201576_2_, int p_201576_3_)
-
createBlockEntity
@Nullable private TileEntity createBlockEntity(BlockPos p_177422_1_)
-
getBlockEntity
@Nullable public TileEntity getBlockEntity(BlockPos p_175625_1_)
- Specified by:
getBlockEntityin interfaceIBlockReader
-
getBlockEntity
@Nullable public TileEntity getBlockEntity(BlockPos p_177424_1_, Chunk.CreateEntityType p_177424_2_)
-
addBlockEntity
public void addBlockEntity(TileEntity p_150813_1_)
-
setBlockEntity
public void setBlockEntity(BlockPos p_177426_1_, TileEntity p_177426_2_)
- Specified by:
setBlockEntityin interfaceIChunk
-
setBlockEntityNbt
public void setBlockEntityNbt(CompoundNBT p_201591_1_)
- Specified by:
setBlockEntityNbtin interfaceIChunk
-
getBlockEntityNbtForSaving
@Nullable public CompoundNBT getBlockEntityNbtForSaving(BlockPos p_223134_1_)
- Specified by:
getBlockEntityNbtForSavingin interfaceIChunk
-
removeBlockEntity
public void removeBlockEntity(BlockPos p_177425_1_)
- Specified by:
removeBlockEntityin interfaceIChunk
-
runPostLoad
public void runPostLoad()
-
markUnsaved
public void markUnsaved()
-
getEntities
public void getEntities(@Nullable Entity p_177414_1_, AxisAlignedBB p_177414_2_, java.util.List<Entity> p_177414_3_, @Nullable java.util.function.Predicate<? super Entity> p_177414_4_)
-
getEntities
public <T extends Entity> void getEntities(@Nullable EntityType<?> p_217313_1_, AxisAlignedBB p_217313_2_, java.util.List<? super T> p_217313_3_, java.util.function.Predicate<? super T> p_217313_4_)
-
getEntitiesOfClass
public <T extends Entity> void getEntitiesOfClass(java.lang.Class<? extends T> p_177430_1_, AxisAlignedBB p_177430_2_, java.util.List<T> p_177430_3_, @Nullable java.util.function.Predicate<? super T> p_177430_4_)
-
isEmpty
public boolean isEmpty()
-
replaceWithPacketData
public void replaceWithPacketData(@Nullable BiomeContainer p_227073_1_, PacketBuffer p_227073_2_, CompoundNBT p_227073_3_, int p_227073_4_)
-
getBiomes
public BiomeContainer getBiomes()
-
setLoaded
public void setLoaded(boolean p_177417_1_)
-
getLevel
public World getLevel()
-
getHeightmaps
public java.util.Collection<java.util.Map.Entry<Heightmap.Type,Heightmap>> getHeightmaps()
- Specified by:
getHeightmapsin interfaceIChunk
-
getBlockEntities
public java.util.Map<BlockPos,TileEntity> getBlockEntities()
-
getEntitySections
public ClassInheritanceMultiMap<Entity>[] getEntitySections()
-
getBlockEntityNbt
public CompoundNBT getBlockEntityNbt(BlockPos p_201579_1_)
- Specified by:
getBlockEntityNbtin interfaceIChunk
-
getLights
public java.util.stream.Stream<BlockPos> getLights()
-
getBlockTicks
public ITickList<Block> getBlockTicks()
- Specified by:
getBlockTicksin interfaceIChunk
-
getLiquidTicks
public ITickList<Fluid> getLiquidTicks()
- Specified by:
getLiquidTicksin interfaceIChunk
-
setUnsaved
public void setUnsaved(boolean p_177427_1_)
- Specified by:
setUnsavedin interfaceIChunk
-
setLastSaveHadEntities
public void setLastSaveHadEntities(boolean p_177409_1_)
-
setLastSaveTime
public void setLastSaveTime(long p_177432_1_)
- Specified by:
setLastSaveTimein interfaceIChunk
-
getStartForFeature
@Nullable public StructureStart<?> getStartForFeature(Structure<?> p_230342_1_)
- Specified by:
getStartForFeaturein interfaceIStructureReader
-
setStartForFeature
public void setStartForFeature(Structure<?> p_230344_1_, StructureStart<?> p_230344_2_)
- Specified by:
setStartForFeaturein interfaceIStructureReader
-
getAllStarts
public java.util.Map<Structure<?>,StructureStart<?>> getAllStarts()
- Specified by:
getAllStartsin interfaceIChunk
-
setAllStarts
public void setAllStarts(java.util.Map<Structure<?>,StructureStart<?>> p_201612_1_)
- Specified by:
setAllStartsin interfaceIChunk
-
getReferencesForFeature
public it.unimi.dsi.fastutil.longs.LongSet getReferencesForFeature(Structure<?> p_230346_1_)
- Specified by:
getReferencesForFeaturein interfaceIStructureReader
-
addReferenceForFeature
public void addReferenceForFeature(Structure<?> p_230343_1_, long p_230343_2_)
- Specified by:
addReferenceForFeaturein interfaceIStructureReader
-
getAllReferences
public java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> getAllReferences()
- Specified by:
getAllReferencesin interfaceIStructureReader
-
setAllReferences
public void setAllReferences(java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_)
- Specified by:
setAllReferencesin interfaceIStructureReader
-
getInhabitedTime
public long getInhabitedTime()
- Specified by:
getInhabitedTimein interfaceIChunk
-
setInhabitedTime
public void setInhabitedTime(long p_177415_1_)
- Specified by:
setInhabitedTimein interfaceIChunk
-
postProcessGeneration
public void postProcessGeneration()
-
promotePendingBlockEntity
@Nullable private TileEntity promotePendingBlockEntity(BlockPos p_212815_1_, CompoundNBT p_212815_2_)
-
getUpgradeData
public UpgradeData getUpgradeData()
- Specified by:
getUpgradeDatain interfaceIChunk
-
getPostProcessing
public it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessing()
- Specified by:
getPostProcessingin interfaceIChunk
-
unpackTicks
public void unpackTicks()
-
packTicks
public void packTicks(ServerWorld p_222880_1_)
-
getStatus
public ChunkStatus getStatus()
-
getFullStatus
public ChunkHolder.LocationType getFullStatus()
-
setFullStatus
public void setFullStatus(java.util.function.Supplier<ChunkHolder.LocationType> p_217314_1_)
-
isLightCorrect
public boolean isLightCorrect()
- Specified by:
isLightCorrectin interfaceIChunk
-
setLightCorrect
public void setLightCorrect(boolean p_217305_1_)
- Specified by:
setLightCorrectin interfaceIChunk
-
writeCapsToNBT
@Deprecated @Nullable public final CompoundNBT writeCapsToNBT()
Deprecated.FOR INTERNAL USE ONLYOnly public for use in
AnvilChunkLoader.
-
readCapsFromNBT
@Deprecated public final void readCapsFromNBT(CompoundNBT tag)
Deprecated.FOR INTERNAL USE ONLYOnly public for use in
AnvilChunkLoader.
-
getWorldForge
public World getWorldForge()
- Specified by:
getWorldForgein interfaceIChunk
-
-