Biome-Modifier-for-Fabric

摘要
这是一个库模组,允许用户利用数据包轻松且兼容地修改生物群系。
开发者用法
众所周知,对于 Forge 整合包,开发者可以使用以下 示例 来修改生物群系:
{
"type": "forge:add_features",
"biomes": "#forge:is_plains",
"features": [
"emeraldcraft:wild_cabbage",
"emeraldcraft:wild_chili"
],
"step": "vegetal_decoration"
}
让我们让它在 Fabric 上也能工作!
数据包开发者应将所有生物群系修饰器(格式为 *.json)放置在 data/<modid>/biome_modifiers/ 目录中。通过此模组,所有生物群系修饰器都将应用于每个生物群系。
所有生物群系修饰器应遵循以下格式:
{
"type": "<modifier type>",
"biomes": "<registry name of a single biome/list of registry names of biomes/a tag of biomes>",
"priority": priority,
"<other keys...>": "<other values...>"
}
其中 type 代表生物群系修饰器的类型,biomes 代表要修改的所有生物群系。
注意 priority 字段是可选的。数值越小,它将被越早应用于生物群系(例如,优先级为 99 的修饰器将比优先级为 100 的修饰器更早应用)。默认值为 1000。
不同的生物群系修饰器类型
我们目前提供 9 种不同类型的生物群系修饰器:
biome_modifier:none
此类型允许开发者替换其他数据包中的其他生物群系修饰器。
{
"type": "biome_modifier:none"
}
biome_modifier:add_features
此生物群系修饰器将 features 字段中提到的所有已放置特性添加到目标生物群系中。
如果注册表中缺少任何已放置特性,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:add_features",
"biomes": "<registry name(s) of biomes>",
"features": "<registry name of a single feature/list of registry names of features>",
"step": "<step of decoration generation>"
}
biome_modifier:remove_features
此生物群系修饰器从目标生物群系中移除 features 字段中提到的所有已放置特性。
如果目标生物群系中缺少任何已放置特性,将会记录警告且不会导致游戏崩溃。
如果注册表中缺少任何已放置特性,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:remove_features",
"biomes": "<registry name(s) of biomes>",
"features": "<registry name of a single feature/list of registry names of features>",
"step": "<step of decoration generation>"
}
biome_modifier:add_spawns
此生物群系修饰器将 spawns 字段中提到的所有实体生成项添加到目标生物群系中。
如果注册表中缺少任何实体类型,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:add_spawns",
"biomes": "<registry name(s) of biomes>",
"spawners": [
{
"type": "<registry name of a single entity type>",
"weight": weight,
"minCount": minCount,
"maxCount": maxCount
}
//If you only add one spawner, you can also replace the list with the only object.
]
}
biome_modifier:remove_spawns
此生物群系修饰器从目标生物群系中移除 entity_types 字段中提到的所有实体生成项。
如果目标生物群系中缺少任何实体类型,将会记录警告且不会导致游戏崩溃。
如果注册表中缺少任何实体类型,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:remove_spawns",
"biomes": "<registry name(s) of biomes>",
"entity_types": [
"<registry name of a single entity type>"
//If you only remove one spawner, you can also replace the list with the only string.
]
}
biome_modifier:add_spawn_costs
此生物群系修饰器将 spawn_costs 字段中提到的所有实体生成项添加到目标生物群系的生成成本中。
与 biome_modifier:add_spawns 不同,此修饰器是将生成项添加到生成成本中(即生成潜力、生成密度)。
如果注册表中缺少任何实体类型,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:add_spawn_costs",
"biomes": "<registry name(s) of biomes>",
"spawn_costs": {
"<registry name of a single entity type>": {
"charge": charge,
"energy_budget": energy_budget
}
}
}
biome_modifier:remove_spawn_costs
此生物群系修饰器从目标生物群系的生成成本中移除 entity_types 字段中提到的所有实体生成项。
与 biome_modifier:remove_spawns 不同,此修饰器是从生成成本中移除生成项(即生成潜力、生成密度)。
如果目标生物群系中缺少任何实体类型,将会记录警告且不会导致游戏崩溃。
如果注册表中缺少任何实体类型,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:remove_spawn_costs",
"biomes": "<registry name(s) of biomes>",
"entity_types": [
"<registry name of a single entity type>"
//If you only remove one spawner, you can also replace the list with the only string.
]
}
biome_modifier:add_carvers
此生物群系修饰器将 carvers 字段中提到的所有凿刻器添加到目标生物群系中。
如果注册表中缺少任何凿刻器,将会记录错误(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:add_carvers",
"biomes": "<registry name(s) of biomes>",
"carvers": "<registry name of a single carver/list of registry names of carvers>",
"step": "<step of carver generation>"
}
biome_modifier:remove_carvers
此生物群系修改器会从目标生物群系中移除 carvers 字段中提及的所有洞穴生成器。
如果目标生物群系中缺少任何洞穴生成器,将会记录警告日志,但不会导致游戏崩溃。
如果注册表中缺少任何洞穴生成器,将会记录错误日志(在安全模式下不会导致游戏崩溃)。
{
"type": "biome_modifier:remove_carvers",
"biomes": "<生物群系的注册名>",
"carvers": "<单个洞穴生成器的注册名/或一组洞穴生成器的注册名列表>",
"step": "<洞穴生成阶段>"
}
示例
我们为模组提供了三个数据包示例:
Extra Ores
这个数据包为主世界添加了额外的矿石方块。

