-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_machine_format.html
308 lines (304 loc) · 12.8 KB
/
01_machine_format.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html>
<html>
<head>
<title>Machine Format - Modular Machinery Offline Reference</title>
<link href="./css/site.css" rel="stylesheet">
<link href="./css/colouramber.css" rel="stylesheet">
<link href="./css/font.css" rel="stylesheet">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body>
<div class="row border" id="main">
<div class="col border border-right menu">
<h2>MENU</h2>
<ul class="menu">
<li> <a href=".\index.html" class="link">\Home</a> </li>
<li><a href="./00_keynotes.html" class="link">\Important notes</a></li>
<li><a href="./01_machine_format.html" class="link">\Machine format</a></li>
<li><a href="./02_variables.html" class="link">\Variables</a></li>
<li><a href="./03_machine_recipes.html" class="link">\Recipes</a></li>
<li><a href="./04_recipe_adapters.html" class="link">\Recipe Adapters</a></li>
<li><a href="./05_nbt_checking_setting.html" class="link">\NBT Checking & Setting</a></li>
<li><a href="./06_recipe_sorting.html" class="link">\Recipe Sorting</a></li>
<li><a href="./07_machine_format_postition_permutations.html" class="link">\Machine Format Position Permutations</a></li>
<li><a href="./08_machine_colors.html" class="link">\Machine Colors</a></li>
<li><a href="./09_structure_to_json_tool.html" class="link">\Structure To JSON Tool [Advanced]</a></li>
<li><a href="./010_furnace_fuel_as_item_input.html" class="link">\Furnace Fuel as Item-Input</a></li>
<li><a href="./011_craftweaker_recipe_definitions.html" class="link">\Crafttweaker Recipe definitions</a></li>
<li><a href="./012_recipe_modifiers.html" class="link">\Recipe Modifiers</a></li>
<li><a href="./100_ct_modular_machinery.html" class="link">\CT Modular Machinery</a></li>
<li><a href="./101_ct_recipebuilder.html" class="link">\CT Recipe Builder</a></li>
<li><a href="./102_ct_recipeprimer.html" class="link">\CT Recipe Primer</a></li>
</ul>
</div>
<div class="col">
<div class="col">
<h1 class="border border-bottom">Custom Machines: Machine format</h1>
</div>
<div class="row border border-bottom">
<p> From <a href="https://github.com/HellFirePvP/ModularMachinery/wiki/2.-Custom-Machines:-Machine-format">https://github.com/HellFirePvP/ModularMachinery/wiki/2.-Custom-Machines:-Machine-format</a> </p>
</div>
<div class="col">
<p>Machine jsons (and variable jsons for them) have to be in the /config/modularmachinery/machinery/ folder.</p>
<p>The format for defining a machine in json is as follows:</p>
<div class="code">
<pre class="code">
{
"registryname": "yourmachinesregistryname", //HAS to be unique.
"localizedname": "however your machine is called when displaying its name", //Only used for display
"requires-blueprint": true, //Set to true to make the machine require the blueprint for it in the controller's gui in order to function at all.
"color": "FF4900", //Optional, hex color (without alpha) the casings of the structure will take on once the structure is assembled correctly
"parts": [ //Array of position + applicable blockstates
{
"x": 1, //The position, relative to (0, 0, 0) where the controller-block is
"y": 1, //Not defining x, y or z means the offset is 0
"z": 1,
"elements": [ //Array of possible blockstates
//Define specific blockstates with metadata by
//appending @<metadata> after the block's registry name
"minecraft:stone@1"
]
},
{
"y" 2,
//instead of an array, you can also specify only 1 blockstate if only 1 is applicable
//you can also define a variable here instead of an individual blockstate(s) (next chapter of the wiki)
"elements": "minecraft:stone@2"
}
]
}</pre>
</div>
<p>As an example for a proper machine definition, let's write up a JSON file for a centrifuge. The centrifuge should:</p>
<ul style="list-style: none;">
<li>Take in up 1 item and produce up to 4 items out of it and potentially a fluid.</li>
<li>It should only generate those outputs with a certain chance. (example: Let's say output-item 1 only with 50% chance, output 2 only with 25% chance and output 3 and 4 only with 10%)</li>
<li>Need a certain amount of RF per processing-tick</li>
</ul>
<p>So what do we need for our machine? At least 1 available position for an input bus, At least 1 available position for an output bus, 1 available position for a output hatch and at least 1 position for an energy hatch. Along with that, we need a registry name for it (so the mod can identify it later) and we need a localized name (so it has a name the mod can display to the player).</p>
<p>From the absolutely necessary parts now to the 'optional' parts: The actual looks of the centrifuge and what blocks we want the player to place where in order to make it work. Let's say for this example we want to make a 3x3x3 sized machine. The bottom 3x3 layer will all be machine casings from Modular Machinery itself, which can either be machine casings OR input bus OR output bus OR output hatch OR energy hatch. The middle 3x3 layer should be iron bars in all corners, water in the center, iron blocks on the edge-sides and on one of these edge sides, we'll want the user to place the controller; so the controller will later be the 0, 0, 0 "center" of our machine and we'll design the other blocks around that block. The uppermost 3x3 layer will be again iron bars on all corners, iron blocks on the 4 edges and a glass block in the center.</p>
<p>Alright, now we got a solid idea of what our machine will look like: Bottom layer should be all kinds of input, output, energy buses/hatches or just machine casings however the player wants to arrange those, the middle layer and upper layer will be some sort of iron block funnel with iron bars reinforcing it, water as actual centrifuge solvent and glass above it so it doesn't splash out. The controller as central piece will be embedded in the middle layer instead of one of the iron blocks.</p>
<p>Additionally, you want to define your machine in positive Z direction since the controller is facing to negative Z. Rotate it and it'll look odd in preview and the controller will rotate oddly...</p>
<p>From that now we write down the JSON for the machine: (Warning, might be long)</p>
<div class="code">
<pre class="code">{
"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"
]
}
]
}</pre>
</div>
</div>
</div>
</div>
</body>
</html>