Class AbstractFlatGenerator
java.lang.Object
org.bukkit.generator.ChunkGenerator
ua.mcchickenstudio.opencreative.utils.world.generators.WorldGenerator
ua.mcchickenstudio.opencreative.utils.world.generators.AbstractFlatGenerator
- All Implemented Interfaces:
ExtensionContent
- Direct Known Subclasses:
CustomFlatGenerator
AbstractFlatGenerator
This class represents a flat world generator, that will generate layers of blocks. To add layers, just put them inblocks map, that contains
Y coordinates and materials of blocks.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.generator.ChunkGenerator
org.bukkit.generator.ChunkGenerator.BiomeGrid, org.bukkit.generator.ChunkGenerator.ChunkData -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.bukkit.block.Biomeprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFlatGenerator(@NotNull String id, @NotNull org.bukkit.inventory.ItemStack displayIcon) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterCreation(@NotNull org.bukkit.World world) Executes world operations, when it's created or loaded.booleancanSpawn(@NotNull org.bukkit.World world, int x, int z) voidgenerateSurface(@NotNull org.bukkit.generator.WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull org.bukkit.generator.ChunkGenerator.ChunkData chunkData) @Nullable org.bukkit.generator.BiomeProvidergetDefaultBiomeProvider(@NotNull org.bukkit.generator.WorldInfo worldInfo) @NotNull List<org.bukkit.generator.BlockPopulator> getDefaultPopulators(@NotNull org.bukkit.World world) @Nullable org.bukkit.LocationgetFixedSpawnLocation(@NotNull org.bukkit.World world, @NotNull Random random) voidmodifyWorldCreator(@NotNull org.bukkit.WorldCreator creator, @NotNull String biome) Changes world creator before creating or loading world.Methods inherited from class WorldGenerator
getDisplayIcon, getID, getLocaleName, getNameModifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackReturns an icon that will be used in world generation menu.final @NotNull StringgetID()Returns id of world generator, that will be used to find it in registry.@NotNull StringReturns localized name for displaying.@NotNull StringgetName()Returns name of world generator for displaying in registry by converting id.Methods inherited from class org.bukkit.generator.ChunkGenerator
createChunkData, generateBedrock, generateCaves, generateChunkData, generateNoise, getBaseHeight, isParallelCapable, shouldGenerateBedrock, shouldGenerateCaves, shouldGenerateCaves, shouldGenerateDecorations, shouldGenerateDecorations, shouldGenerateMobs, shouldGenerateMobs, shouldGenerateNoise, shouldGenerateNoise, shouldGenerateStructures, shouldGenerateStructures, shouldGenerateSurface, shouldGenerateSurfaceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ExtensionContent
getDescription, getExtensionId
-
Field Details
-
blocks
-
biome
protected org.bukkit.block.Biome biome -
generateTrees
protected boolean generateTrees
-
-
Constructor Details
-
AbstractFlatGenerator
public AbstractFlatGenerator(@NotNull @NotNull String id, @NotNull @NotNull org.bukkit.inventory.ItemStack displayIcon)
-
-
Method Details
-
modifyWorldCreator
public void modifyWorldCreator(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull String biome) Description copied from class:WorldGeneratorChanges world creator before creating or loading world. Useful to set generator as itself, if it overridesgenerateSurfacemethod.- Specified by:
modifyWorldCreatorin classWorldGenerator- Parameters:
creator- creator to change.biome- selected biome.
-
getFixedSpawnLocation
@Nullable public @Nullable org.bukkit.Location getFixedSpawnLocation(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull Random random) - Overrides:
getFixedSpawnLocationin classorg.bukkit.generator.ChunkGenerator
-
canSpawn
public boolean canSpawn(@NotNull @NotNull org.bukkit.World world, int x, int z) - Overrides:
canSpawnin classorg.bukkit.generator.ChunkGenerator
-
afterCreation
public void afterCreation(@NotNull @NotNull org.bukkit.World world) Description copied from class:WorldGeneratorExecutes world operations, when it's created or loaded.- Specified by:
afterCreationin classWorldGenerator- Parameters:
world- world to execute code in it.
-
generateSurface
public void generateSurface(@NotNull @NotNull org.bukkit.generator.WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ, @NotNull @NotNull org.bukkit.generator.ChunkGenerator.ChunkData chunkData) - Overrides:
generateSurfacein classorg.bukkit.generator.ChunkGenerator
-
getDefaultBiomeProvider
@Nullable public @Nullable org.bukkit.generator.BiomeProvider getDefaultBiomeProvider(@NotNull @NotNull org.bukkit.generator.WorldInfo worldInfo) - Overrides:
getDefaultBiomeProviderin classorg.bukkit.generator.ChunkGenerator
-
getDefaultPopulators
@NotNull public @NotNull List<org.bukkit.generator.BlockPopulator> getDefaultPopulators(@NotNull @NotNull org.bukkit.World world) - Overrides:
getDefaultPopulatorsin classorg.bukkit.generator.ChunkGenerator
-