Skip to content

Commit 1664824

Browse files
committed
Migration guide for rename
1 parent ed9b5f7 commit 1664824

File tree

2 files changed

+114
-31
lines changed

2 files changed

+114
-31
lines changed

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ or search it on the Mod Browser with its name, `MultiCrafter Lib`.
4040
*Injection makes your mod an actual Java mod, so it must fit the structure of Java mod.*
4141

4242
##### Step 1
43-
You should download a zip, named `MultiCrafter-injection.zip`, in [here](https://github.com/liplum/MultiCrafterLib/releases/latest).
43+
You will have to download a zip, named `MultiCrafter-injection.zip`, in [here](https://github.com/liplum/MultiCrafterLib/releases/latest).
4444

4545
##### Step 2
46-
Then unzip it and copy the its contents into the root directory of your mod.
46+
Unzip the downloaded zip and copy its contents into the root directory of your mod.
4747

4848
<details>
4949
<summary>

docs/migration.md

Lines changed: 112 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,119 @@ This is a guide to help users migrate from the `v1.y.z` to `v2.y.z`.
44
???+ info
55
The `v2.y.z` is not yet officially out and is still in the devlopment phase!
66

7+
## Library rename
8+
9+
The biggest change of all, the rename of the library from `MultiCrater Lib` to `omnicrafter`.
10+
11+
=== "Dependency"
12+
You will have to update your `mod.json` and change the name of the dependency.
13+
14+
```diff
15+
- "dependencies": ["multi-crafter"]
16+
+ "dependencies": ["omnicrafter"]
17+
```
18+
19+
=== "Injection"
20+
???+ info inline end
21+
This repo doesn't exist because the rename didn't occured yet!
22+
##### Step 1
23+
You will have to download a zip, named `omnicrafter-injection.zip`, in [here](https://github.com/liplum/omnicrafter/releases/latest).
24+
25+
##### Step 2
26+
Unzip the downloaded zip and copy its contents into the root directory of your mod.
27+
28+
<details>
29+
<summary>
30+
Unzip will add essential files into the root directory.
31+
<br>
32+
Please pay attention to your structure and avoid secondary directory in your mod zip.
33+
</summary>
34+
Suppose your have this structure:
35+
36+
- Before unzip:
37+
```
38+
your-mod/
39+
├─ content/
40+
| ├─ crafter.hjson
41+
├─ mod.hjson
42+
├─ icon.png
43+
```
44+
45+
- After unzip:
46+
```
47+
your-mod/
48+
├─ multicrafter/
49+
├─ scripts/
50+
| ├─ multi-crafter/
51+
| | ├─ lib.js
52+
├─ content/
53+
| ├─ crafter.hjson
54+
├─ mod.hjson
55+
├─ icon.png
56+
├─ classes.dex
57+
```
58+
59+
MultiCrafter injection doesn't work when you zip your mod folder in a wrong way
60+
where have created a secondary directory.
61+
62+
Suppose you had a mod zip, named `your-mod.zip`.
63+
64+
- This will work.
65+
In your-mod.zip, there are...
66+
```
67+
multicrafter/
68+
scripts/
69+
content/
70+
mod.hjson
71+
icon.png
72+
```
73+
74+
- But this will not.
75+
In your-mod.zip, there are...
76+
```
77+
your-mod/
78+
├─ multicrafter/
79+
├─ scripts/
80+
├─ content/
81+
├─ mod.hjson
82+
├─ icon.png
83+
```
84+
85+
If you're using `ZArchiver` app, you could multi-select the each file inside your mod folder
86+
and zip them all into one.
87+
</details>
88+
89+
##### Step 3
90+
Then modify this line in your `mod.[h]json`:
91+
92+
```diff
93+
- "main": "MultiCrafterAdapter"
94+
+ "main": "OmnicrafterAdapter"
95+
```
96+
97+
=== "Jitpack (Java)"
98+
You will have to update your `build.gradle(.kts)` and change the name of the library.
99+
100+
=== "Groovy"
101+
```diff
102+
dependencies {
103+
- implementation 'com.github.liplum:MultiCrafterLib:<version>'
104+
+ implementation 'com.github.liplum:omnicrafter:<version>'
105+
}
106+
```
107+
=== "Kotlin"
108+
```diff
109+
dependencies {
110+
- implementation("com.github.liplum:MultiCrafterLib:<version>")
111+
+ implementation("com.github.liplum:omnicrafter:<version>")
112+
}
113+
```
114+
7115
## Nullary Constructor (Java)
8116

9117
The class `Recipe` and `IOEntry` now use nullary constructor.
10118

11-
??? example "Example: Before"
119+
???+ example "Example: Before"
12120
```java
13121
new Recipe(
14122
new IOEntry(
@@ -25,7 +133,7 @@ The class `Recipe` and `IOEntry` now use nullary constructor.
25133
120f
26134
)
27135
```
28-
??? example "Example: After"
136+
???+ example "Example: After"
29137
```java
30138
new Recipe() {{
31139
input = new IOEntry() {{
@@ -46,7 +154,7 @@ The class `Recipe` and `IOEntry` now use nullary constructor.
46154

47155
Instead of using `Seq<Stack[]>` we now simply use `Stack[]`. It only impacts the variables in the `IOEntry` class (`items`, `fluids` and `payloads`).
48156

49-
??? example "Example: Before"
157+
???+ example "Example: Before"
50158
```java
51159
input = new IOEntry() {{
52160
items = Seq.with(
@@ -59,7 +167,7 @@ Instead of using `Seq<Stack[]>` we now simply use `Stack[]`. It only impacts the
59167
);
60168
}};
61169
```
62-
??? example "Example: After"
170+
???+ example "Example: After"
63171
```java
64172
input = new IOEntry() {{
65173
items = ItemStack.with(Items.copper, 1);
@@ -68,28 +176,3 @@ Instead of using `Seq<Stack[]>` we now simply use `Stack[]`. It only impacts the
68176
liquids = LiquidStack.with(Liquids.water, 1f);
69177
}};
70178
```
71-
72-
73-
<!-- === "Dependency"
74-
=== "JSON"
75-
yes
76-
77-
=== "JavaScript"
78-
h
79-
80-
=== "Java"
81-
i
82-
83-
=== "Injection"
84-
=== "JSON"
85-
yes
86-
87-
=== "JavaScript"
88-
h
89-
90-
=== "Java"
91-
i
92-
93-
=== "Jitpack"
94-
???+ info
95-
This is Java only! -->

0 commit comments

Comments
 (0)