Skip to content

Commit 5fb3f01

Browse files
committed
Full support the installation of forge-1.16.5-36.1.66+ and partial support forge-1.17.1
1 parent 3aeeada commit 5fb3f01

File tree

23 files changed

+458
-82
lines changed

23 files changed

+458
-82
lines changed

.github/workflows/build.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: windows-latest
11+
runs-on: ubuntu-latest
1212

1313
steps:
1414
- uses: actions/checkout@v2
@@ -18,7 +18,9 @@ jobs:
1818
java-version: '8.0.302'
1919
architecture: x64
2020
- name: Build with Gradle
21-
run: ./gradlew.bat build -iS
21+
run: |
22+
chmod +x ./gradlew
23+
./gradlew build -iS
2224
- uses: actions/upload-artifact@v2
2325
with:
2426
name: Package

.github/workflows/maven.bat

-13
This file was deleted.

.github/workflows/publication.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
build:
10-
runs-on: windows-latest
10+
runs-on: ubuntu-latest
1111

1212
steps:
1313
- uses: actions/checkout@v2
@@ -19,7 +19,9 @@ jobs:
1919
- name: Build with Gradle
2020
env:
2121
IS_PUBLICATION: true
22-
run: ./gradlew.bat publish -iS
22+
run: |
23+
chmod +x ./gradlew
24+
./gradlew publish -iS
2325
- uses: actions/upload-artifact@v2
2426
with:
2527
name: Package
@@ -49,6 +51,7 @@ jobs:
4951
with:
5052
asset_paths: '["./build/libs/*"]'
5153
- name: Upload to Maven
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
run: ./.github/workflows/maven.bat
54+
uses: JamesIves/[email protected]
55+
with:
56+
branch: maven
57+
folder: build/maven

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ bin
1212
*.iml
1313
*.ipr
1414
*.iws
15-
out
15+
out

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Allow [MultiMC](https://github.com/MultiMC/MultiMC5) to launch Minecraft 1.13+ w
1616

1717
1. Download Forge installer for Minecraft 1.13+ [here](https://files.minecraftforge.net/).
1818
2. Download ForgeWrapper jar file at the [release](https://github.com/ZekerZhayard/ForgeWrapper/releases) page.
19+
3. Since ForgeWrapper 1.5.1, it no longer includes the json converter, so you need to build it by yourself:
20+
- [Download](https://github.com/ZekerZhayard/ForgeWrapper/archive/refs/heads/master.zip) ForgeWrapper sources.
21+
- Extract the zip and open terminal in the extracted folder.
22+
- Run `./gradlew build` command in terminal and get the jar from `./converter/build/libs`
1923
3. Run the below command in terminal:
2024
```
2125
java -jar <ForgeWrapper.jar> --installer=<forge-installer.jar> [--instance=<instance-path>]

build.gradle

+14-24
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ plugins {
66
}
77

88
sourceCompatibility = targetCompatibility = 1.8
9+
compileJava {
10+
sourceCompatibility = targetCompatibility = 1.8
11+
}
912

1013
version = "${fw_version}${-> getVersionSuffix()}"
1114
group = "io.github.zekerzhayard"
@@ -15,6 +18,9 @@ configurations {
1518
provided {
1619
compileOnly.extendsFrom provided
1720
}
21+
multirelase {
22+
compileOnly.extendsFrom multirelase
23+
}
1824
}
1925

2026
repositories {
@@ -26,12 +32,13 @@ repositories {
2632
}
2733

2834
dependencies {
29-
compileOnly "com.google.code.gson:gson:2.8.7"
35+
compileOnly "com.google.code.gson:gson:2.8.5"
3036
compileOnly "cpw.mods:modlauncher:8.0.9"
3137
compileOnly "net.minecraftforge:installer:2.1.4"
3238
compileOnly "net.sf.jopt-simple:jopt-simple:5.0.4"
3339

3440
provided project(":legacy")
41+
multirelase project(":jigsaw")
3542
}
3643

3744
java {
@@ -48,37 +55,20 @@ jar {
4855
"Implementation-Vendor" :"ZekerZhayard",
4956
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
5057
"Automatic-Module-Name": "${project.group}.${project.archivesBaseName}".toString().toLowerCase(),
58+
"Multi-Release": "true",
5159
"Main-Class": "io.github.zekerzhayard.forgewrapper.converter.Main",
5260
"GitCommit": String.valueOf(System.getenv("GITHUB_SHA"))
5361
])
5462

5563
from configurations.provided.files.collect {
5664
zipTree(it)
5765
}
58-
}
5966

60-
/*task sourcesJar(type: Jar) {
61-
manifest {
62-
attributes(jar.manifest.attributes)
63-
}
64-
from sourceSets.main.allSource
65-
archiveFileName = "${archivesBaseName}-${archiveVersion.get()}-sources.${archiveExtension.get()}"
66-
}
67-
68-
artifacts {
69-
archives sourcesJar
70-
}*/
71-
72-
processResources {
73-
inputs.property "version", project.version
74-
from(sourceSets.main.resources.srcDirs) {
75-
duplicatesStrategy = DuplicatesStrategy.INCLUDE
76-
include "patches/net.minecraftforge.json"
77-
expand "version": project.version
78-
}
79-
from(sourceSets.main.resources.srcDirs) {
80-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
81-
exclude "patches/net.minecraftforge.json"
67+
into "META-INF/versions/9", {
68+
from configurations.multirelase.files.collect {
69+
zipTree(it)
70+
}
71+
exclude "META-INF/**"
8272
}
8373
}
8474

converter/build.gradle

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
plugins {
3+
id "java"
4+
id "eclipse"
5+
}
6+
7+
version = "${rootProject.fw_version}${-> getVersionSuffix()}"
8+
group = "io.github.zekerzhayard"
9+
archivesBaseName = rootProject.name + "Converter"
10+
11+
configurations {
12+
provided {
13+
compileOnly.extendsFrom provided
14+
}
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
}
20+
21+
dependencies {
22+
compileOnly "com.google.code.gson:gson:2.8.5"
23+
provided rootProject
24+
}
25+
26+
jar {
27+
manifest.attributes rootProject.jar.manifest.attributes
28+
manifest.attributes([
29+
"Main-Class": "io.github.zekerzhayard.forgewrapper.converter.Main"
30+
])
31+
32+
from configurations.provided.files.collect {
33+
zipTree(it)
34+
}
35+
}
36+
37+
processResources {
38+
inputs.property "version", project.version
39+
from(sourceSets.main.resources.srcDirs) {
40+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
41+
include "patches/net.minecraftforge.json"
42+
expand "version": project.version
43+
}
44+
from(sourceSets.main.resources.srcDirs) {
45+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
46+
exclude "patches/net.minecraftforge.json"
47+
}
48+
}

src/main/java/io/github/zekerzhayard/forgewrapper/converter/Converter.java converter/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Converter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ private static JsonObject convertPatchesJson(JsonObject installer, JsonObject in
120120
}
121121
Map<String, String> additionalUrls = new HashMap<>();
122122
String path = String.format("net/minecraftforge/forge/%s-%s/forge-%s-%s", mcVersion, forgeVersion, mcVersion, forgeVersion);
123-
additionalUrls.put(path + "-universal.jar", "https://files.minecraftforge.net/maven/" + path + "-universal.jar");
123+
additionalUrls.put(path + "-universal.jar", "https://maven.minecraftforge.net/" + path + "-universal.jar");
124124
transformLibraries(getElement(installProfile, "libraries").getAsJsonArray(), mavenFiles, additionalUrls);
125125
additionalUrls.clear();
126-
additionalUrls.put(path + ".jar", "https://files.minecraftforge.net/maven/" + path + "-launcher.jar");
127-
transformLibraries(getElement(installer ,"libraries").getAsJsonArray(), libraries, additionalUrls);
126+
additionalUrls.put(path + ".jar", "https://maven.minecraftforge.net/" + path + "-launcher.jar");
127+
transformLibraries(getElement(installer, "libraries").getAsJsonArray(), libraries, additionalUrls);
128128

129129
patches.addProperty("version", forgeVersion);
130130
for (JsonElement require : getElement(patches, "requires").getAsJsonArray()) {

src/main/resources/mmc-pack.json converter/src/main/resources/mmc-pack.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
"uid": "net.minecraftforge"
1111
}
1212
]
13-
}
13+
}

src/main/resources/patches/net.minecraftforge.json converter/src/main/resources/patches/net.minecraftforge.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"MMC-filename": "ForgeWrapper-${version}.jar"
2626
}
2727
]
28-
}
28+
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
org.gradle.daemon = false
33

4-
fw_version = 1.5
4+
fw_version = 1.5.1

jigsaw/build.gradle

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
plugins {
3+
id "java"
4+
id "eclipse"
5+
}
6+
7+
compileJava {
8+
if (JavaVersion.current() < JavaVersion.VERSION_1_9) {
9+
javaCompiler = javaToolchains.compilerFor {
10+
languageVersion = JavaLanguageVersion.of(9)
11+
}
12+
}
13+
sourceCompatibility = 9
14+
targetCompatibility = 9
15+
}
16+
17+
configurations {
18+
apiElements {
19+
attributes {
20+
attribute TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8
21+
}
22+
}
23+
runtimeElements {
24+
attributes {
25+
attribute TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)