Package net.minecraft.world.chunk
Class WorldChunk
java.lang.Object
net.minecraft.world.chunk.WorldChunk
- All Implemented Interfaces:
BlockView,Chunk,StructureHolder
- Direct Known Subclasses:
EmptyChunk
public class WorldChunk extends Object implements Chunk
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWorldChunk.CreationType -
Field Summary
Fields Modifier and Type Field Description private BiomeArraybiomeArrayprivate Map<BlockPos,BlockEntity>blockEntitiesprivate TickScheduler<Block>blockTickSchedulerstatic ChunkSectionEMPTY_SECTIONprivate TypeFilterableList<Entity>[]entitySectionsprivate TickScheduler<Fluid>fluidTickSchedulerprivate Map<Heightmap.Type,Heightmap>heightmapsprivate longinhabitedTimeprivate longlastSaveTimeprivate Supplier<ChunkHolder.LevelType>levelTypeProviderprivate booleanlightOnprivate booleanloadedToWorldprivate Consumer<WorldChunk>loadToWorldConsumerprivate static LoggerLOGGERprivate Map<BlockPos,CompoundTag>pendingBlockEntityTagsprivate ChunkPosposprivate ShortList[]postProcessingListsprivate ChunkSection[]sectionsprivate booleanshouldSaveprivate Map<StructureFeature<?>,LongSet>structureReferencesprivate Map<StructureFeature<?>,StructureStart<?>>structureStartsprivate booleanunsavedprivate UpgradeDataupgradeDataprivate Worldworld -
Constructor Summary
Constructors Constructor Description WorldChunk(World world, ChunkPos pos, BiomeArray biomes)WorldChunk(World world, ChunkPos pos, BiomeArray biomes, UpgradeData upgradeData, TickScheduler<Block> blockTickScheduler, TickScheduler<Fluid> fluidTickScheduler, long inhabitedTime, ChunkSection[] sections, Consumer<WorldChunk> loadToWorldConsumer)WorldChunk(World world, ProtoChunk protoChunk) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.BlockView
getDismountHeight, getDismountHeight, getHeight, getLuminance, getMaxLightLevel, method_29546, raycast, raycastBlockMethods inherited from interface net.minecraft.world.chunk.Chunk
areSectionsEmptyBetween, getHighestNonEmptySection, getHighestNonEmptySectionYOffset, markBlockForPostProcessing, markBlockForPostProcessing
-
Field Details
-
LOGGER
-
EMPTY_SECTION
-
sections
-
biomeArray
-
pendingBlockEntityTags
-
loadedToWorld
private boolean loadedToWorld -
world
-
heightmaps
-
upgradeData
-
blockEntities
-
entitySections
-
structureStarts
-
structureReferences
-
postProcessingLists
-
blockTickScheduler
-
fluidTickScheduler
-
unsaved
private boolean unsaved -
lastSaveTime
private long lastSaveTime -
shouldSave
private volatile boolean shouldSave -
inhabitedTime
private long inhabitedTime -
levelTypeProvider
-
loadToWorldConsumer
-
pos
-
lightOn
private volatile boolean lightOn
-
-
Constructor Details
-
WorldChunk
-
WorldChunk
public WorldChunk(World world, ChunkPos pos, BiomeArray biomes, UpgradeData upgradeData, TickScheduler<Block> blockTickScheduler, TickScheduler<Fluid> fluidTickScheduler, long inhabitedTime, @Nullable ChunkSection[] sections, @Nullable Consumer<WorldChunk> loadToWorldConsumer) -
WorldChunk
-
-
Method Details
-
getHeightmap
- Specified by:
getHeightmapin interfaceChunk
-
getBlockEntityPositions
- Specified by:
getBlockEntityPositionsin interfaceChunk
-
getSectionArray
- Specified by:
getSectionArrayin interfaceChunk
-
getBlockState
- Specified by:
getBlockStatein interfaceBlockView
-
getFluidState
- Specified by:
getFluidStatein interfaceBlockView
-
getFluidState
-
setBlockState
- Specified by:
setBlockStatein interfaceChunk
-
getLightingProvider
-
addEntity
-
setHeightmap
- Specified by:
setHeightmapin interfaceChunk
-
remove
-
remove
-
sampleHeightmap
- Specified by:
sampleHeightmapin interfaceChunk
-
createBlockEntity
-
getBlockEntity
- Specified by:
getBlockEntityin interfaceBlockView
-
getBlockEntity
-
addBlockEntity
-
setBlockEntity
- Specified by:
setBlockEntityin interfaceChunk
-
addPendingBlockEntityTag
- Specified by:
addPendingBlockEntityTagin interfaceChunk
-
getPackedBlockEntityTag
- Specified by:
getPackedBlockEntityTagin interfaceChunk
-
removeBlockEntity
- Specified by:
removeBlockEntityin interfaceChunk
-
loadToWorld
public void loadToWorld() -
markDirty
public void markDirty() -
collectOtherEntities
-
collectEntities
public <T extends Entity> void collectEntities(@Nullable EntityType<?> type, Box box, List<? super T> result, Predicate<? super T> predicate)Collects a list of entities and appends them to the given list according to the specified criteria. Warning: Ifnullis passed as the entity type filter, care should be taken that the type argumentTis set toEntity, otherwise heap pollution in the output list orClassCastExceptioncan occur.- Parameters:
type- the entity type of the entities to collect, ornullto collect entities of all types.box- the box within which collected entities must beresult- a list in which to store the collected entitiespredicate- a predicate which entities must satisfy in order to be collected
-
collectEntitiesByClass
public <T extends Entity> void collectEntitiesByClass(Class<? extends T> entityClass, Box box, List<T> result, @Nullable Predicate<? super T> predicate)Collects a list of entities of some runtime type and appends them to the given list. The runtime class of each collected entity will be the same as or a subclass of the given class.- Parameters:
entityClass- the class object representing the type collected entities must extendbox- the box in which to collect entitiesresult- a list in which to store the collected entitiespredicate- a predicate which entities must satisfy in order to be collected
-
isEmpty
public boolean isEmpty() -
getPos
-
loadFromPacket
@Environment(CLIENT) public void loadFromPacket(@Nullable BiomeArray biomes, PacketByteBuf buf, CompoundTag tag, int verticalStripBitmask) -
getBiomeArray
- Specified by:
getBiomeArrayin interfaceChunk
-
setLoadedToWorld
public void setLoadedToWorld(boolean loaded) -
getWorld
-
getHeightmaps
- Specified by:
getHeightmapsin interfaceChunk
-
getBlockEntities
-
getEntitySectionArray
-
getBlockEntityTag
- Specified by:
getBlockEntityTagin interfaceChunk
-
getLightSourcesStream
- Specified by:
getLightSourcesStreamin interfaceChunk
-
getBlockTickScheduler
- Specified by:
getBlockTickSchedulerin interfaceChunk
-
getFluidTickScheduler
- Specified by:
getFluidTickSchedulerin interfaceChunk
-
setShouldSave
public void setShouldSave(boolean shouldSave)- Specified by:
setShouldSavein interfaceChunk
-
needsSaving
public boolean needsSaving()- Specified by:
needsSavingin interfaceChunk
-
setUnsaved
public void setUnsaved(boolean unsaved) -
setLastSaveTime
public void setLastSaveTime(long lastSaveTime)- Specified by:
setLastSaveTimein interfaceChunk
-
getStructureStart
- Specified by:
getStructureStartin interfaceStructureHolder
-
setStructureStart
- Specified by:
setStructureStartin interfaceStructureHolder
-
getStructureStarts
- Specified by:
getStructureStartsin interfaceChunk
-
setStructureStarts
- Specified by:
setStructureStartsin interfaceChunk
-
getStructureReferences
- Specified by:
getStructureReferencesin interfaceStructureHolder
-
addStructureReference
- Specified by:
addStructureReferencein interfaceStructureHolder
-
getStructureReferences
- Specified by:
getStructureReferencesin interfaceStructureHolder
-
setStructureReferences
- Specified by:
setStructureReferencesin interfaceStructureHolder
-
getInhabitedTime
public long getInhabitedTime()- Specified by:
getInhabitedTimein interfaceChunk
-
setInhabitedTime
public void setInhabitedTime(long inhabitedTime)- Specified by:
setInhabitedTimein interfaceChunk
-
runPostProcessing
public void runPostProcessing() -
loadBlockEntity
-
getUpgradeData
- Specified by:
getUpgradeDatain interfaceChunk
-
getPostProcessingLists
- Specified by:
getPostProcessingListsin interfaceChunk
-
disableTickSchedulers
public void disableTickSchedulers() -
enableTickSchedulers
-
getStatus
-
getLevelType
-
setLevelTypeProvider
-
isLightOn
public boolean isLightOn() -
setLightOn
public void setLightOn(boolean lightOn)- Specified by:
setLightOnin interfaceChunk
-