Class ChunkSource

java.lang.Object
net.minecraft.world.level.chunk.ChunkSource
All Implemented Interfaces:
AutoCloseable, LightChunkGetter
Direct Known Subclasses:
ClientChunkCache, ServerChunkCache

public abstract class ChunkSource extends Object implements AutoCloseable, LightChunkGetter
  • Constructor Details

    • ChunkSource

      public ChunkSource()
  • Method Details

    • getChunk

      public @Nullable LevelChunk getChunk(int x, int z, boolean loadOrGenerate)
    • getChunkNow

      public @Nullable LevelChunk getChunkNow(int x, int z)
    • getChunkForLighting

      public @Nullable LightChunk getChunkForLighting(int x, int z)
      Specified by:
      getChunkForLighting in interface LightChunkGetter
    • hasChunk

      public boolean hasChunk(int x, int z)
      Returns:
      true if 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

      public abstract void tick(BooleanSupplier haveTime, boolean tickChunks)
    • onSectionEmptinessChanged

      public void onSectionEmptinessChanged(int sectionX, int sectionY, int sectionZ, boolean empty)
    • gatherStats

      public abstract String gatherStats()
    • getLoadedChunksCount

      public abstract int getLoadedChunksCount()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • getLightEngine

      public abstract LevelLightEngine getLightEngine()
    • setSpawnSettings

      public void setSpawnSettings(boolean spawnEnemies)
    • updateChunkForced

      public boolean updateChunkForced(ChunkPos pos, boolean forced)
    • getForceLoadedChunks

      public it.unimi.dsi.fastutil.longs.LongSet getForceLoadedChunks()