Class ChunkSource
java.lang.Object
net.minecraft.world.level.chunk.ChunkSource
- All Implemented Interfaces:
AutoCloseable, LightChunkGetter
- Direct Known Subclasses:
ClientChunkCache, ServerChunkCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()abstract String@Nullable LevelChunkgetChunk(int x, int z, boolean loadOrGenerate) abstract @Nullable ChunkAccessgetChunk(int x, int z, ChunkStatus targetStatus, boolean loadOrGenerate) @Nullable LightChunkgetChunkForLighting(int x, int z) @Nullable LevelChunkgetChunkNow(int x, int z) it.unimi.dsi.fastutil.longs.LongSetabstract LevelLightEngineabstract intbooleanhasChunk(int x, int z) voidonSectionEmptinessChanged(int sectionX, int sectionY, int sectionZ, boolean empty) voidsetSpawnSettings(boolean spawnEnemies) abstract voidtick(BooleanSupplier haveTime, boolean tickChunks) booleanupdateChunkForced(ChunkPos pos, boolean forced) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LightChunkGetter
getLevel, onLightUpdate
-
Constructor Details
-
ChunkSource
public ChunkSource()
-
-
Method Details
-
getChunk
-
getChunkNow
-
getChunkForLighting
- Specified by:
getChunkForLightingin interfaceLightChunkGetter
-
hasChunk
public boolean hasChunk(int x, int z) - Returns:
trueif a chunk is loaded at the provided position, without forcing a chunk load.
-
getChunk
public abstract @Nullable ChunkAccess getChunk(int x, int z, ChunkStatus targetStatus, boolean loadOrGenerate) -
tick
-
onSectionEmptinessChanged
public void onSectionEmptinessChanged(int sectionX, int sectionY, int sectionZ, boolean empty) -
gatherStats
-
getLoadedChunksCount
public abstract int getLoadedChunksCount() -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
getLightEngine
-
setSpawnSettings
public void setSpawnSettings(boolean spawnEnemies) -
updateChunkForced
-
getForceLoadedChunks
public it.unimi.dsi.fastutil.longs.LongSet getForceLoadedChunks()
-