主世界无矿石
此数据包移除了主世界中所有的矿石方块,仅保留可供玩家获取矿石的矿脉。

下界的僵尸
此数据包使僵尸能够在下界生成。

Biome-Modifier-for-Fabric

Abstract
This is a library mod that allows users utilize datapacks to modify biomes easily and compatibly.
Usage for Developers
We all know that for Forge modpacks, developers can utilize the following example to modify biomes:
{
"type": "forge:add_features",
"biomes": "#forge:is_plains",
"features": [
"emeraldcraft:wild_cabbage",
"emeraldcraft:wild_chili"
],
"step": "vegetal_decoration"
}
Let's make this work for Fabric!
Datapack developers should put all biome modifiers (with format *.json) on data/<modid>/biome_modifiers/ directory. With this mod, all biome modifiers will be applied on each biome.
All biome modifiers should follow this format:
{
"type": "<modifier type>",
"biomes": "<registry name of a single biome/list of registry names of biomes/a tag of biomes>",
"priority": priority,
"<other keys...>": "<other values...>"
}
Where type stands for the type of biome modifiers, and biome stands for all biomes to be modified.
Notice that priority field is optional. The smaller it is, the earlier it will be applied to the biomes (for example, modifiers with priority 99 will be applied earlier than modifiers with priority 100). The default value is 1000.
Different Types of Biome Modifiers
We provide 9 different types of biome modifiers currently:
biome_modifier:none
This type allows developers to replace other biome modifiers in other datapacks.
{
"type": "biome_modifier:none"
}
biome_modifier:add_features
This biome modifier adds all placed features mentioned in features field to target biomes.
If any placed feature is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:add_features",
"biomes": "<registry name(s) of biomes>",
"features": "<registry name of a single feature/list of registry names of features>",
"step": "<step of decoration generation>"
}
biome_modifier:remove_features
This biome modifier removes all placed features mentioned in features field from target biomes.
If any placed feature is missing from the target biomes, a warning will be logged and won't crash the game.
If any placed feature is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:remove_features",
"biomes": "<registry name(s) of biomes>",
"features": "<registry name of a single feature/list of registry names of features>",
"step": "<step of decoration generation>"
}
biome_modifier:add_spawns
This biome modifier adds all entity spawns mentioned in spawns field to target biomes.
If any entity type is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:add_spawns",
"biomes": "<registry name(s) of biomes>",
"spawners": [
{
"type": "<registry name of a single entity type>",
"weight": weight,
"minCount": minCount,
"maxCount": maxCount
}
//If you only add one spawner, you can also replace the list with the only object.
]
}
biome_modifier:remove_spawns
This biome modifier removes all entity spawns mentioned in entity_types field from target biomes.
If any entity type is missing from the target biomes, a warning will be logged and won't crash the game.
If any entity type is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:remove_spawns",
"biomes": "<registry name(s) of biomes>",
"entity_types": [
"<registry name of a single entity type>"
//If you only remove one spawner, you can also replace the list with the only string.
]
}
biome_modifier:add_spawn_costs
This biome modifier adds all entity spawns mentioned in spawn_costs field to target biomes.
Unlikely to biome_modifier:add_spawns, this modifier adds spawns to spawn costs (aka. spawn potential, spawn density).
If any entity type is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:add_spawn_costs",
"biomes": "<registry name(s) of biomes>",
"spawn_costs": {
"<registry name of a single entity type>": {
"charge": charge,
"energy_budget": energy_budget
}
}
}
biome_modifier:remove_spawn_costs
This biome modifier removes all entity spawns mentioned in entity_types field from target biomes.
Unlikely to biome_modifier:remove_spawns, this modifier removes spawns to spawn costs (aka. spawn potential, spawn density).
If any entity type is missing from the target biomes, a warning will be logged and won't crash the game.
If any entity type is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:remove_spawn_costs",
"biomes": "<registry name(s) of biomes>",
"entity_types": [
"<registry name of a single entity type>"
//If you only remove one spawner, you can also replace the list with the only string.
]
}
biome_modifier:add_carvers
This biome modifier adds all carvers mentioned in carvers field to target biomes.
If any carver is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:add_carvers",
"biomes": "<registry name(s) of biomes>",
"carvers": "<registry name of a single carver/list of registry names of carvers>",
"step": "<step of carver generation>"
}
biome_modifier:remove_carvers
This biome modifier removes all carvers mentioned in carvers field from target biomes.
If any carver is missing from the target biomes, a warning will be logged and won't crash the game.
If any carver is missing from the registry, an error will be logged (won't crash the game with safe mode).
{
"type": "biome_modifier:remove_carvers",
"biomes": "<registry name(s) of biomes>",
"carvers": "<registry name of a single carver/list of registry names of carvers>",
"step": "<step of carver generation>"
}
Examples
We provide 3 example datapacks for our mods:
Extra Ores
This datapack adds extra ore blocks to the overworld.

No Ore in Overworld
This datapack removes all ore blocks to the overworld, and only keeps ore veins for players to obtain ores.

Zombies in the Nether
This datapack makes zombie able to spawn in the nether.

评论 0
登录后参与评分
还没有评论,来抢沙发吧