Class ChunkGenerator

    • Constructor Detail

      • ChunkGenerator

        public ChunkGenerator()
    • Method Detail

      • generateChunkData

        @NotNull
        public ChunkGenerator.ChunkData generateChunkData​(@NotNull
                                                          World world,
                                                          @NotNull
                                                          Random random,
                                                          int x,
                                                          int z,
                                                          @NotNull
                                                          ChunkGenerator.BiomeGrid biome)
        Shapes the chunk for the given coordinates. This method must return a ChunkData.

        Notes:

        This method should never attempt to get the Chunk at the passed coordinates, as doing so may cause an infinite loop

        This method should never modify a ChunkData after it has been returned.

        This method must return a ChunkData returned by createChunkData(org.bukkit.World)

        Parameters:
        world - The world this chunk will be used for
        random - The random generator to use
        x - The X-coordinate of the chunk
        z - The Z-coordinate of the chunk
        biome - Proposed biome values for chunk - can be updated by generator
        Returns:
        ChunkData containing the types for each block created by this generator
      • createChunkData

        @NotNull
        protected final ChunkGenerator.ChunkData createChunkData​(@NotNull
                                                                 World world)
        Create a ChunkData for a world.
        Parameters:
        world - the world the ChunkData is for
        Returns:
        a new ChunkData for world
      • canSpawn

        public boolean canSpawn​(@NotNull
                                World world,
                                int x,
                                int z)
        Tests if the specified location is valid for a natural spawn position
        Parameters:
        world - The world we're testing on
        x - X-coordinate of the block to test
        z - Z-coordinate of the block to test
        Returns:
        true if the location is valid, otherwise false
      • getDefaultPopulators

        @NotNull
        public List<BlockPopulator> getDefaultPopulators​(@NotNull
                                                         World world)
        Gets a list of default BlockPopulators to apply to a given world
        Parameters:
        world - World to apply to
        Returns:
        List containing any amount of BlockPopulators
      • getFixedSpawnLocation

        @Nullable
        public Location getFixedSpawnLocation​(@NotNull
                                              World world,
                                              @NotNull
                                              Random random)
        Gets a fixed spawn location to use for a given world.

        A null value is returned if a world should not use a fixed spawn point, and will instead attempt to find one randomly.

        Parameters:
        world - The world to locate a spawn point for
        random - Random generator to use in the calculation
        Returns:
        Location containing a new spawn point, otherwise null
      • isParallelCapable

        public boolean isParallelCapable()
        Gets if this ChunkGenerator is parallel capable. See ChunkGenerator for more information.
        Returns:
        parallel capable status