-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path09_structure_to_json_tool.html
More file actions
84 lines (84 loc) · 6.5 KB
/
09_structure_to_json_tool.html
File metadata and controls
84 lines (84 loc) · 6.5 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Structure To JSON Tool - 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: Structure To JSON Tool [Advanced]</h1>
</div>
<div class="row border border-bottom">
<p>From <a href="https://github.com/HellFirePvP/ModularMachinery/wiki/10.-Custom-Machines:-Structure-To-JSON-Tool-%5BAdvanced%5D">https://github.com/HellFirePvP/ModularMachinery/wiki/10.-Custom-Machines:-Structure-To-JSON-Tool-%5BAdvanced%5D</a> </p>
</div>
<div class="col">
<p>(Marked as "Advanced" because you should know how defining machines manually works, since post-processing after exporting it to JSON is strongly advised.)</p>
<p>Writing up the JSON for a complex machine manually is a massive time sink and even then it's littered with wrong positions or typos or other potential issues.
In order to avoid that, ModularMachinery adds the "Construct Selection Tool",
which allows a player (when opped and in creative) to select blocks with it and export them as JSON.
</p>
<p>While in hand,
you can with rightlick (or shift-rightclick to avoid rightclick-interactions with certain blocks) on blocks to add them to the current selection,
or to remove them from the selection. Once selected,
these blocks will show up with a white cube-overlay,
indicating that the position where the block is/was at, was added to your selection.
You can break the block or place another one in it in order to add something like fluid-blocks (which are normally not right-clickable of course) to the machine-selection.
</p>
<p>Once you've selected all blocks you want to add to the structure/machine,
you have to rightclick the Machine Controller to "confirm" your selection.
<span class="bold">The direction in which the controller is facing is very important! Wherever the controller faces towards will be considered the "front"-face of your machine.</span>
So be sure to have the controller face the proper direction before shift-rightclicking it with the selection too
</p>
<p>After that,
if everything works out successfully,
the machine is saved as "machine--.json" into your 'machinery' directory where the other machines are defined.
Additionally, your current selection gets purged after that to avoid double-creation or accidentally forgetting to un-select all positions.
</p>
<p>Now,
post-processing needs to be done,
as the mod only saves that 1 specific block + its found state,
serialized as metadata,
into the json file per position.
If the block at the positon had a tileentity,
its data will be serialized and saved in the 'nbt'-tag of the position it would need to be at.
Unless you want to match against certain entries in this NBT-tag,
it's advised to remove the 'nbt'-specification entirely.
Adjust the fitting elements per position appropiately to what's reasonable or appropiate for the given machine.
(For example allow for stairs that are at corners the metadata for both potential rotations that'd form corner-stairs, so users don't run into the issue that it looks 100% fine, but it has the wrong metadata!)
</p>
<p>The JSON for that exported machine also only comes with the "parts"-tag,
defining only the raw structure,
so adding a "registryname" and "localizedname" and so on is required.
</p>
</div>
</div>
</div>
</body>
</html>