001package net.minecraft.world.chunk; 002 003import java.util.List; 004import net.minecraft.entity.EnumCreatureType; 005import net.minecraft.util.IProgressUpdate; 006import net.minecraft.world.ChunkPosition; 007import net.minecraft.world.World; 008 009public interface IChunkProvider 010{ 011 /** 012 * Checks to see if a chunk exists at x, y 013 */ 014 boolean chunkExists(int i, int j); 015 016 /** 017 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the 018 * specified chunk from the map seed and chunk seed 019 */ 020 Chunk provideChunk(int i, int j); 021 022 /** 023 * loads or generates the chunk at the chunk location specified 024 */ 025 Chunk loadChunk(int i, int j); 026 027 /** 028 * Populates chunk with ores etc etc 029 */ 030 void populate(IChunkProvider ichunkprovider, int i, int j); 031 032 /** 033 * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. 034 * Return true if all chunks have been saved. 035 */ 036 boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate); 037 038 /** 039 * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. 040 */ 041 boolean unloadQueuedChunks(); 042 043 /** 044 * Returns if the IChunkProvider supports saving. 045 */ 046 boolean canSave(); 047 048 /** 049 * Converts the instance data to a readable string. 050 */ 051 String makeString(); 052 053 /** 054 * Returns a list of creatures of the specified type that can spawn at the given location. 055 */ 056 List getPossibleCreatures(EnumCreatureType enumcreaturetype, int i, int j, int k); 057 058 /** 059 * Returns the location of the closest structure of the specified type. If not found returns null. 060 */ 061 ChunkPosition findClosestStructure(World world, String s, int i, int j, int k); 062 063 int getLoadedChunkCount(); 064 065 void recreateStructures(int i, int j); 066}