| 1 | package net.minecraft.world.chunk;
|
| 2 |
|
| 3 | import java.util.List;
|
| 4 | import net.minecraft.entity.EnumCreatureType;
|
| 5 | import net.minecraft.util.BlockPos;
|
| 6 | import net.minecraft.util.IProgressUpdate;
|
| 7 | import net.minecraft.world.World;
|
| 8 | import net.minecraft.world.biome.BiomeGenBase;
|
| 9 |
|
| 10 | public interface IChunkProvider
|
| 11 | {
|
| 12 | /**
|
| 13 | * Checks to see if a chunk exists at x, z
|
| 14 | */
|
| 15 | boolean chunkExists(int x, int z);
|
| 16 |
|
| 17 | /**
|
| 18 | * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
|
| 19 | * specified chunk from the map seed and chunk seed
|
| 20 | */
|
| 21 | Chunk provideChunk(int x, int z);
|
| 22 |
|
| 23 | Chunk provideChunk(BlockPos blockPosIn);
|
| 24 |
|
| 25 | /**
|
| 26 | * Populates chunk with ores etc etc
|
| 27 | */
|
| 28 | void populate(IChunkProvider chunkProvider, int x, int z);
|
| 29 |
|
| 30 | boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z);
|
| 31 |
|
| 32 | /**
|
| 33 | * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks.
|
| 34 | * Return true if all chunks have been saved.
|
| 35 | */
|
| 36 | boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback);
|
| 37 |
|
| 38 | /**
|
| 39 | * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.
|
| 40 | */
|
| 41 | boolean unloadQueuedChunks();
|
| 42 |
|
| 43 | /**
|
| 44 | * Returns if the IChunkProvider supports saving.
|
| 45 | */
|
| 46 | boolean canSave();
|
| 47 |
|
| 48 | /**
|
| 49 | * Converts the instance data to a readable string.
|
| 50 | */
|
| 51 | String makeString();
|
| 52 |
|
| 53 | List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos);
|
| 54 |
|
| 55 | BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position);
|
| 56 |
|
| 57 | int getLoadedChunkCount();
|
| 58 |
|
| 59 | void recreateStructures(Chunk chunkIn, int x, int z);
|
| 60 |
|
| 61 | /**
|
| 62 | * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently
|
| 63 | * unimplemented.
|
| 64 | */
|
| 65 | void saveExtraData();
|
| 66 | }
|
| 67 |
|