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 class
Chunk.CreateEntityType
-
Field Summary
Fields Modifier and Type Field Description private BiomeContainer
biomes
private java.util.Map<BlockPos,TileEntity>
blockEntities
private ITickList<Block>
blockTicks
private ChunkPos
chunkPos
static ChunkSection
EMPTY_SECTION
private ClassInheritanceMultiMap<Entity>[]
entitySections
private java.util.function.Supplier<ChunkHolder.LocationType>
fullStatus
private java.util.Map<Heightmap.Type,Heightmap>
heightmaps
private long
inhabitedTime
private boolean
isLightCorrect
private boolean
lastSaveHadEntities
private long
lastSaveTime
private World
level
private ITickList<Fluid>
liquidTicks
private boolean
loaded
private static org.apache.logging.log4j.Logger
LOGGER
private java.util.Map<BlockPos,CompoundNBT>
pendingBlockEntities
private java.util.function.Consumer<Chunk>
postLoad
private it.unimi.dsi.fastutil.shorts.ShortList[]
postProcessing
private ChunkSection[]
sections
private java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet>
structuresRefences
private java.util.Map<Structure<?>,StructureStart<?>>
structureStarts
private boolean
unsaved
private UpgradeData
upgradeData
-
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 void
addBlockEntity(TileEntity p_150813_1_)
void
addEntity(Entity p_76612_1_)
void
addReferenceForFeature(Structure<?> p_230343_1_, long p_230343_2_)
private TileEntity
createBlockEntity(BlockPos p_177422_1_)
java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet>
getAllReferences()
java.util.Map<Structure<?>,StructureStart<?>>
getAllStarts()
BiomeContainer
getBiomes()
java.util.Map<BlockPos,TileEntity>
getBlockEntities()
java.util.Set<BlockPos>
getBlockEntitiesPos()
TileEntity
getBlockEntity(BlockPos p_175625_1_)
TileEntity
getBlockEntity(BlockPos p_177424_1_, Chunk.CreateEntityType p_177424_2_)
CompoundNBT
getBlockEntityNbt(BlockPos p_201579_1_)
CompoundNBT
getBlockEntityNbtForSaving(BlockPos p_223134_1_)
BlockState
getBlockState(BlockPos p_180495_1_)
ITickList<Block>
getBlockTicks()
void
getEntities(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()
FluidState
getFluidState(int p_205751_1_, int p_205751_2_, int p_205751_3_)
FluidState
getFluidState(BlockPos p_204610_1_)
ChunkHolder.LocationType
getFullStatus()
int
getHeight(Heightmap.Type p_201576_1_, int p_201576_2_, int p_201576_3_)
java.util.Collection<java.util.Map.Entry<Heightmap.Type,Heightmap>>
getHeightmaps()
long
getInhabitedTime()
World
getLevel()
WorldLightManager
getLightEngine()
java.util.stream.Stream<BlockPos>
getLights()
ITickList<Fluid>
getLiquidTicks()
Heightmap
getOrCreateHeightmapUnprimed(Heightmap.Type p_217303_1_)
ChunkPos
getPos()
it.unimi.dsi.fastutil.shorts.ShortList[]
getPostProcessing()
it.unimi.dsi.fastutil.longs.LongSet
getReferencesForFeature(Structure<?> p_230346_1_)
ChunkSection[]
getSections()
StructureStart<?>
getStartForFeature(Structure<?> p_230342_1_)
ChunkStatus
getStatus()
UpgradeData
getUpgradeData()
World
getWorldForge()
boolean
isEmpty()
boolean
isLightCorrect()
boolean
isUnsaved()
void
markUnsaved()
void
packTicks(ServerWorld p_222880_1_)
void
postProcessGeneration()
private TileEntity
promotePendingBlockEntity(BlockPos p_212815_1_, CompoundNBT p_212815_2_)
void
readCapsFromNBT(CompoundNBT tag)
Deprecated.void
removeBlockEntity(BlockPos p_177425_1_)
void
removeEntity(Entity p_76622_1_)
void
removeEntity(Entity p_76608_1_, int p_76608_2_)
void
replaceWithPacketData(BiomeContainer p_227073_1_, PacketBuffer p_227073_2_, CompoundNBT p_227073_3_, int p_227073_4_)
void
runPostLoad()
void
setAllReferences(java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_)
void
setAllStarts(java.util.Map<Structure<?>,StructureStart<?>> p_201612_1_)
void
setBlockEntity(BlockPos p_177426_1_, TileEntity p_177426_2_)
void
setBlockEntityNbt(CompoundNBT p_201591_1_)
BlockState
setBlockState(BlockPos p_177436_1_, BlockState p_177436_2_, boolean p_177436_3_)
void
setFullStatus(java.util.function.Supplier<ChunkHolder.LocationType> p_217314_1_)
void
setHeightmap(Heightmap.Type p_201607_1_, long[] p_201607_2_)
void
setInhabitedTime(long p_177415_1_)
void
setLastSaveHadEntities(boolean p_177409_1_)
void
setLastSaveTime(long p_177432_1_)
void
setLightCorrect(boolean p_217305_1_)
void
setLoaded(boolean p_177417_1_)
void
setStartForFeature(Structure<?> p_230344_1_, StructureStart<?> p_230344_2_)
void
setUnsaved(boolean p_177427_1_)
void
unpackTicks()
CompoundNBT
writeCapsToNBT()
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:
getOrCreateHeightmapUnprimed
in interfaceIChunk
-
getBlockEntitiesPos
public java.util.Set<BlockPos> getBlockEntitiesPos()
- Specified by:
getBlockEntitiesPos
in interfaceIChunk
-
getSections
public ChunkSection[] getSections()
- Specified by:
getSections
in interfaceIChunk
-
getBlockState
public BlockState getBlockState(BlockPos p_180495_1_)
- Specified by:
getBlockState
in interfaceIBlockReader
-
getFluidState
public FluidState getFluidState(BlockPos p_204610_1_)
- Specified by:
getFluidState
in 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:
setBlockState
in interfaceIChunk
-
getLightEngine
@Nullable public WorldLightManager getLightEngine()
-
setHeightmap
public void setHeightmap(Heightmap.Type p_201607_1_, long[] p_201607_2_)
- Specified by:
setHeightmap
in 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:
getBlockEntity
in 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:
setBlockEntity
in interfaceIChunk
-
setBlockEntityNbt
public void setBlockEntityNbt(CompoundNBT p_201591_1_)
- Specified by:
setBlockEntityNbt
in interfaceIChunk
-
getBlockEntityNbtForSaving
@Nullable public CompoundNBT getBlockEntityNbtForSaving(BlockPos p_223134_1_)
- Specified by:
getBlockEntityNbtForSaving
in interfaceIChunk
-
removeBlockEntity
public void removeBlockEntity(BlockPos p_177425_1_)
- Specified by:
removeBlockEntity
in 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:
getHeightmaps
in interfaceIChunk
-
getBlockEntities
public java.util.Map<BlockPos,TileEntity> getBlockEntities()
-
getEntitySections
public ClassInheritanceMultiMap<Entity>[] getEntitySections()
-
getBlockEntityNbt
public CompoundNBT getBlockEntityNbt(BlockPos p_201579_1_)
- Specified by:
getBlockEntityNbt
in interfaceIChunk
-
getLights
public java.util.stream.Stream<BlockPos> getLights()
-
getBlockTicks
public ITickList<Block> getBlockTicks()
- Specified by:
getBlockTicks
in interfaceIChunk
-
getLiquidTicks
public ITickList<Fluid> getLiquidTicks()
- Specified by:
getLiquidTicks
in interfaceIChunk
-
setUnsaved
public void setUnsaved(boolean p_177427_1_)
- Specified by:
setUnsaved
in interfaceIChunk
-
setLastSaveHadEntities
public void setLastSaveHadEntities(boolean p_177409_1_)
-
setLastSaveTime
public void setLastSaveTime(long p_177432_1_)
- Specified by:
setLastSaveTime
in interfaceIChunk
-
getStartForFeature
@Nullable public StructureStart<?> getStartForFeature(Structure<?> p_230342_1_)
- Specified by:
getStartForFeature
in interfaceIStructureReader
-
setStartForFeature
public void setStartForFeature(Structure<?> p_230344_1_, StructureStart<?> p_230344_2_)
- Specified by:
setStartForFeature
in interfaceIStructureReader
-
getAllStarts
public java.util.Map<Structure<?>,StructureStart<?>> getAllStarts()
- Specified by:
getAllStarts
in interfaceIChunk
-
setAllStarts
public void setAllStarts(java.util.Map<Structure<?>,StructureStart<?>> p_201612_1_)
- Specified by:
setAllStarts
in interfaceIChunk
-
getReferencesForFeature
public it.unimi.dsi.fastutil.longs.LongSet getReferencesForFeature(Structure<?> p_230346_1_)
- Specified by:
getReferencesForFeature
in interfaceIStructureReader
-
addReferenceForFeature
public void addReferenceForFeature(Structure<?> p_230343_1_, long p_230343_2_)
- Specified by:
addReferenceForFeature
in interfaceIStructureReader
-
getAllReferences
public java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> getAllReferences()
- Specified by:
getAllReferences
in interfaceIStructureReader
-
setAllReferences
public void setAllReferences(java.util.Map<Structure<?>,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_)
- Specified by:
setAllReferences
in interfaceIStructureReader
-
getInhabitedTime
public long getInhabitedTime()
- Specified by:
getInhabitedTime
in interfaceIChunk
-
setInhabitedTime
public void setInhabitedTime(long p_177415_1_)
- Specified by:
setInhabitedTime
in interfaceIChunk
-
postProcessGeneration
public void postProcessGeneration()
-
promotePendingBlockEntity
@Nullable private TileEntity promotePendingBlockEntity(BlockPos p_212815_1_, CompoundNBT p_212815_2_)
-
getUpgradeData
public UpgradeData getUpgradeData()
- Specified by:
getUpgradeData
in interfaceIChunk
-
getPostProcessing
public it.unimi.dsi.fastutil.shorts.ShortList[] getPostProcessing()
- Specified by:
getPostProcessing
in 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:
isLightCorrect
in interfaceIChunk
-
setLightCorrect
public void setLightCorrect(boolean p_217305_1_)
- Specified by:
setLightCorrect
in 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:
getWorldForge
in interfaceIChunk
-
-