All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.instance.generator.Generator Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.instance.generator;

import org.jetbrains.annotations.NotNull;

import java.util.Collection;

@FunctionalInterface
public interface Generator {
    /**
     * This method is called when this generator is requesting this unit to be filled with blocks or biomes.
     *
     * @param unit the unit to fill
     */
    void generate(@NotNull GenerationUnit unit);

    /**
     * Runs {@link #generate(GenerationUnit)} on each unit in the collection.
     *
     * @param units the list of units to fill
     */
    default void generateAll(@NotNull Collection<@NotNull GenerationUnit> units) {
        units.forEach(this::generate);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy