下载量
56,724
关注数
13
数据来源
Modrinth
模组详细介绍
结构化重生版
本项目是DRAYLAR的STRUCTURIZED的重制版。原版请见:https://github.com/omega-mc/structurized/tree/1.18
结构化重生版是一个简单的库,用于帮助添加自定义村庄结构。
拼图修改
结构化提供了一个注册表,允许您向村庄等拼图中的StructurePool添加自定义结构。假设我们想将village/plains/houses/plainssmallhouse_1添加到沙漠房屋池中。只需将新结构注册到目标池,并指定权重和一些可选修饰符。在与调用任何其他服务器端注册事件(例如注册物品或方块)相同的位置调用这些register方法。
FabricStructurePoolRegistry.register(
Identifier("minecraft:village/desert/houses"), //目标池
Identifier("minecraft:village/plains/houses/plains_small_house_1"), //要添加的新结构nbt
2, //结构在池中的权重
StructureProcessorLists.MOSSIFY_10_PERCENT) //可选处理器,用于添加苔藓效果
如果您没有特殊需求,可以使用registerSimple来简化操作:
FabricStructurePoolRegistry.registerSimple(
Identifier("minecraft:village/desert/houses"), //目标池
Identifier("minecraft:village/plains/houses/plains_small_house_1"), //要添加的新结构nbt
2) //结构在池中的权重
灵活的注册
注册方法非常灵活,提供了多个可选参数以满足需求。在许多情况下,使用registerSimple方法就足够了,但主要的register方法可用于实现更复杂的功能,例如为许多村庄结构添加随机苔石效果。
参数:
poolId:必需,要修改的结构目标池
structureId:必需,新结构nbt的位置标识符
weight:必需,结构被选中生成的概率。权重1到3大约对应每个村庄生成1个结构
processor:可选,定义自定义生成调整,如随机苔石
projection:可选,定义结构与地面的交互方式(在空间中保持刚性或适应地形)
type:可选,定义所需的structurePoolElement类型。大多数情况下不需要此参数
回调注册
如果您想对结构池进行更高级的操作,也可以直接注册回调并添加任意事件代码。注册回调的示例如下:
StructurePoolAddCallback.EVENT.register(structurePool -> {
if(structurePool.getUnderlying().getId().toString().equals("minecraft:village/plains/houses")) {
structurePool.addStructurePoolElement(new SinglePoolElement("village/desert/houses/desert_small_house_1"), 50);
}
});
添加依赖
您可以使用Modrinth内置的Maven仓库将此库添加为项目依赖。{VERSION}是您要使用的版本号。例如,此库的第一个版本上传的版本号为1.18.2-01。
在build.gradle中:
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
modImplementation "maven.modrinth:Wd844r7Q:{VERSION}"
include("maven.modrinth:Wd844r7Q:{VERSION}")
}
在build.gradle.kts中:
repositories {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
}
dependencies {
modImplementation("maven.modrinth:Wd844r7Q:{VERSION}")
include("maven.modrinth:Wd844r7Q:{VERSION}")
} 基本信息
模组名称Structurized Reborn
作者fzzyhmstrs
下载量56,724
关注数13
支持版本1.18.2 - 1.21.1
加载器fabric / quilt
客户端unsupported
服务端required
