MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针。
如果在编辑的过程中遇到了什么问题,可以去讨论板提问。
为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证。
MCBBS Wiki GitHub群组已上线!
您可以在回声洞中发表吐槽!
服务器状态监控。点击进入
本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>
ModularMachinery Wiki(ZH)/机械文件格式:修订间差异
(建立内容为“机械的jsons(和变量jsons)必须保存在 /config/modularmachinery/machinery/ 文件夹下。 在json文件中定义一个机械的格式如下: <synta…”的新页面) |
小 (add) |
||
第41行: | 第41行: | ||
另外,你要在正 Z 轴方向上定义你的机械,因为控制器的朝向是负 Z 轴。转动它,它会在预览中变得很奇怪,控制器也会奇怪地旋转起来... |
另外,你要在正 Z 轴方向上定义你的机械,因为控制器的朝向是负 Z 轴。转动它,它会在预览中变得很奇怪,控制器也会奇怪地旋转起来... |
||
我们现在开始为机械写JSON文件:(警告,可能会比较长) |
我们现在开始为机械写JSON文件:(警告,可能会比较长) |
||
<syntaxhighlight lang="JSON"> |
|||
{ |
|||
"registryname": "centrifuge", |
|||
"localizedname": "Iron Reinforced Centrifuge", |
|||
"parts": [ |
|||
{ |
|||
"x": 0, |
|||
"y": 1, |
|||
"z": 2, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": 1, |
|||
"z": 0, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": 1, |
|||
"z": 1, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": 1, |
|||
"z": 1, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": 1, |
|||
"z": 2, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": 1, |
|||
"z": 2, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": 1, |
|||
"z": 0, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": 1, |
|||
"z": 0, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": 1, |
|||
"z": 1, |
|||
"elements": "minecraft:glass" |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": 0, |
|||
"z": 2, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": 0, |
|||
"z": 1, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": 0, |
|||
"z": 1, |
|||
"elements": "minecraft:iron_block" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": 0, |
|||
"z": 2, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": 0, |
|||
"z": 2, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": 0, |
|||
"z": 0, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": 0, |
|||
"z": 0, |
|||
"elements": "minecraft:iron_bars" |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": 0, |
|||
"z": 1, |
|||
"elements": "minecraft:water" |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": -1, |
|||
"z": 2, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": -1, |
|||
"z": 2, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": -1, |
|||
"z": 2, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": -1, |
|||
"z": 1, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": -1, |
|||
"z": 1, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": -1, |
|||
"z": 1, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": 1, |
|||
"y": -1, |
|||
"z": 0, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": 0, |
|||
"y": -1, |
|||
"z": 0, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
}, |
|||
{ |
|||
"x": -1, |
|||
"y": -1, |
|||
"z": 0, |
|||
"elements": [ |
|||
"modularmachinery:blockcasing", |
|||
"modularmachinery:blockinputitem", |
|||
"modularmachinery:blockinputenergy", |
|||
"modularmachinery:blockoutputitem", |
|||
"modularmachinery:blockoutputfluid" |
|||
] |
|||
} |
|||
] |
|||
} |
|||
</syntaxhighlight> |
|||
Tr:[https://www.mcbbs.net/?2649433 垠儿] |
Tr:[https://www.mcbbs.net/?2649433 垠儿] |
2021年7月25日 (日) 14:15的版本
机械的jsons(和变量jsons)必须保存在 /config/modularmachinery/machinery/ 文件夹下。
在json文件中定义一个机械的格式如下:
{
"registryname": "yourmachinesregistryname", //必须是独一无二的.
"localizedname": "however your machine is called when displaying its name", //只是用来显示
"requires-blueprint": true, //设为true使机器需要蓝图才能运行.
"color": "FF4900", //可选选项,当机械搭建成功后会将外壳更改为你设置的16进制颜色(不透明)
"parts": [ //位置和应用的方块的数组
{
"x": 1, //此坐标相对于控制器的坐标(0,0,0)
"y": 1, //不定义x,y,z表示偏移量为0
"z": 1,
"elements": [ //可能的方块状态数组
//在方块的注册名称后添加@<metadata>来定义带有元数据的特定方块的状态。
"minecraft:stone@1"
]
},
{
"y" 2,
//它也可以不是一个数组你也可以只设置一个方块状态
//你也可以使用来代替方块状态
"elements": "minecraft:stone@2"
}
]
}
机械的jsons(和变量jsons)必须保存在 /config/modularmachinery/machinery/ 文件夹下。
举一个正确定义机械的例子,让我们为离心机写一个JSON文件。离心机应该这样写:
- 输入 1 物品,并产出最多 4 物品,也可能产出流体。
- 它应该有一定几率才会输出物品。(举例,输出1件物品只有50%的几率,输出2件物品只有25%的几率,输出3件和4件物品只有10%的几率)
- 机械在处理时,每tick都需要一定量的RF
那我们需要为机械做什么呢?输入总线至少要有 1 个可用位置,输出总线至少要有 1 个可用位置,输出仓至少要有 1 个可用位置,而能源仓至少也要有 1 个位置。有了这些,我们还需要给它注册一个名称(这样mod以后就可以识别它了)并且我们需要一个本地化的名称(这样它就有一个可以让mod显示给玩家的名称) 从绝对需要的部分到‘可选’的部分:离心机的实际外观,我们想让玩家在哪里放置什么方块来让它工作。比如说这个例子,我们想制作一个3x3大小的机械。最底层3x3的位置得全是模块化机械自己的机械外壳,这可以是机械外壳 或 输入总线 或 输出总线 或 输出仓 或 能源仓。中层3x3的位置,所有角落应该放铁栏杆,水在中间,铁块在边边上,在其中一个边上,我们想让使用者放置控制器;控制器之后会成为相当于我们机械中的原点0,0,0“中心”,我们会围绕该方块放置其他方块。最上层3x3的位置再在所有角落放置铁栏杆,在 4 个边上放置铁块,在中间放置玻璃。 好了,现在我们对我们的机械长什么样子有了明确的概念:最底层应该是各种输入、输出、能源总线/仓,或只是机械外壳,不管玩家想怎样排列那些方块,中层和最上层都是用一些铁块组成漏斗的形状,用铁栏杆加固,水作为实际的离心机溶剂,上面有玻璃,这样水就不会溅出来。作为中心部件的控制器将会被嵌入中层,替换掉原来的一个铁块。 另外,你要在正 Z 轴方向上定义你的机械,因为控制器的朝向是负 Z 轴。转动它,它会在预览中变得很奇怪,控制器也会奇怪地旋转起来... 我们现在开始为机械写JSON文件:(警告,可能会比较长)
{
"registryname": "centrifuge",
"localizedname": "Iron Reinforced Centrifuge",
"parts": [
{
"x": 0,
"y": 1,
"z": 2,
"elements": "minecraft:iron_block"
},
{
"x": 0,
"y": 1,
"z": 0,
"elements": "minecraft:iron_block"
},
{
"x": -1,
"y": 1,
"z": 1,
"elements": "minecraft:iron_block"
},
{
"x": 1,
"y": 1,
"z": 1,
"elements": "minecraft:iron_block"
},
{
"x": 1,
"y": 1,
"z": 2,
"elements": "minecraft:iron_bars"
},
{
"x": -1,
"y": 1,
"z": 2,
"elements": "minecraft:iron_bars"
},
{
"x": 1,
"y": 1,
"z": 0,
"elements": "minecraft:iron_bars"
},
{
"x": -1,
"y": 1,
"z": 0,
"elements": "minecraft:iron_bars"
},
{
"x": 0,
"y": 1,
"z": 1,
"elements": "minecraft:glass"
},
{
"x": 0,
"y": 0,
"z": 2,
"elements": "minecraft:iron_block"
},
{
"x": -1,
"y": 0,
"z": 1,
"elements": "minecraft:iron_block"
},
{
"x": 1,
"y": 0,
"z": 1,
"elements": "minecraft:iron_block"
},
{
"x": 1,
"y": 0,
"z": 2,
"elements": "minecraft:iron_bars"
},
{
"x": -1,
"y": 0,
"z": 2,
"elements": "minecraft:iron_bars"
},
{
"x": 1,
"y": 0,
"z": 0,
"elements": "minecraft:iron_bars"
},
{
"x": -1,
"y": 0,
"z": 0,
"elements": "minecraft:iron_bars"
},
{
"x": 0,
"y": 0,
"z": 1,
"elements": "minecraft:water"
},
{
"x": 1,
"y": -1,
"z": 2,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": 0,
"y": -1,
"z": 2,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": -1,
"y": -1,
"z": 2,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": 1,
"y": -1,
"z": 1,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": 0,
"y": -1,
"z": 1,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": -1,
"y": -1,
"z": 1,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": 1,
"y": -1,
"z": 0,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": 0,
"y": -1,
"z": 0,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
},
{
"x": -1,
"y": -1,
"z": 0,
"elements": [
"modularmachinery:blockcasing",
"modularmachinery:blockinputitem",
"modularmachinery:blockinputenergy",
"modularmachinery:blockoutputitem",
"modularmachinery:blockoutputfluid"
]
}
]
}
Tr:垠儿