Blopedit
在使用 Blopedit 之前,强烈建议备份你的光影的 block.properties 文件。虽然 Blopedit 旨在简化整合模组方块与光影的流程,但在编辑过程中仍可能出现不可预见的问题或用户失误。
Blopedit 是一个小型的 Fabric 客户端模组,用于辅助编辑光影中的 block.properties 文件,提供命令功能并利用你自己的视角(摄像机)。
此模组特别适用于高效地将模组方块与利用物理渲染 (PBR) 技术来呈现独特视觉属性(如动画树叶或发光矿石)的光影进行整合。
block.properties 文件
block.properties 文件被光影用于为不同的方块分配各种视觉属性。它位于 /.minecraft/shaderpacks/myShader.zip/shaders/block.properties。文件中的每个方块条目被称为“属性条目”,出现在定义方块类型的方块 ID 键旁边。
一个属性条目是唯一的,除非对应不同的 Minecraft 版本,否则在文件中只能出现一次。
一个属性条目由以下部分组成:
- 标识符 命名空间,表示方块的来源(例如,原版方块使用
minecraft,模组方块使用模组的 modID,如 farmersdelight)。
- 标识符 路径,表示实际的方块名称(例如
farmland)。
- 可选的 方块状态属性 列表,其中每个属性由名称、等号和属性值组成。
这些元素按上述顺序以冒号 : 分隔。一个示例属性条目为 minecraft:farmland:moisture=3。
使用方法
Blopedit 编辑 Iris 当前加载的光影的 block.properties 文件。它允许你通过指定“目标条目”来添加新的条目(称为“源条目”),从而告诉光影应如何处理该源条目。
源条目将被添加到目标条目所在的位置。
/blopedit addToPropertiesFile <blockStateArgument>:注视某个方块(作为源条目)时运行此命令,并将方块状态参数作为目标条目。
/blopedit addToPropertiesFile <blockStateArgument> matchingCondition <stringArgument>:一个可选参数,用于确定 Blopedit 如何匹配源条目和目标条目与 block.properties 文件中的条目,从而影响源条目的添加位置。
blopedit addToPropertiesFile <blockStateArgument> matchingCondition <stringArgument> moveSourceIfFound <booleanArgument>:另一个可选参数,用于确定是否应删除并移动 block.properties 文件中匹配到的源条目至新的目标条目。如果未启用此选项,则添加源条目的操作将失败并显示警告。
匹配条件
Blopedit 提供四种选项来确定匹配行为:
- Match Identifiers(仅匹配标识符):仅使用标识符匹配源条目和目标条目,忽略方块状态属性。
- Match with Properties(匹配属性):同时使用标识符和属性匹配条目。输入条目必须包含匹配的属性和值。
- Match with Properties Source(源条目匹配属性):匹配源条目的属性,但仅通过标识符匹配目标条目。
- Match with Properties Destination(目标条目匹配属性):匹配目标条目的属性,但仅通过标识符匹配源条目。
添加属性
仅当满足以下条件时,才会将源条目添加到目标条目中:
- 只有一个匹配的目标条目。
- 没有文件条目匹配源条目,或者启用了“找到时移动源条目”选项。
如果成功,源条目将被添加到所有找到匹配目标条目的行中。如果启用了“找到时移动源条目”选项,它还会删除匹配的条目,并在找到匹配目标条目的位置重新插入它们。生成的源条目仅包含已存在的匹配条目中所具有的属性。
额外功能
其他实用命令包括:
/blopedit settings doAutoReloadShaders <booleanArgument>:配置是否在 block.properties 编辑操作成功后自动重新加载光影。
/blopedit copyPropertiesFileToFolder:将当前光影的 block.properties 文件复制到 /.minecraft/blopedit/shaderPackName/block.properties,便于共享和调试。
支持
如需报告错误或提出建议,请使用模组的 问题追踪器 或加入 Discord 服务器。
鸣谢
- 感谢 @spaceagle17 提出了本模组的创意构想。特别感谢 Complementary Shaders 社区提供的杰出支持!
Blopedit
Before using Blopedit, it is strongly recommended to create a backup of the block.properties file of your shaders. While Blopedit is designed to streamline the process of integrating modded blocks with shaders, unforeseen issues or user mistakes may occur during the editing process.
Blopedit is a small Fabric client-side mod that facilitates the editing of the block.properties file in shaders, offering commands and utilizing your own camera.
This mod is particularly useful for efficiently integrating modded blocks with shaders that leverage Physically Based Rendering (PBR) for distinct visual properties, such as animated leaves or glowing ores.
The block.properties File
The block.properties file is utilized by shaders to assign various visual properties to different blocks. It can be found in /.minecraft/shaderpacks/myShader.zip/shaders/block.properties. Each block in the file is known as a "property entry," appearing next to block ID keys that define the block type.
A property entry is unique and can only appear once in the file unless it corresponds to different Minecraft versions.
A property entry comprises a block identifier, consisting of:
- An identifier namespace, representing the block's origin (e.g.,
minecraft for vanilla blocks or the mod's modID for modded blocks, such as farmersdelight).
- An identifier path, indicating the actual block name (e.g.,
farmland).
- An optional list of block state properties, where each property consists of a name followed by an equals sign and the property value.
These elements are separated by a colon : in the mentioned order. An example property entry is minecraft:farmland:moisture=3.
How to Use
Blopedit edits the block.properties file of the currently loaded shader on Iris. It allows you to add new entries, referred to as "source entries," by using a "destination entry" that specifies how the shader should treat the source entry.
The source entry is added where the destination entry is.
/blopedit addToPropertiesFile <blockStateArgument>: Run this command while looking at a block (treated as the source entry), with the block state argument as the destination entry.
/blopedit addToPropertiesFile <blockStateArgument> matchingCondition <stringArgument>: An optional argument determining how Blopedit should match source and destination entries with those in the block.properties file, affecting where the source entry is added.
blopedit addToPropertiesFile <blockStateArgument> matchingCondition <stringArgument> moveSourceIfFound <booleanArgument>: Another optional argument determining whether matching entries in the block.properties file should be deleted and moved to the new destination entry. If not, the addition of the source entry fails, showing a warning.
Matching Conditions
Blopedit offers four options to determine matching behavior:
- Match Identifiers: Matches source and destination entries using only their identifiers, ignoring block state properties.
- Match with Properties: Matches entries using both identifiers and properties. The input entry must contain matching properties and values.
- Match with Properties Source: Matches source entry properties, but only matches destination entry by identifiers.
- Match with Properties Destination: Matches destination entry properties, but only matches source entry by identifiers.
Adding Properties
The addition of a source entry to a destination entry occurs only if:
- There is only one matching destination entry.
- There are no file entries matching the source entry, or the option to move the source if found is enabled.
If successful, the source entry is added to all lines where a matching destination entry was found. If moving the source if found is enabled, it also deletes matched entries and reinserts them where matching destination entries were found. The resulting source entry includes only properties present in the matched already present entries.
Extra Features
Additional utility commands include:
/blopedit settings doAutoReloadShaders <booleanArgument>: Configures whether the shader should automatically reload after a successful block.properties edit operation.
/blopedit copyPropertiesFileToFolder: Copies the block.properties file of the current shader to /.minecraft/blopedit/shaderPackName/block.properties, simplifying sharing and debugging.
Support
To report bugs or make suggestions, use the mod's issue tracker or join the Discord server.
Credit
- Thanks to @spaceagle17 for suggesting the idea for this mod. Special thanks to the Complementary Shaders community for their outstanding support!
评论 0
登录后参与评分
还没有评论,来抢沙发吧