类 ChunkGenerator
generateNoise(WorldInfo, Random, int, int, ChunkData)generateSurface(WorldInfo, Random, int, int, ChunkData)generateBedrock(WorldInfo, Random, int, int, ChunkData)generateCaves(WorldInfo, Random, int, int, ChunkData)
getBaseHeight(WorldInfo, Random, int, int, HeightMap)
必须完全线程安全,并且能够处理多个并发调用者。
世界生成的某些方面可以委托给原版生成器。
可以重写以下方法来启用此功能:
shouldGenerateNoise()或shouldGenerateNoise(WorldInfo, Random, int, int)shouldGenerateSurface()或shouldGenerateSurface(WorldInfo, Random, int, int)shouldGenerateCaves()或shouldGenerateCaves(WorldInfo, Random, int, int)shouldGenerateDecorations()或shouldGenerateDecorations(WorldInfo, Random, int, int)shouldGenerateMobs()或shouldGenerateMobs(WorldInfo, Random, int, int)shouldGenerateStructures()或shouldGenerateStructures(WorldInfo, Random, int, int)
-
嵌套类概要
嵌套类修饰符和类型类说明static interface已过时。static interface区块的数据. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean测试指定方位是否对自然生成的方位有效。protected final @NotNull ChunkGenerator.ChunkDatacreateChunkData(@NotNull World world) 已过时。ChunkGenerator.ChunkData现在直接提供voidgenerateBedrock(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块基岩层.voidgenerateCaves(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块洞穴.generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull ChunkGenerator.BiomeGrid biome) 已过时。生成现在已拆分,应使用新方法,参见ChunkGeneratorvoidgenerateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块噪声.voidgenerateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块表面.intgetBaseHeight(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull HeightMap heightMap) getDefaultBiomeProvider(@NotNull WorldInfo worldInfo) 当在WorldCreator或服务器配置文件中未设置BiomeProvider时调用此方法.getDefaultPopulators(@NotNull World world) 得到一个用于提供指定世界的默认的BlockPopulator列表。getFixedSpawnLocation(@NotNull World world, @NotNull Random random) 获取一个固定出生方位用于一个指定的世界。boolean已过时。区块生成代码应该是线程安全的boolean已过时。无效果,基岩生成是表面步骤的一部分,参见shouldGenerateSurface()boolean已过时。booleanshouldGenerateCaves(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) 已过时。boolean获取服务器是否应该在此ChunkGenerator之后生成原版装饰.booleanshouldGenerateDecorations(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该在此ChunkGenerator之后生成原版装饰.boolean获取服务器是否应该在此ChunkGenerator之后生成原版生物.booleanshouldGenerateMobs(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该在此ChunkGenerator之后生成原版生物.boolean已过时。booleanshouldGenerateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) 已过时。boolean获取服务器是否应该在此ChunkGenerator之后生成原版结构.booleanshouldGenerateStructures(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该在此ChunkGenerator之后生成原版结构.boolean获取服务器是否应该生成原版表面.booleanshouldGenerateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该生成原版表面.
-
构造器详细资料
-
ChunkGenerator
public ChunkGenerator()
-
-
方法详细资料
-
generateNoise
public void generateNoise(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ, @NotNull @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块噪声.原文: Shapes the Chunk noise for the given coordinates.
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 the
ChunkGenerator.ChunkDataat a later point of time.The Y-coordinate range should never be hardcoded, to get the Y-coordinate range use the methods
ChunkGenerator.ChunkData.getMinHeight()andChunkGenerator.ChunkData.getMaxHeight().If
shouldGenerateNoise()is set to true, the givenChunkGenerator.ChunkDatacontains already the Vanilla noise generation.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标chunkData- 要修改的区块数据
-
generateSurface
public void generateSurface(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ, @NotNull @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块表面.原文: Shapes the Chunk surface for the given coordinates.
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 the
ChunkGenerator.ChunkDataat a later point of time.The Y-coordinate range should never be hardcoded, to get the Y-coordinate range use the methods
ChunkGenerator.ChunkData.getMinHeight()andChunkGenerator.ChunkData.getMaxHeight().If
shouldGenerateSurface()is set to true, the givenChunkGenerator.ChunkDatacontains already the Vanilla surface generation.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标chunkData- 要修改的区块数据
-
generateBedrock
public void generateBedrock(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ, @NotNull @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块基岩层.原文: Shapes the Chunk bedrock layer for the given coordinates.
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 the
ChunkGenerator.ChunkDataat a later point of time.The Y-coordinate range should never be hardcoded, to get the Y-coordinate range use the methods
ChunkGenerator.ChunkData.getMinHeight()andChunkGenerator.ChunkData.getMaxHeight().- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标chunkData- 要修改的区块数据
-
generateCaves
public void generateCaves(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ, @NotNull @NotNull ChunkGenerator.ChunkData chunkData) 为给定坐标塑造区块洞穴.原文: Shapes the Chunk caves for the given coordinates.
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 the
ChunkGenerator.ChunkDataat a later point of time.The Y-coordinate range should never be hardcoded, to get the Y-coordinate range use the methods
ChunkGenerator.ChunkData.getMinHeight()andChunkGenerator.ChunkData.getMaxHeight().If
shouldGenerateCaves()is set to true, the givenChunkGenerator.ChunkDatacontains already the Vanilla cave generation.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标chunkData- 要修改的区块数据
-
getDefaultBiomeProvider
@Nullable public @Nullable BiomeProvider getDefaultBiomeProvider(@NotNull @NotNull WorldInfo worldInfo) 当在WorldCreator或服务器配置文件中未设置BiomeProvider时调用此方法. 因此,一个插件可以提供生物群系,另一个插件可以提供生成.原文: Gets called when no
BiomeProvideris set inWorldCreatoror via the server configuration files. It is therefore possible that one plugin can provide the Biomes and another one the generation.Notes:
If
nullis returned, than Vanilla biomes are used.This method only gets called once when the world is loaded. Returning another
BiomeProviderlater one is not respected.- 参数:
worldInfo- 生物群系提供器将用于的世界的世界信息- 返回:
- 用于填充区块生物群系的BiomeProvider
-
getBaseHeight
public int getBaseHeight(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int x, int z, @NotNull @NotNull HeightMap heightMap) 此方法类似于World.getHighestBlockAt(int, int, HeightMap). 区别在于,最高的y坐标应该是应用任何表面、基岩、洞穴或装饰之前的方块. 换句话说,就是区块中只有噪声存在时的最高方块.原文: This method is similar to
World.getHighestBlockAt(int, int, HeightMap). With the difference being, that the highest y coordinate should be the block before any surface, bedrock, caves or decoration is applied. Or in other words the highest block when only the noise is present at the chunk.Notes:
When this method is not overridden, the Vanilla base height is used.
This method should never attempt to get the Chunk at the passed coordinates, or use the method
World.getHighestBlockAt(int, int, HeightMap), as doing so may cause an infinite loop.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器x- 世界原点的X坐标z- 世界原点的Z坐标heightMap- 从哪个高度图获取最高方块- 返回:
- 给定位置最高方块的y坐标
-
generateChunkData
@NotNull @Deprecated(since="1.17.1") public @NotNull ChunkGenerator.ChunkData generateChunkData(@NotNull @NotNull World world, @NotNull @NotNull Random random, int x, int z, @NotNull @NotNull ChunkGenerator.BiomeGrid biome) 已过时。生成现在已拆分,应使用新方法,参见ChunkGenerator为给定坐标塑造区块. 此方法必须返回一个ChunkData.原文: 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)- 参数:
world- 此区块将用于的世界random- 要使用的随机数生成器x- 区块的X坐标z- 区块的Z坐标biome- 区块的建议生物群系值 - 可以被生成器更新- 返回:
- 包含此生成器创建的每个方块类型的ChunkData
-
createChunkData
@NotNull @Deprecated(since="1.17.1") protected final @NotNull ChunkGenerator.ChunkData createChunkData(@NotNull @NotNull World world) 已过时。ChunkGenerator.ChunkData现在直接提供为世界创建一个ChunkData.原文: Create a ChunkData for a world.
- 参数:
world- ChunkData所用于的世界- 返回:
- 为世界创建的新ChunkData
-
canSpawn
测试指定方位是否对自然生成的方位有效。原文: Tests if the specified location is valid for a natural spawn position
- 参数:
world- 用于测试的世界x- 用于测试的方块的X坐标z- 用于测试的方块的Z坐标- 返回:
- 如果方位有效则返回true,否则返回false
-
getDefaultPopulators
得到一个用于提供指定世界的默认的BlockPopulator列表。原文: Gets a list of default
BlockPopulators to apply to a given world- 参数:
world- 用于提供的世界- 返回:
- 包含所有方块填充器的列表
-
getFixedSpawnLocation
@Nullable public @Nullable Location getFixedSpawnLocation(@NotNull @NotNull World world, @NotNull @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.
- 参数:
world- 用于定位出生点的世界random- 这个计算器中使用的随机生成器- 返回:
- 包含一个新的出生点的方位,若不存在则返回null
-
isParallelCapable
已过时。区块生成代码应该是线程安全的获取此ChunkGenerator是否支持并行.原文: Gets if this ChunkGenerator is parallel capable. See
ChunkGeneratorfor more information.- 返回:
- 并行支持状态
-
shouldGenerateNoise
已过时。获取服务器是否应该生成原版噪声.原文: Gets if the server should generate Vanilla noise.
The Vanilla noise is generated before
generateNoise(WorldInfo, Random, int, int, ChunkData)is called.This is method is not called (and has therefore no effect), if
shouldGenerateNoise(WorldInfo, Random, int, int)is overridden.- 返回:
- 如果服务器应该生成原版噪声则返回true
- 另请参阅:
-
shouldGenerateNoise
@Deprecated(since="26.3") public boolean shouldGenerateNoise(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ) 已过时。获取服务器是否应该生成原版噪声.原文: Gets if the server should generate Vanilla noise.
The Vanilla noise is generated before
generateNoise(WorldInfo, Random, int, int, ChunkData)is called.Only this method is called if both this and
shouldGenerateNoise()are overridden.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标- 返回:
- 如果服务器应该生成原版噪声则返回true
- 另请参阅:
-
shouldGenerateSurface
public boolean shouldGenerateSurface()获取服务器是否应该生成原版表面.原文: Gets if the server should generate Vanilla surface.
The Vanilla surface is generated before
generateSurface(WorldInfo, Random, int, int, ChunkData)is called.This is method is not called (and has therefore no effect), if
shouldGenerateSurface(WorldInfo, Random, int, int)is overridden.- 返回:
- 如果服务器应该生成原版表面则返回true
- 另请参阅:
-
shouldGenerateSurface
public boolean shouldGenerateSurface(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该生成原版表面.原文: Gets if the server should generate Vanilla surface.
The Vanilla surface is generated before
generateSurface(WorldInfo, Random, int, int, ChunkData)is called.Only this method is called if both this and
shouldGenerateSurface()are overridden.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标- 返回:
- 如果服务器应该生成原版表面则返回true
- 另请参阅:
-
shouldGenerateBedrock
已过时。无效果,基岩生成是表面步骤的一部分,参见shouldGenerateSurface()获取服务器是否应该生成原版基岩.原文: Gets if the server should generate Vanilla bedrock.
The Vanilla bedrock is generated before
generateBedrock(WorldInfo, Random, int, int, ChunkData)is called.- 返回:
- 如果服务器应该生成原版基岩则返回true
-
shouldGenerateCaves
已过时。获取服务器是否应该生成原版洞穴.原文: Gets if the server should generate Vanilla caves.
The Vanilla caves are generated before
generateCaves(WorldInfo, Random, int, int, ChunkData)is called.This is method is not called (and has therefore no effect), if
shouldGenerateCaves(WorldInfo, Random, int, int)is overridden.- 返回:
- 如果服务器应该生成原版洞穴则返回true
- 另请参阅:
-
shouldGenerateCaves
@Deprecated(since="26.3") public boolean shouldGenerateCaves(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ) 已过时。获取服务器是否应该生成原版洞穴.原文: Gets if the server should generate Vanilla caves.
The Vanilla caves are generated before
generateCaves(WorldInfo, Random, int, int, ChunkData)is called.Only this method is called if both this and
shouldGenerateCaves()are overridden.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标- 返回:
- 如果服务器应该生成原版洞穴则返回true
- 另请参阅:
-
shouldGenerateDecorations
public boolean shouldGenerateDecorations()获取服务器是否应该在此ChunkGenerator之后生成原版装饰.原文: Gets if the server should generate Vanilla decorations after this ChunkGenerator.
The Vanilla decoration are generated before any
BlockPopulatorare called.This is method is not called (and has therefore no effect), if
shouldGenerateDecorations(WorldInfo, Random, int, int)is overridden.- 返回:
- 如果服务器应该生成原版装饰则返回true
- 另请参阅:
-
shouldGenerateDecorations
public boolean shouldGenerateDecorations(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该在此ChunkGenerator之后生成原版装饰.原文: Gets if the server should generate Vanilla decorations after this ChunkGenerator.
The Vanilla decoration are generated before any
BlockPopulatorare called.Only this method is called if both this and
shouldGenerateDecorations()are overridden.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标- 返回:
- 如果服务器应该生成原版装饰则返回true
- 另请参阅:
-
shouldGenerateMobs
public boolean shouldGenerateMobs()获取服务器是否应该在此ChunkGenerator之后生成原版生物.原文: Gets if the server should generate Vanilla mobs after this ChunkGenerator.
This is method is not called (and has therefore no effect), if
shouldGenerateMobs(WorldInfo, Random, int, int)is overridden.- 返回:
- 如果服务器应该生成原版生物则返回true
- 另请参阅:
-
shouldGenerateMobs
public boolean shouldGenerateMobs(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该在此ChunkGenerator之后生成原版生物.原文: Gets if the server should generate Vanilla mobs after this ChunkGenerator.
Only this method is called if both this and
shouldGenerateMobs()are overridden.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标- 返回:
- 如果服务器应该生成原版生物则返回true
- 另请参阅:
-
shouldGenerateStructures
public boolean shouldGenerateStructures()获取服务器是否应该在此ChunkGenerator之后生成原版结构.原文: Gets if the server should generate Vanilla structures after this ChunkGenerator.
This is method is not called (and has therefore no effect), if
shouldGenerateStructures(WorldInfo, Random, int, int)is overridden.- 返回:
- 如果服务器应该生成原版结构则返回true
- 另请参阅:
-
shouldGenerateStructures
public boolean shouldGenerateStructures(@NotNull @NotNull WorldInfo worldInfo, @NotNull @NotNull Random random, int chunkX, int chunkZ) 获取服务器是否应该在此ChunkGenerator之后生成原版结构.原文: Gets if the server should generate Vanilla structures after this ChunkGenerator.
Only this method is called if both this and
shouldGenerateStructures()are overridden.- 参数:
worldInfo- 此区块将用于的世界的世界信息random- 要使用的随机数生成器chunkX- 区块的X坐标chunkZ- 区块的Z坐标- 返回:
- 如果服务器应该生成原版结构则返回true
- 另请参阅:
-
BiomeProvider设置生物群系