关于
CubicStruct 是一个旨在将自定义结构(NBT 文件)集成到世界生成中的模组,并兼容 Cubic World Gen。对于每个结构,它通过各自的 .json 文件提供生物群系、最大衰减、放置位置等设置选项。如果你富有创意,也许你将不再需要其他结构模组。此外,若想在不创建模组或将内容粘贴到每个世界的情况下向这些结构添加自定义战利品表,请参阅 Iloot。
用法
原版/Cubic Chunks 兼容性警告
- 如果在使用 Cubic Chunks 时未使用 Cubic World Gen,则 必须 调整
minX 和 minY 设置,否则世界生成将尝试从世界荒谬的顶部追踪以生成结构。
- 虽然这不是必需的依赖项,但本模组是专门为与 Cubic World Gen 的结构兼容性而开发的;在带有或不带有 Cubic Chunks 的常规世界中可能会产生非预期效果(例如生成失败)。若要在不使用 CWG 的情况下获得理想结果,请将
minX 和 minY 设置为适合结构的值。
获取结构 .nbt 文件
要获取任何采用 .nbt 格式的结构,只需使用 Minecraft 原版的结构方块进行保存即可。新文件将保存在存档的 structures 目录中,随后可将其粘贴到位于 Minecraft 基础目录下的生成的 cubic_structures 文件夹中。
数据方块
CubicStruct 为数据方块实现了额外功能,这些功能会在自然世界生成时生效(手动加载未实现),如下所示(<<>> - 必需; <> - 可选):
villager <(职业 (字符串/整数))> <(职业阶段 (整数))> - 生成具有给定职业和职业阶段的随机村民。
- 可用的职业有
farmer(农民)、librarian(图书管理员)、cleric(牧师)、blacksmith(铁匠)、butcher(屠夫)和 nitwit(笨蛋)。或者也可以使用 ID。
spawner - 生成一个来自地牢池的随机怪物刷怪笼。
block <<{blocks:[{<<id: (字符串)>>,<data: (整数)>,<nbt: (NBT 字符串)>}]}>> <(种子 ((整数)))> - 从提供的列表中生成一个随机方块。提供种子允许结构内的多个方块以相似的方式生成(仅针对方块本身,不适用于关联的任何 NBT 数据)。格式化示例如下:block {blocks:[{id:"minecraft:gravel"},{id:"minecraft:chest",data:1,nbt:{LootTable:"iloot:chests/fish"}}]} 7.
初始化结构
通用
.nbt 文件将在游戏/模组重载时初始化,并从中生成一个新的目录。该新目录将包含一个 .json 文件,您可以随意修改它以改变结构的生成方式。所有值均为预设值,其决定生成的方式如下:
- file - (默认值:文件名,必填)- 唯一不会自动推断(但仍会自动生成)的必填参数。除非缺失、将 .nbt 移入分组,或同时更改正在编辑对象的文件名,否则请勿修改此项。
- name - (默认值:文件名)- 结构的名称。
- description - (默认值:"No description provided.")- 结构的简要描述。
- spawnChance - (默认值:1.0)- 在区块内尝试生成结构的概率百分比。请注意,此值是相对的,可能会受到生成失败的影响;对于极容易生成失败的结构,应提供更高的值。
- surfaceLevel - (默认值:0)- 相对于结构高度以开始在表面/天花板生成的 Y 轴偏移量。当
placementType 设置为 surface 时,0 表示从结构底部生成,而 ceiling 则相反。例如,如果结构向下延伸 8 个方块进入地面(“地面”指其附着的任意表面/天花板),则应将其设置为 -8。block 和 force 忽略此设置。
- dimensions - (默认值:[0])- 此结构可以生成的所有维度列表(-1 = 下界,0 = 主世界,1 = 末地)。此功能在 CWG 世界中当前不可用;请改用生物群系列表。
- biomeWhiteList - (默认值:false)(与黑名单冲突)- 是否限制结构仅在特定生物群系中生成。
- biomeBlackList - (默认值:false)(与白名单冲突)- 是否禁止结构在特定生物群系中生成。
- biomes - (默认值:minecraft:plains)- 如果启用了白名单/黑名单,则在哪些生物群系中生成。
- maxDecay - (默认值:0)- 表示生成结构时可能丢失完整性的百分比值。较高的值会增加缺失方块的数量。
- airSpawn - (默认值:false)- 结构是否仅尝试在空气中生成(而非液体中)。与
liquidSpawn 冲突,且被 block 放置类型忽略。如果放置类型为 surface,请启用此项,否则结构也会在液体中生成。
- liquidSpawn - (默认值:false)- 结构是否仅尝试在液体中生成。与
airSpawn 冲突,且被 block 放置类型忽略。
- rotate - (默认值:true)- 结构生成时是否具有随机的水平旋转角度。
- mirror - (默认值:true)- 结构生成时是否具有随机的水平镜像翻转。
- minY - (默认值:-2147483648)- 生成结构的最小 Y 坐标。
- maxY - (默认值:2147483647)- 生成结构的最大 Y 坐标。
- minXZ - (默认值:0)- X 或 Z 坐标最小值的绝对值,按区块取整。
- maxXZ - (默认值:2147483647)- X 或 Z 坐标最大值的绝对值,按区块取整。
- placementType - (默认值:surface)- 可以是
force、block、surface、liquidsurface 或 ceiling。
force 将在任何可以放置方块的地方生成结构,并遵守其他生成规则。
block 将在 replaced 中定义的方块内生成结构。
surface 将在平坦的可行走表面上生成结构。如果未将 airspawn 设置为 true,这包括水下/液体表面。
liquidsurface 如果在上方有空气,将在液体顶部生成结构。
ceiling 将在平坦的天花板上悬挂生成结构。推荐用于地形生成中常见这种情况的场景。否则,峡谷和洞穴的天花板是极限。
- replaced - (默认值:minecraft:air)- 如果使用
block 放置类型,请设置为 modid:yourblock。结构将在该方块内生成。如果 placementType 不是 block,则忽略 replaced。
- floating - (默认值:false)- 导致具有
block 放置类型的结构在其下方追踪十个方块,以确定是否有任何方块不匹配 replaced。如果是这样,结构将重试生成。
- usesFillBlock - (默认值:false)- 如果结构的基底原本是非实心的,则用方块填充它们。但是,为了性能和避免无尽的柱子,如果下方空间超过 20 个方块,则不会发生这种情况。适用于所有放置类型,但最推荐用于
surface 和 ceiling。
- fillBlock - (默认值:minecraft:dirt)- 如果要启用
usesFillBlock,用于填充基底的方块。
- lenient - (默认值:false)- 如果为 true,将执行较少的阻挡检查以确定有效放置位置。理想情况下适用于粗糙地形,否则生成会经常失败,但会导致与周围环境的碰撞显著增加。目前,只有
surface、liquidsurface 和 ceiling 可以使用此选项。
- enabled - (默认值:false)- 此结构是否会生成。编辑完成后请务必将其设置为 true!
分组
为了降低复杂性,.json 文件不会为分组自动生成变量;这些参数必须在将所有分组文件放入单个目录后由您手动添加到结构中。分组使用随机选择的原始结构的 spawnChance 来确定频率。
以下变量对于分组中的非原始结构将被忽略:spawnChance、dimensions、biomes、minY 和 maxY,因为它们是从原始结构推断出来的,或由以下参数替换。
分组参数:
要创建结构组,请添加一个包含以下参数的 group.json:
- name(默认值:"Unnamed Group")- 组的名称。
- origins - (默认值:无,必填)- 可作为构建组起始点的结构(NBT 文件名)数组。目录中必须至少指定一个结构,且当前激活的起源结构不计入 minSize 和 maxSize。
- maxSpreadXZ(默认值:5)- 可从起源/起始点结构向水平方向扩散多少个区块。
- maxSpreadY(默认值:3)- 可从起源/起始点结构向垂直方向扩散多少个区块。
- minSize(默认值:8)- 将在组内生成的结构数量,优先选择具有 minCount 的结构,其次是那些 minCount 为 0 且具有权重的结构。
- maxSize(默认值:12)- 生成结构的最大数量。
- spacing(默认值:2)- 各结构之间可以生成的最小距离。感知上非常粗略。
- enabled(默认值:true)- 该组是否会生成。
组结构参数
将这些变量追加到每个结构 JSON 文件中,否则它们将保持默认值。如果没有至少一个起源,组将不会生成。
- minCount(默认值:0)- 必须 生成的此类结构数量。如果大于 0,则无论权重如何,都会优先于其他结构生成。无论怎样,当前激活的起源始终会建造,如果不应生成更多,则应将其保留为 0。所有结构的此值之和不应超过
group.json 中的 minSize。
- maxCount(默认值:2147483647)- 此类结构的最大数量。除非需要放置更多,否则所有原点都应将其设置为 0,并且所有结构的此值之和必须大于或等于
group.json 中指定的最大大小。如果您希望它仅受组最大值限制,请将其设置为一个荒谬的值。
- weight(默认值:1)- 此结构的优先级级别;较高的权重会增加相对于组中其他结构生成的几率。一旦达到此结构的 max count,将被忽略。如果某物是起源或者/并且只应生成其最小计数,请将此值设置为 0。
加载结构
在调整这些文件后,重新加载模组 (/csreload) 或游戏,结构应按预期在新区块中生成。
链接
Modrinth
GitLab
额外链接
CubicChunks (Modrinth)
Cubic World Gen (Modrinth)
Iloot (Modrinth)
联系方式
联系以下内容以获取反馈和支持;可能需要好友请求,但我会接受:
Reverie#8247 (Revolt)
reverie_requiem. (Discord)
About
CubicStruct is a mod intended to implement custom structures (nbt files) into world generation, with compatibility for Cubic World Gen. For each structure, it offers settings for biome, maximum decay, placement, and more through their respective .json files. If you're creative, perhaps you'll never need another structure mod. Additionally, for a means to implement custom loot tables into said structures without creating a mod or pasting into every world, see Iloot.
Usage
Vanilla/CC Compatibility Warnings
- If using Cubic Chunks without Cubic World Gen, minX and minY settings must be adjusted, or worldgen will attempt to spawn structures by tracing from the absurd top of the world.
- While not a required dependency, this mod was developed specifically for structure compatibility with Cubic World Gen; regular worlds with or without Cubic Chunks may produce unintended effects (such as failed spawns). For ideal results without CWG, set minX and minY to structure-appropriate values.
Acquiring structure .nbt
To acquire any structure with .nbt format, simply save it using Minecraft's vanilla structure block. The new file will be found within the save's 'structures' directory, which you can then paste into the generated 'cubic_structures' folder, located in the base Minecraft directory.
Data Blocks
CubicStruct implements additional features for data blocks, which manifest on natural worldgen (unimplemented for manual loading) which are listed below (<<>> - required; <> - optional):
villager <(profession (string/int))> <(career (int))> - spawns a random villager with the given profession and career.
- Professions available are
farmer, librarian, cleric, blacksmith, butcher, and nitwit. Alternatively, use id.
spawner - generates a random monster spawner, from the dungeon pool.
block <<{blocks:[{<<id: (string)>>,<data: (int)>,<nbt: (nbt string)>}]}>> <(seed ((int))> - generates a random block from the provided list. Providing a seed allows multiple blocks within a structure to generate similarly (only the blocks themselves, not for any nbt associated). A formatting example would be block {blocks:[{id:"minecraft:gravel"},{id:"minecraft:chest",data:1,nbt:{LootTable:"iloot:chests/fish"}}]} 7.
Initializing the structure
General
The .nbt will be initialized on game/mod reload, and a new directory will be produced from it. The new directory will contain a .json which can be modified at will to alter how the structure spawns. The values are all preset, and determine spawn as follows:
- file - (default: filename, required) - the only required parameter which isn't auto-assumed (will still be auto-generated). Do not modify this unless missing, moving the .nbt into a group, or also altering the filename of whatever is being edit.
- name - (default: filename) - name for the structure.
- description - (default: "No description provided.") - brief description for the structure.
- spawnChance - (default: 1.0) - percent chance that an attempt will be made to spawn the structure within a chunk. Note that this value is relative, and may be impacted by generation failures; structures which are very likely to fail generating should be provided a higher value.
- surfaceLevel - (default: 0) - the Y level offset relative to the structure's height to begin spawning onto a surface/ceiling. When placementType is set to
surface, 0 results in spawning from the bottom of the structure, while the reverse is true of ceiling. For example, if a structure extends 8 blocks into the ground ('ground' being whatever surface/ceiling it latches onto), this should be set to -8. block and force ignore this.
- dimensions - (default: [0]) - list of all dimensions this structure can spawn in (-1 = nether, 0 = overworld, 1 = end). This feature is currently nonfunctional in CWG worlds; use biome lists instead.
- biomeWhiteList - (default: false) (conflicts with blacklist) - whether or not the structure is limited to specific biomes.
- biomeBlackList - (default: false) (conflicts with whitelist) - whether or not the structure is restricted from spawning within specific biomes.
- biomes - (default: minecraft:plains) - biomes to spawn in, if whitelist/blacklist is enabled.
- maxDecay - (default: 0) - percent value denoting the amount of possible integrity loss when spawning the structure. Higher values will increase missing blocks.
- airSpawn - (default: false) - whether or not the structure will only attempt spawning in air (as opposed to liquid). Conflicts with
liquidSpawn, and ignored by block placement type. Enable this if placement type is surface, or structure will also spawn in liquids.
- liquidSpawn - (default: false) - whether or not the structure will only attempt spawning in liquids. Conflicts with
airSpawn, and ignored by block placement type.
- rotate - (default: true) - if the structure will spawn with a random horizontal rotation.
- mirror - (default: true) - if the structure will spawn with a random horizontal mirror.
- minY - (default: -2147483648) - minimum Y to spawn the structure.
- maxY - (default: 2147483647) - maximum Y to spawn the structure.
- minXZ - (default: 0) - absolute value of minimum X OR Z coordinates, rounded by chunk.
- maxXZ - (default: 2147483647) - absolute value of maximum X OR Z coordinates, rounded by chunk.
- placementType - (default: surface) - Can either be
force, block, surface, liquidsurface, or ceiling.
force will generate the structure anywhere and everywhere blocks can be placed, adhering to other spawn rules.
block will generate the structure within the block defined in replaced.
surface will generate the structure onto a flat walkable surface. This includes underwater/liquid surfaces if airspawn is not set to true.
liquidsurface will generate the structure atop liquid, if there is air above.
ceiling will generate the structure hanging from a flat ceiling. Recommended for terrain gen where this is a common occurrence. Otherwise, the ceilings of ravines and caves are the limit.
- replaced - (default: minecraft:air) - if using
block placementType, set to modid:yourblock. The structure will spawn within said block. replaced is ignored if placementType is any value but block.
- floating - (default: false) - causes a structure with
block placementType to raytrace ten blocks below it to determine if any blocks fail to match replaced. If so, the structure will retry spawning.
- usesFillBlock - (default: false) - if the foundations of a structure would otherwise be non-solid, fill them with a block. However, for performance and to avoid endless pillars, this will not occur if the space below exceeds 20 blocks. Functions with all placementTypes, but most recommended for
surface and ceiling.
- fillBlock - (default: minecraft:dirt) - block to fill foundations, if
usesFillBlock is enabled.
- lenient - (default: false) - if true, less obstruction checks will be performed to determine valid placement. Ideal for rough terrain where spawns would otherwise fail often, but will cause significantly more collisions with surroundings. At present, only
surface, liquidsurface, and ceiling can use this.
- enabled - (default: false) - whether or not this structure will spawn. Set this to true once editing is finalized!
Groups
To minimize complexity, .jsons will not properly generate variables automatically for groups; these parameters must be added to the structure yourself, after placing all the files of a grouping in a single directory. Groups use the spawnChance of a randomly-selected origin structure to determine frequency.
The following variables are ignored for non-origin structures in groups: spawnChance, dimensions, biomes, minY, and maxY, as they are assumed from the origin, or replaced by the parameters below.
Group parameters:
To create a structure grouping, add a group.json including the following parameters:
- name (default: "Unnamed Group") - name for the group.
- origins - (default: N/A, required) - an array of what structures (nbt filenames) can act as the start point for constructing the group. At least one structure within the directory must be designated, and the active origin will not be counted for minSize and maxSize.
- maxSpreadXZ - (default: 5) how many horizontal chunks distant from the origin/start point structures can spawn.
- maxSpreadY (default: 3) - how many vertical chunks distant from the origin/start point structures can spawn.
- minSize - (default: 8) - how many structures will generate within the group, prioritizing those with a minCount, followed by those with 0 minCount and weights.
- maxSize - (default: 12) - maximum quantity of structures to generate.
- spacing - (default: 2) - minimum distance from each other structures can spawn. Perceived very crudely.
- enabled - (default: true) - whether or not the group will generate at all.
Group structure parameters
Append these variables to each structure json, otherwise they will remain default. Groups will not generate without at least one origin.
- minCount - (default:0) - how many of this structure must spawn. If greater than 0, will be prioritized over other structures regardless of weight. The active origin will always build regardless, and should remain 0 if more should not be generated. The sum of this value for all structures should not exceed
minSize in the group.json.
- maxCount - (default: 2147483647) - the maximum quantity of this structure. All origin points should set this to 0 unless more should be placed, and the sum of this value for all structures must exceed or match the maximum size designated in the
group.json. Set this to an absurd value if you wish it only to be limited by the group maximum.
- weight - (default: 1) - the priority level of this structure; higher weights increase chance of generating as opposed to other structures in the group. Ignored once max count for this structure has been attained. If something is an origin or/and should only spawn its minimum count, set this to 0.
Loading the structure
After tinkering with these file(s), reload the mod (/csreload) or game, and the structure should spawn as intended in new chunks.
Links
Modrinth
GitLab
Additional Links
CubicChunks (Modrinth)
Cubic World Gen (Modrinth)
Iloot (Modrinth)
Contact
Contact the following for feedback and support; friend request may be required, but I will accept:
Reverie#8247 (Revolt)
reverie_requiem. (Discord)
评论 0
登录后参与评分
还没有评论,来抢沙发吧