概述
这是一个让你可以投掷染料(dyes)的模组!
将染料投掷到具有颜色变体的方块上(例如混凝土),会将该方块染成你所投掷染料的颜色。这适用于所有原版方块。
它同样支持模组添加的方块,但有一些例外情况需要手动添加到配置文件中。
配置文件
技术概述
这个模组的工作原理是:当投掷出的染料击中一个方块时,它会获取该方块的 ID。
然后它会检查方块 ID 是否以某种染料颜色开头或结尾。如果是,它会将方块 ID 中的颜色替换为所投掷染料的颜色。
如果在方块 ID 中未找到颜色,它会尝试将所投掷染料的颜色追加到方块 ID 的开头。
最后,如果上述方法失败,则会回退到配置文件,并检查是否有对应默认方块的彩色方块变体映射。
向配置中添加内容
在某些方块无法正常工作的情况下,你可以将它们添加到配置文件中。
配置文件名为 throwabledye.json。其语法如下:
"somemod:block_id": "{color}_block_id"
一个有效的示例如下:
"minecraft:glass": "{color}_stained_glass"
有些方块具有基础(未染色)变体,例如玻璃或陶瓦。与陶瓦不同,染色玻璃并不保持相同的 颜色 + 方块ID 格式,它多了一个单词 "stained",而基础变体中并没有引用这个词,因此需要将基础变体映射到彩色变体。
具体做法是将基础方块 ID 作为键,然后将彩色方块 ID 作为值,并在其中颜色名称的位置放入 {color}。这样模组就可以将 {color} 替换为实际投掷染料的颜色。
Overview
This is a mod that allows you to throw dyes!
Throwing it at a block with a colored variant (eg. concrete) will dye the block the color of the dye you threw. This should work with every vanilla block.
This will also work with modded blocks, however, there are some exceptions which will need to be added to the config manually.
Config
Technical Overview
The way this mod works is when the thrown dye hits a block, it will get the block's id.
Then it will check if the block id starts or ends with a dye color. If it does, it will replace the color in the block id, with the thrown dye color.
If a color is not found in the block id, the it will try appending the thrown dye color to the beginning of the block id.
Finally, if that fails, it will fall back to the config file, and check if there is a colored block variant mapped to the default block.
Adding to the config
On the event that a some blocks do not work, you can add it into the config.
The config is called throwabledye.json. The syntax is as follows:
"somemod:block_id": "{color}_block_id"
A working example of this would be:
"minecraft:glass": "{color}_stained_glass"
Some blocks have a base, or un-dyed, variant, such as glass or terracotta. Unlike terracotta, dyed glass does not keep the same color + blockid format, it has an extra word, "stained", which is not referenced in the base variant, so the base variant needs to be mapped to the colored variant.
This is done by making the base block id the key. Then taking the colored block id, putting {color} where the color name would be, and making it the value. Then the mod can replace {color} with the thrown dye color.
评论 0
登录后参与评分
还没有评论,来抢沙发吧