public class Chunk extends CapabilityProvider<Chunk> implements IChunk, IForgeChunk
Modifier and Type | Class and Description |
---|---|
static class |
Chunk.CreateEntityType |
Modifier and Type | Field and Description |
---|---|
private BiomeContainer |
blockBiomeArray |
private ITickList<Block> |
blocksToBeTicked |
private java.util.Map<BlockPos,CompoundNBT> |
deferredTileEntities |
private boolean |
dirty |
static ChunkSection |
EMPTY_SECTION |
private ClassInheritanceMultiMap<Entity>[] |
entityLists |
private ITickList<Fluid> |
fluidsToBeTicked |
private boolean |
hasEntities |
private java.util.Map<Heightmap.Type,Heightmap> |
heightMap |
private long |
inhabitedTime |
private long |
lastSaveTime |
private boolean |
lightCorrect |
private boolean |
loaded |
private java.util.function.Supplier<ChunkHolder.LocationType> |
locationType |
private static org.apache.logging.log4j.Logger |
LOGGER |
private it.unimi.dsi.fastutil.shorts.ShortList[] |
packedBlockPositions |
private ChunkPos |
pos |
private java.util.function.Consumer<Chunk> |
postLoadConsumer |
private ChunkSection[] |
sections |
private java.util.Map<java.lang.String,it.unimi.dsi.fastutil.longs.LongSet> |
structureReferences |
private java.util.Map<java.lang.String,StructureStart> |
structureStarts |
private java.util.Map<BlockPos,TileEntity> |
tileEntities |
private UpgradeData |
upgradeData |
private World |
world |
Constructor and Description |
---|
Chunk(World worldIn,
ChunkPos chunkPosIn,
BiomeContainer biomeContainerIn) |
Chunk(World worldIn,
ChunkPos chunkPosIn,
BiomeContainer biomeContainerIn,
UpgradeData upgradeDataIn,
ITickList<Block> tickBlocksIn,
ITickList<Fluid> tickFluidsIn,
long inhabitedTimeIn,
ChunkSection[] sectionsIn,
java.util.function.Consumer<Chunk> postLoadConsumerIn) |
Chunk(World worldIn,
ChunkPrimer p_i49947_2_) |
Modifier and Type | Method and Description |
---|---|
void |
addEntity(Entity entityIn) |
void |
addStructureReference(java.lang.String strucutre,
long reference) |
void |
addTileEntity(BlockPos pos,
TileEntity tileEntityIn) |
void |
addTileEntity(CompoundNBT nbt) |
void |
addTileEntity(TileEntity tileEntityIn) |
private TileEntity |
createNewTileEntity(BlockPos pos) |
BiomeContainer |
getBiomes() |
BlockState |
getBlockState(BlockPos pos) |
ITickList<Block> |
getBlocksToBeTicked() |
CompoundNBT |
getDeferredTileEntity(BlockPos pos) |
<T extends Entity> |
getEntitiesOfTypeWithinAABB(java.lang.Class<? extends T> entityClass,
AxisAlignedBB aabb,
java.util.List<T> listToFill,
java.util.function.Predicate<? super T> filter) |
void |
getEntitiesWithinAABBForEntity(Entity entityIn,
AxisAlignedBB aabb,
java.util.List<Entity> listToFill,
java.util.function.Predicate<? super Entity> filter) |
<T extends Entity> |
getEntitiesWithinAABBForList(EntityType<?> entitytypeIn,
AxisAlignedBB aabb,
java.util.List<? super T> list,
java.util.function.Predicate<? super T> filter) |
ClassInheritanceMultiMap<Entity>[] |
getEntityLists() |
IFluidState |
getFluidState(BlockPos pos) |
IFluidState |
getFluidState(int bx,
int by,
int bz) |
ITickList<Fluid> |
getFluidsToBeTicked() |
Heightmap |
getHeightmap(Heightmap.Type typeIn) |
java.util.Collection<java.util.Map.Entry<Heightmap.Type,Heightmap>> |
getHeightmaps() |
long |
getInhabitedTime() |
java.util.stream.Stream<BlockPos> |
getLightSources() |
ChunkHolder.LocationType |
getLocationType() |
it.unimi.dsi.fastutil.shorts.ShortList[] |
getPackedPositions() |
ChunkPos |
getPos() |
ChunkSection[] |
getSections() |
ChunkStatus |
getStatus() |
java.util.Map<java.lang.String,it.unimi.dsi.fastutil.longs.LongSet> |
getStructureReferences() |
it.unimi.dsi.fastutil.longs.LongSet |
getStructureReferences(java.lang.String structureIn) |
StructureStart |
getStructureStart(java.lang.String stucture) |
java.util.Map<java.lang.String,StructureStart> |
getStructureStarts() |
java.util.Set<BlockPos> |
getTileEntitiesPos() |
TileEntity |
getTileEntity(BlockPos pos) |
TileEntity |
getTileEntity(BlockPos pos,
Chunk.CreateEntityType creationMode) |
java.util.Map<BlockPos,TileEntity> |
getTileEntityMap() |
CompoundNBT |
getTileEntityNBT(BlockPos pos) |
int |
getTopBlockY(Heightmap.Type heightmapType,
int x,
int z) |
UpgradeData |
getUpgradeData() |
World |
getWorld() |
World |
getWorldForge() |
WorldLightManager |
getWorldLightManager() |
boolean |
hasLight() |
boolean |
isEmpty() |
boolean |
isModified() |
void |
markDirty() |
void |
postLoad() |
void |
postProcess() |
void |
putStructureStart(java.lang.String structureIn,
StructureStart structureStartIn) |
void |
read(BiomeContainer biomeContainerIn,
PacketBuffer packetBufferIn,
CompoundNBT nbtIn,
int availableSections) |
void |
readCapsFromNBT(CompoundNBT tag)
Deprecated.
|
void |
removeEntity(Entity entityIn) |
void |
removeEntityAtIndex(Entity entityIn,
int index) |
void |
removeTileEntity(BlockPos pos) |
void |
rescheduleTicks() |
void |
saveScheduledTicks(ServerWorld serverWorldIn) |
BlockState |
setBlockState(BlockPos pos,
BlockState state,
boolean isMoving) |
private TileEntity |
setDeferredTileEntity(BlockPos pos,
CompoundNBT compound) |
void |
setHasEntities(boolean hasEntitiesIn) |
void |
setHeightmap(Heightmap.Type type,
long[] data) |
void |
setInhabitedTime(long newInhabitedTime) |
void |
setLastSaveTime(long saveTime) |
void |
setLight(boolean lightCorrectIn) |
void |
setLoaded(boolean loaded) |
void |
setLocationType(java.util.function.Supplier<ChunkHolder.LocationType> locationTypeIn) |
void |
setModified(boolean modified) |
void |
setStructureReferences(java.util.Map<java.lang.String,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_) |
void |
setStructureStarts(java.util.Map<java.lang.String,StructureStart> structureStartsIn) |
CompoundNBT |
writeCapsToNBT()
Deprecated.
|
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
func_201636_b, getCarvingMask, getLastExtendedBlockStorage, getList, getTopFilledSegment, isEmptyBetween, markBlockForPostprocessing
func_217300_a, getHeight, getLightValue, getMaxLightLevel, rayTraceBlocks, rayTraceBlocks
getCapability, getCapability
private static final org.apache.logging.log4j.Logger LOGGER
public static final ChunkSection EMPTY_SECTION
private final ChunkSection[] sections
private BiomeContainer blockBiomeArray
private final java.util.Map<BlockPos,CompoundNBT> deferredTileEntities
private boolean loaded
private final World world
private final java.util.Map<Heightmap.Type,Heightmap> heightMap
private final UpgradeData upgradeData
private final java.util.Map<BlockPos,TileEntity> tileEntities
private final ClassInheritanceMultiMap<Entity>[] entityLists
private final java.util.Map<java.lang.String,StructureStart> structureStarts
private final java.util.Map<java.lang.String,it.unimi.dsi.fastutil.longs.LongSet> structureReferences
private final it.unimi.dsi.fastutil.shorts.ShortList[] packedBlockPositions
private boolean hasEntities
private long lastSaveTime
private volatile boolean dirty
private long inhabitedTime
@Nullable private java.util.function.Supplier<ChunkHolder.LocationType> locationType
@Nullable private java.util.function.Consumer<Chunk> postLoadConsumer
private final ChunkPos pos
private volatile boolean lightCorrect
public Chunk(World worldIn, ChunkPos chunkPosIn, BiomeContainer biomeContainerIn)
public Chunk(World worldIn, ChunkPos chunkPosIn, BiomeContainer biomeContainerIn, UpgradeData upgradeDataIn, ITickList<Block> tickBlocksIn, ITickList<Fluid> tickFluidsIn, long inhabitedTimeIn, @Nullable ChunkSection[] sectionsIn, @Nullable java.util.function.Consumer<Chunk> postLoadConsumerIn)
public Chunk(World worldIn, ChunkPrimer p_i49947_2_)
public Heightmap getHeightmap(Heightmap.Type typeIn)
getHeightmap
in interface IChunk
public java.util.Set<BlockPos> getTileEntitiesPos()
getTileEntitiesPos
in interface IChunk
public ChunkSection[] getSections()
getSections
in interface IChunk
public BlockState getBlockState(BlockPos pos)
getBlockState
in interface IBlockReader
public IFluidState getFluidState(BlockPos pos)
getFluidState
in interface IBlockReader
public IFluidState getFluidState(int bx, int by, int bz)
@Nullable public BlockState setBlockState(BlockPos pos, BlockState state, boolean isMoving)
setBlockState
in interface IChunk
@Nullable public WorldLightManager getWorldLightManager()
public void setHeightmap(Heightmap.Type type, long[] data)
setHeightmap
in interface IChunk
public void removeEntity(Entity entityIn)
public void removeEntityAtIndex(Entity entityIn, int index)
public int getTopBlockY(Heightmap.Type heightmapType, int x, int z)
getTopBlockY
in interface IChunk
@Nullable private TileEntity createNewTileEntity(BlockPos pos)
@Nullable public TileEntity getTileEntity(BlockPos pos)
getTileEntity
in interface IBlockReader
@Nullable public TileEntity getTileEntity(BlockPos pos, Chunk.CreateEntityType creationMode)
public void addTileEntity(TileEntity tileEntityIn)
public void addTileEntity(BlockPos pos, TileEntity tileEntityIn)
addTileEntity
in interface IChunk
public void addTileEntity(CompoundNBT nbt)
addTileEntity
in interface IChunk
@Nullable public CompoundNBT getTileEntityNBT(BlockPos pos)
getTileEntityNBT
in interface IChunk
public void removeTileEntity(BlockPos pos)
removeTileEntity
in interface IChunk
public void postLoad()
public void markDirty()
public void getEntitiesWithinAABBForEntity(@Nullable Entity entityIn, AxisAlignedBB aabb, java.util.List<Entity> listToFill, @Nullable java.util.function.Predicate<? super Entity> filter)
public <T extends Entity> void getEntitiesWithinAABBForList(@Nullable EntityType<?> entitytypeIn, AxisAlignedBB aabb, java.util.List<? super T> list, java.util.function.Predicate<? super T> filter)
public <T extends Entity> void getEntitiesOfTypeWithinAABB(java.lang.Class<? extends T> entityClass, AxisAlignedBB aabb, java.util.List<T> listToFill, @Nullable java.util.function.Predicate<? super T> filter)
public boolean isEmpty()
public void read(@Nullable BiomeContainer biomeContainerIn, PacketBuffer packetBufferIn, CompoundNBT nbtIn, int availableSections)
public BiomeContainer getBiomes()
public void setLoaded(boolean loaded)
public World getWorld()
public java.util.Collection<java.util.Map.Entry<Heightmap.Type,Heightmap>> getHeightmaps()
getHeightmaps
in interface IChunk
public java.util.Map<BlockPos,TileEntity> getTileEntityMap()
public ClassInheritanceMultiMap<Entity>[] getEntityLists()
public CompoundNBT getDeferredTileEntity(BlockPos pos)
getDeferredTileEntity
in interface IChunk
public java.util.stream.Stream<BlockPos> getLightSources()
getLightSources
in interface IChunk
public ITickList<Block> getBlocksToBeTicked()
getBlocksToBeTicked
in interface IChunk
public ITickList<Fluid> getFluidsToBeTicked()
getFluidsToBeTicked
in interface IChunk
public void setModified(boolean modified)
setModified
in interface IChunk
public boolean isModified()
isModified
in interface IChunk
public void setHasEntities(boolean hasEntitiesIn)
public void setLastSaveTime(long saveTime)
setLastSaveTime
in interface IChunk
@Nullable public StructureStart getStructureStart(java.lang.String stucture)
getStructureStart
in interface IStructureReader
public void putStructureStart(java.lang.String structureIn, StructureStart structureStartIn)
putStructureStart
in interface IStructureReader
public java.util.Map<java.lang.String,StructureStart> getStructureStarts()
getStructureStarts
in interface IChunk
public void setStructureStarts(java.util.Map<java.lang.String,StructureStart> structureStartsIn)
setStructureStarts
in interface IChunk
public it.unimi.dsi.fastutil.longs.LongSet getStructureReferences(java.lang.String structureIn)
getStructureReferences
in interface IStructureReader
public void addStructureReference(java.lang.String strucutre, long reference)
addStructureReference
in interface IStructureReader
public java.util.Map<java.lang.String,it.unimi.dsi.fastutil.longs.LongSet> getStructureReferences()
getStructureReferences
in interface IStructureReader
public void setStructureReferences(java.util.Map<java.lang.String,it.unimi.dsi.fastutil.longs.LongSet> p_201606_1_)
setStructureReferences
in interface IStructureReader
public long getInhabitedTime()
getInhabitedTime
in interface IChunk
public void setInhabitedTime(long newInhabitedTime)
setInhabitedTime
in interface IChunk
public void postProcess()
@Nullable private TileEntity setDeferredTileEntity(BlockPos pos, CompoundNBT compound)
public UpgradeData getUpgradeData()
getUpgradeData
in interface IChunk
public it.unimi.dsi.fastutil.shorts.ShortList[] getPackedPositions()
getPackedPositions
in interface IChunk
public void rescheduleTicks()
public void saveScheduledTicks(ServerWorld serverWorldIn)
public ChunkStatus getStatus()
public ChunkHolder.LocationType getLocationType()
public void setLocationType(java.util.function.Supplier<ChunkHolder.LocationType> locationTypeIn)
@Deprecated @Nullable public final CompoundNBT writeCapsToNBT()
Only public for use in AnvilChunkLoader
.
@Deprecated public final void readCapsFromNBT(CompoundNBT tag)
Only public for use in AnvilChunkLoader
.
public World getWorldForge()
getWorldForge
in interface IChunk