类 WorldCreator
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明获取将被用于创建或加载世界的生物群系提供器。biomeProvider(@Nullable String biomeProvider) 设置将被用于创建或加载世界的生物群系提供器。biomeProvider(@Nullable String biomeProvider, @Nullable CommandSender output) 设置将被用于创建或加载世界的生物群系提供器。biomeProvider(@Nullable BiomeProvider biomeProvider) 设置将被用于创建或加载世界的生物群系提供器。从指定的世界复制设置。copy(@NotNull WorldCreator creator) 从指定的WorldCreator复制设置。使用指定的设置创建一个世界。获取用于创建或加载世界的环境。设置用于创建或加载世界的环境。boolean获取世界是否生成建筑。generateStructures(boolean generate) 设置被这个生成器创建或加载的世界是否会拥有建筑。获取用于创建或加载世界的生成器。设置将被用于创建或加载世界的生成器。generator(@Nullable String generator, @Nullable CommandSender output) 设置将用于创建或加载的生成器。generator(@Nullable ChunkGenerator generator) 设置将被用于创建或加载世界的生成器。获取将被创建或加载的世界的生成器的配置。generatorSettings(@NotNull String generatorSettings) 设置将被创建或加载的世界的生成器配置。static @Nullable BiomeProvidergetBiomeProviderForName(@NotNull String world, @Nullable String name, @Nullable CommandSender output) 试图使用指定的名称获取BiomeProvider。static @Nullable ChunkGeneratorgetGeneratorForName(@NotNull String world, @Nullable String name, @Nullable CommandSender output) 试图使用指定的名称获取ChunkGenerator。booleanhardcore()获取世界是否为极限模式。hardcore(boolean hardcore) 设置世界是否为极限模式。boolean已过时。keepSpawnInMemory(boolean keepSpawnInMemory) 已过时。"出生点区块"的概念已被移除, 使用World.setChunkForceLoaded(int, int, boolean)以更好地控制name()获取被加载或创建的世界的名称。static @NotNull WorldCreator为指定的世界名创建一个新的WorldCreator。longseed()获取用于创建这个世界的种子。seed(long seed) 设置用于创建这个世界的种子。type()获取将被创建或加载的世界的类型。设置将被创建或加载的世界的类型。
-
构造器详细资料
-
WorldCreator
为指定世界的名称创建一个空的WorldCreationOptions类型。原文: Creates an empty WorldCreationOptions for the given world name
- 参数:
name- 将被创建的世界的名称
-
-
方法详细资料
-
copy
从指定的世界复制设置。原文: Copies the options from the specified world
- 参数:
world- 用于复制设置的世界来源- 返回:
- 用于连接的对象
-
copy
从指定的WorldCreator复制设置。原文: Copies the options from the specified
WorldCreator- 参数:
creator- 用于复制设置的世界来源- 返回:
- 用于连接的对象
-
name
获取被加载或创建的世界的名称。原文: Gets the name of the world that is to be loaded or created.
- 返回:
- 世界名称
-
seed
public long seed()获取用于创建这个世界的种子。原文: Gets the seed that will be used to create this world
- 返回:
- 世界种子
-
seed
设置用于创建这个世界的种子。原文: Sets the seed that will be used to create this world
- 参数:
seed- 世界种子- 返回:
- 用于连接的对象
-
environment
获取用于创建或加载世界的环境。原文: Gets the environment that will be used to create or load the world
- 返回:
- 世界的环境
-
environment
设置用于创建或加载世界的环境。原文: Sets the environment that will be used to create or load the world
- 参数:
env- 世界的环境- 返回:
- 用于连接的对象
-
type
获取将被创建或加载的世界的类型。原文: Gets the type of the world that will be created or loaded
- 返回:
- 世界的类型
-
type
设置将被创建或加载的世界的类型。原文: Sets the type of the world that will be created or loaded
- 参数:
type- 世界的类型- 返回:
- 用于连接的对象
-
generator
获取用于创建或加载世界的生成器。可能为null值,在这种情况下会使用这个环境的"natural"型生成器。
原文: Gets the generator that will be used to create or load the world.
This may be null, in which case the "natural" generator for this environment will be used.
- 返回:
- 区块生成器
-
generator
设置将被用于创建或加载世界的生成器。可能为null值,在这种情况下会使用这个环境的"natural"型生成器。
原文: Sets the generator that will be used to create or load the world.
This may be null, in which case the "natural" generator for this environment will be used.
- 参数:
generator- 区块生成器- 返回:
- 用于连接的对象
-
generator
设置将被用于创建或加载世界的生成器。可能为null值,在这种情况下会使用这个环境的"natural"型生成器。
如果找不到指定名字的生成器,就会使用自然环境生成器以代替并且会在控制台上输出一个警告。
原文: Sets the generator that will be used to create or load the world.
This may be null, in which case the "natural" generator for this environment will be used.
If the generator cannot be found for the given name, the natural environment generator will be used instead and a warning will be printed to the console.
- 参数:
generator- 使用的生成器的名字,形式为"plugin:id"- 返回:
- 用于连接的对象
-
generator
@NotNull public @NotNull WorldCreator generator(@Nullable @Nullable String generator, @Nullable @Nullable CommandSender output) 设置将用于创建或加载的生成器。可能为null值,在这种情况下会使用这个环境的"natural"型生成器。
如果找不到指定名字的生成器,就会使用自然环境生成器以代替并且会在控制台上输出一个警告。
原文: Sets the generator that will be used to create or load the world.
This may be null, in which case the "natural" generator for this environment will be used.
If the generator cannot be found for the given name, the natural environment generator will be used instead and a warning will be printed to the specified output
- 参数:
generator- 使用的生成器的名字,形式为"plugin:id"output- 将用于接受任何错误信息的CommandSender- 返回:
- 用于连接的对象
-
biomeProvider
获取将被用于创建或加载世界的生物群系提供器。可能为null值,在这种情况下会使用
ChunkGenerator的生物群系提供器。 如果没有指定ChunkGenerator,则会使用此环境的"natural"型生物群系提供器。原文: Gets the biome provider that will be used to create or load the world.
This may be null, in which case the biome provider from the
ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.- 返回:
- 生物群系提供器
-
biomeProvider
@NotNull public @NotNull WorldCreator biomeProvider(@Nullable @Nullable BiomeProvider biomeProvider) 设置将被用于创建或加载世界的生物群系提供器。可能为null值,在这种情况下会使用
ChunkGenerator的生物群系提供器。 如果没有指定ChunkGenerator,则会使用此环境的"natural"型生物群系提供器。原文: Sets the biome provider that will be used to create or load the world.
This may be null, in which case the biome provider from the
ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.- 参数:
biomeProvider- 生物群系提供器- 返回:
- 用于连接的对象
-
biomeProvider
设置将被用于创建或加载世界的生物群系提供器。可能为null值,在这种情况下会使用
ChunkGenerator的生物群系提供器。 如果没有指定ChunkGenerator,则会使用此环境的"natural"型生物群系提供器。如果找不到指定名字的生物群系提供器且没有指定
ChunkGenerator,则会使用自然环境的生物群系提供器以代替并且会向指定的输出处输出一条警告。原文: Sets the biome provider that will be used to create or load the world.
This may be null, in which case the biome provider from the
ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.If the biome provider cannot be found for the given name and no
ChunkGeneratoris specific, the natural environment biome provider will be used instead and a warning will be printed to the specified output- 参数:
biomeProvider- 使用的生物群系提供器的名字,形式为"plugin:id"- 返回:
- 用于连接的对象
-
biomeProvider
@NotNull public @NotNull WorldCreator biomeProvider(@Nullable @Nullable String biomeProvider, @Nullable @Nullable CommandSender output) 设置将被用于创建或加载世界的生物群系提供器。可能为null值,在这种情况下会使用
ChunkGenerator的生物群系提供器。 如果没有指定ChunkGenerator,则会使用此环境的"natural"型生物群系提供器。如果找不到指定名字的生物群系提供器且没有指定
ChunkGenerator,则会使用自然环境的生物群系提供器以代替并且会向指定的输出处输出一条警告。原文: Sets the biome provider that will be used to create or load the world.
This may be null, in which case the biome provider from the
ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.If the biome provider cannot be found for the given name and no
ChunkGeneratoris specific, the natural environment biome provider will be used instead and a warning will be printed to the specified output- 参数:
biomeProvider- 使用的生物群系提供器的名字,形式为"plugin:id"output- 将用于接收任何错误信息的CommandSender- 返回:
- 用于连接的对象
-
generatorSettings
设置将被创建或加载的世界的生成器配置。目前只有
WorldType.FLAT使用这些配置,并且期望它们是JSON格式且定义了有效的生物群系(1.18.2及以上版本)。一个有效的配置示例如下:{"layers": [{"block": "stone", "height": 1}, {"block": "grass_block", "height": 1}], "biome":"plains"}原文: Sets the generator settings of the world that will be created or loaded.
Currently only
WorldType.FLATuses these settings, and expects them to be in JSON format with a valid biome (1.18.2 and above) defined. An example valid configuration is as follows:{"layers": [{"block": "stone", "height": 1}, {"block": "grass_block", "height": 1}], "biome":"plains"}- 参数:
generatorSettings- 生成器应使用的配置- 返回:
- 用于连接的对象
- 另请参阅:
-
- 自定义维度(滚动至 "When the generator ID type is
minecraft:flat")
- 自定义维度(滚动至 "When the generator ID type is
-
generatorSettings
获取将被创建或加载的世界的生成器的配置。原文: Gets the generator settings of the world that will be created or loaded
- 返回:
- 将被使用的生成器的配置
- 另请参阅:
-
generateStructures
设置被这个生成器创建或加载的世界是否会拥有建筑。原文: Sets whether or not worlds created or loaded with this creator will have structures.
- 参数:
generate- 是否生成建筑- 返回:
- 用于连接的对象
-
generateStructures
public boolean generateStructures()获取世界是否生成建筑。原文: Gets whether or not structures will be generated in the world.
- 返回:
- True 如果生成建筑则返回true
-
hardcore
设置世界是否为极限模式。在极限模式世界中,难度将被锁定为困难。
原文: Sets whether the world will be hardcore or not.
In a hardcore world the difficulty will be locked to hard.
- 参数:
hardcore- 世界是否为极限模式- 返回:
- 用于连接的对象
-
hardcore
public boolean hardcore()获取世界是否为极限模式。在极限模式世界中,难度将被锁定为困难。
原文: Gets whether the world will be hardcore or not.
In a hardcore world the difficulty will be locked to hard.
- 返回:
- 极限模式状态
-
keepSpawnInMemory
@NotNull @Deprecated(since="1.21.9") public @NotNull WorldCreator keepSpawnInMemory(boolean keepSpawnInMemory) 已过时。"出生点区块"的概念已被移除, 使用World.setChunkForceLoaded(int, int, boolean)以更好地控制设置出生点区块是否保持加载状态。将此设置为false也会在创建新世界时阻止出生点区块被生成。
除非配合重写了
ChunkGenerator.getFixedSpawnLocation(World, Random)的ChunkGenerator,否则几乎没有性能提升。原文: Sets whether the spawn chunks will be kept loaded.
Setting this to false will also stop the spawn chunks from being generated when creating a new world.
Has little performance benefit unless paired with a
ChunkGeneratorthat overridesChunkGenerator.getFixedSpawnLocation(World, Random).- 参数:
keepSpawnInMemory- 出生点区块是否保持加载- 返回:
- 用于连接的对象
-
keepSpawnInMemory
已过时。"出生点区块"的概念已被移除, 使用World.isChunkForceLoaded(int, int)以更好地控制获取出生点区块是否保持加载状态。原文: Gets whether or not the spawn chunks will be kept loaded.
- 返回:
- 如果出生点区块保持加载则返回true
-
createWorld
使用指定的设置创建一个世界。如果世界存在,它就会从磁盘被加载,一些设置可能被忽略。
原文: Creates a world with the specified options.
If the world already exists, it will be loaded from disk and some options may be ignored.
- 返回:
- 最近创建或加载的世界
-
name
为指定的世界名创建一个新的WorldCreator。原文: Creates a new
WorldCreatorfor the given world name- 参数:
name- 加载或创建的世界名- 返回:
- 创建的世界生成器
-
getGeneratorForName
@Nullable public static @Nullable ChunkGenerator getGeneratorForName(@NotNull @NotNull String world, @Nullable @Nullable String name, @Nullable @Nullable CommandSender output) 试图使用指定的名称获取ChunkGenerator。如果生成器找不到,则会返回null并会向指定的
CommandSender输出一条信息来解释原因。名称的形式必须为"plugin:id"或"plugin"形式,请求的插件的"plugin"为一个插件的安全名称并且"id"是生成器的可选的唯一的标识符。
原文: Attempts to get the
ChunkGeneratorwith the given name.If the generator is not found, null will be returned and a message will be printed to the specified
CommandSenderexplaining why.The name must be in the "plugin:id" notation, or optionally just "plugin", where "plugin" is the safe-name of a plugin and "id" is an optional unique identifier for the generator you wish to request from the plugin.
- 参数:
world- 将被使用的世界名name- 检索的生成器的名字output- 错误发生时的输出处- 返回:
- 若存在则返回获取的生成器,否则返回null
-
getBiomeProviderForName
@Nullable public static @Nullable BiomeProvider getBiomeProviderForName(@NotNull @NotNull String world, @Nullable @Nullable String name, @Nullable @Nullable CommandSender output) 试图使用指定的名称获取BiomeProvider。如果生物群系提供器找不到,则会返回null并会向指定的
CommandSender输出一条信息来解释原因。名称的形式必须为"plugin:id"或"plugin"形式,请求的插件的"plugin"为一个插件的安全名称并且"id"是生物群系提供器的可选的唯一的标识符。
原文: Attempts to get the
BiomeProviderwith the given name.If the biome provider is not found, null will be returned and a message will be printed to the specified
CommandSenderexplaining why.The name must be in the "plugin:id" notation, or optionally just "plugin", where "plugin" is the safe-name of a plugin and "id" is an optional unique identifier for the biome provider you wish to request from the plugin.
- 参数:
world- 将被使用的世界名name- 检索的生物群系提供器的名字output- 错误发生时的输出处- 返回:
- 若存在则返回获取的生物群系提供器,否则返回null
-
World.isChunkForceLoaded(int, int)以更好地控制