Class ClientChunkCache

java.lang.Object
net.minecraft.world.level.chunk.ChunkSource
net.minecraft.client.multiplayer.ClientChunkCache
All Implemented Interfaces:
AutoCloseable, LightChunkGetter

public class ClientChunkCache extends ChunkSource
  • Field Details

  • Constructor Details

    • ClientChunkCache

      public ClientChunkCache(ClientLevel level, int serverChunkRadius)
  • Method Details

    • getLightEngine

      public LevelLightEngine getLightEngine()
      Specified by:
      getLightEngine in class ChunkSource
    • isValidChunk

      private static boolean isValidChunk(@Nullable LevelChunk chunk, int x, int z)
    • drop

      public void drop(ChunkPos pos)
    • getChunk

      public @Nullable LevelChunk getChunk(int x, int z, ChunkStatus targetStatus, boolean loadOrGenerate)
      Specified by:
      getChunk in class ChunkSource
    • getLevel

      public BlockGetter getLevel()
    • replaceBiomes

      public void replaceBiomes(int chunkX, int chunkZ, FriendlyByteBuf readBuffer)
    • replaceWithPacketData

      public @Nullable LevelChunk replaceWithPacketData(int chunkX, int chunkZ, FriendlyByteBuf readBuffer, Map<Heightmap.Types, long[]> heightmaps, Consumer<ClientboundLevelChunkPacketData.BlockEntityTagOutput> blockEntities)
    • tick

      public void tick(BooleanSupplier haveTime, boolean tickChunks)
      Specified by:
      tick in class ChunkSource
    • updateViewCenter

      public void updateViewCenter(int x, int z)
    • updateViewRadius

      public void updateViewRadius(int viewRange)
    • calculateStorageRange

      private static int calculateStorageRange(int viewRange)
    • gatherStats

      public String gatherStats()
      Specified by:
      gatherStats in class ChunkSource
    • getLoadedChunksCount

      public int getLoadedChunksCount()
      Specified by:
      getLoadedChunksCount in class ChunkSource
    • onLightUpdate

      public void onLightUpdate(LightLayer layer, SectionPos pos)
    • addedEmptySections

      public it.unimi.dsi.fastutil.longs.LongOpenHashSet addedEmptySections()
    • removedEmptySections

      public it.unimi.dsi.fastutil.longs.LongOpenHashSet removedEmptySections()
    • addedLoadedChunks

      public it.unimi.dsi.fastutil.longs.LongOpenHashSet addedLoadedChunks()
    • removedLoadedChunks

      public it.unimi.dsi.fastutil.longs.LongOpenHashSet removedLoadedChunks()
    • flipUpdateTrackingSets

      public void flipUpdateTrackingSets()
    • onSectionEmptinessChanged

      public void onSectionEmptinessChanged(int sectionX, int sectionY, int sectionZ, boolean empty)
      Overrides:
      onSectionEmptinessChanged in class ChunkSource