Preload Chunks and Disable new chunks.

Discussion in 'Plugin Development' started by sionzee, Feb 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    I want preload all chunks,
    With X,Y,Z. And stop generating new chunks.
    It is possible ?
  2. Offline


    This is a null chunk generator, maybe its what you are looking for.

    public class NullChunkGenerator extends ChunkGenerator{
        public byte[] generate(World world, Random random, int cx, int cz){
            return new byte[16*16*world.getMaxHeight()];
        public Location getFixedSpawnLocation(World world, Random random){
            return new Location(world, 0, 64, 0);
  3. Offline


    1. @EventHandler
    2. public void onChunkLoad(ChunkLoadEvent event)
    3. {
    4. if(event.isNewChunk())
    5. {
    6. Chunk chunk = event.getChunk();
    7. chunk.unload(false,false);
    8. }
    9. }

    Is too possible no ?
  4. Offline


    Not sure if ChunkLoadEvent is cancellable, but if it is you should certainly do that instead.
Thread Status:
Not open for further replies.

Share This Page