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

    sionzee

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

    s0undx

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

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

    sionzee

    Code:java
    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

    RealDope

    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