public class ChunkProviderServer extends java.lang.Object implements IChunkProvider
Modifier and Type | Field and Description |
---|---|
IChunkGenerator |
chunkGenerator |
IChunkLoader |
chunkLoader |
<any> |
id2ChunkMap
map of chunk Id's to Chunk instances
|
WorldServer |
world |
Constructor and Description |
---|
ChunkProviderServer(WorldServer worldObjIn,
IChunkLoader chunkLoaderIn,
IChunkGenerator chunkGeneratorIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSave()
Returns if the IChunkProvider supports saving.
|
boolean |
chunkExists(int x,
int z)
Checks to see if a chunk exists at x, z
|
void |
flushToDisk()
Flushes all pending chunks fully back to disk
|
Chunk |
getLoadedChunk(int x,
int z) |
int |
getLoadedChunkCount() |
java.util.Collection<Chunk> |
getLoadedChunks() |
BlockPos |
getNearestStructurePos(World worldIn,
java.lang.String structureName,
BlockPos position,
boolean findUnexplored) |
java.util.List<Biome.SpawnListEntry> |
getPossibleCreatures(EnumCreatureType creatureType,
BlockPos pos) |
boolean |
isChunkGeneratedAt(int x,
int z) |
boolean |
isInsideStructure(World worldIn,
java.lang.String structureName,
BlockPos pos) |
Chunk |
loadChunk(int x,
int z) |
Chunk |
loadChunk(int x,
int z,
java.lang.Runnable runnable) |
java.lang.String |
makeString()
Converts the instance data to a readable string.
|
Chunk |
provideChunk(int x,
int z) |
void |
queueUnload(Chunk chunkIn)
Marks the chunk for unload if the
WorldProvider allows it. |
void |
queueUnloadAll()
Marks all chunks for unload
|
boolean |
saveChunks(boolean all) |
boolean |
tick()
Unloads chunks that are marked to be unloaded.
|
public final IChunkGenerator chunkGenerator
public final IChunkLoader chunkLoader
public final <any> id2ChunkMap
public final WorldServer world
public ChunkProviderServer(WorldServer worldObjIn, IChunkLoader chunkLoaderIn, IChunkGenerator chunkGeneratorIn)
public java.util.Collection<Chunk> getLoadedChunks()
public void queueUnload(Chunk chunkIn)
WorldProvider
allows it.
Queueing a chunk for unload does not guarantee that it will be unloaded, as any request for the chunk will
unqueue the chunk.public void queueUnloadAll()
queueUnload(Chunk)
public Chunk getLoadedChunk(int x, int z)
getLoadedChunk
in interface IChunkProvider
public Chunk loadChunk(int x, int z)
public Chunk loadChunk(int x, int z, java.lang.Runnable runnable)
public Chunk provideChunk(int x, int z)
provideChunk
in interface IChunkProvider
public boolean saveChunks(boolean all)
public void flushToDisk()
public boolean tick()
tick
in interface IChunkProvider
public boolean canSave()
public java.lang.String makeString()
makeString
in interface IChunkProvider
public java.util.List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
public BlockPos getNearestStructurePos(World worldIn, java.lang.String structureName, BlockPos position, boolean findUnexplored)
public boolean isInsideStructure(World worldIn, java.lang.String structureName, BlockPos pos)
public int getLoadedChunkCount()
public boolean chunkExists(int x, int z)
public boolean isChunkGeneratedAt(int x, int z)
isChunkGeneratedAt
in interface IChunkProvider