generated from TropheusJ/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0875c3c
Showing
21 changed files
with
916 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
|
||
[*.toml] | ||
indent_style = tab | ||
tab_width = 2 | ||
|
||
[*.properties] | ||
indent_size = 2 | ||
|
||
[*.gradle] | ||
indent_style = tab | ||
|
||
[*.java] | ||
indent_style = tab | ||
ij_continuation_indent_size = 8 | ||
ij_java_class_count_to_use_import_on_demand = 99 | ||
ij_java_names_count_to_use_import_on_demand = 99 | ||
ij_java_imports_layout = $*, |, java.**, |, javax.**, |, org.**, |, com.**, |, * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: build | ||
on: [ pull_request, push ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
java: [ 17 ] | ||
runs-on: ubuntu-latest | ||
env: | ||
PUBLISH_SUFFIX: snapshots | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASS: ${{ secrets.MAVEN_PASS }} | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: setup jdk ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: build | ||
run: ./gradlew buildOrPublish | ||
|
||
- name: capture build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Artifacts | ||
path: build/libs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Gradle | ||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
|
||
# Quilt Loom | ||
run/ | ||
|
||
# Eclipse | ||
*.launch | ||
|
||
# IntelliJ Idea | ||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# Visual Studio Code | ||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
# Eclipse JDT LS | ||
workspace/ | ||
|
||
# macOS | ||
*.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Tropheus Jay | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Quilt Template Mod | ||
|
||
The official Quilt template Mod. You can use it as a template for your own mods! | ||
|
||
## Usage | ||
|
||
In order to use this mod as a template: | ||
|
||
1. Create a new repository from this template with `Use this template` | ||
2. Clone the recently-created repo on your PC | ||
3. Make the necessary changes in order to make it yours: | ||
- Update `gradle.properties` in order to use your Maven group and mod ID | ||
- If you don't know which Maven group to use, and you are planning to host the mod's source code on GitHub, use `io.github.<Your_Username_Here>` | ||
- Update `quilt.mod.json` in order to reflect your mod's metadata | ||
- If you are planning to include (jar-in-jar) a mod, don't forget to declare its dependency on it! | ||
- The icon provided here is a placeholder one. If you aren't able to replace it yet, you can delete it and remove the "icon" property | ||
- Create a LICENSE file for this mod! If you don't know which license to use, check out [here](https://choosealicense.com/). | ||
- If you use `LICENSE.md`, don't forget to update the buildscript in order to use that file name! | ||
- In `quilt.mod.json`, don't forget to put the license's [SPDX identifier](https://spdx.org/licenses/) under the `"license"` property in `"metadata"`. | ||
- The GPLv3 and AGPLv3 are not valid mod licenses, so you can use almost any license except for those. | ||
- Update the Java sub-directory structure so it reflects your Maven group | ||
- If the dependencies on `gradle/libs.versions.toml` isn't up-to-date, feel free to update them! The [linked utility](https://lambdaurora.dev/tools/import_quilt.html) should help you in this easy and quick process. | ||
4. The mod is now ready to be worked on! | ||
|
||
## License | ||
|
||
This template on the TropheusJ GitHub is licensed under the [MIT license](./LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
plugins { | ||
id "org.quiltmc.loom" version "1.1.+" | ||
id "maven-publish" | ||
} | ||
|
||
archivesBaseName = archives_base_name | ||
group = maven_group | ||
|
||
String runNumber = System.getenv("GITHUB_RUN_NUMBER") | ||
String build = runNumber != null ? "build.$runNumber" : "local" | ||
version = "$mod_version-$build+mc$minecraft_version" | ||
|
||
repositories { | ||
maven { url = "https://api.modrinth.com/maven" } | ||
maven { url = "https://cursemaven.com" } | ||
maven { url = "https://maven.terraformersmc.com/releases/" } | ||
maven { url = "https://maven.shedaniel.me/" } | ||
} | ||
|
||
dependencies { | ||
// setup | ||
minecraft("com.mojang:minecraft:$minecraft_version") | ||
mappings loom.layered { | ||
it.mappings("org.quiltmc:quilt-mappings:$minecraft_version+build.$qm_build:intermediary-v2") | ||
it.officialMojangMappings { nameSyntheticMembers = false } | ||
} | ||
modImplementation("org.quiltmc:quilt-loader:$loader_version") | ||
|
||
// dependencies | ||
modImplementation("org.quiltmc.quilted-fabric-api:quilted-fabric-api:$qfapi_version") | ||
|
||
// dev env | ||
modLocalRuntime("com.terraformersmc:modmenu:$mod_menu_version") | ||
} | ||
|
||
tasks.register("buildOrPublish") { | ||
group = "build" | ||
String mavenUser = System.getenv("MAVEN_USER") | ||
if (mavenUser != null && !mavenUser.isEmpty()) { | ||
dependsOn(tasks.named("publish")) | ||
println("prepared for publish") | ||
} else { | ||
dependsOn(tasks.named("build")) | ||
println("prepared for build") | ||
} | ||
} | ||
|
||
processResources { | ||
Map<String, Object> properties = [ | ||
"version": version, | ||
"minecraft_version": minecraft_version, | ||
"loader_version": loader_version, | ||
"qfapi_version": qfapi_version | ||
] | ||
|
||
properties.forEach(inputs::property) | ||
|
||
filesMatching("quilt.mod.json") { | ||
expand properties | ||
} | ||
} | ||
|
||
sourceSets { | ||
testmod { | ||
compileClasspath += main.compileClasspath | ||
compileClasspath += main.output | ||
runtimeClasspath += main.runtimeClasspath | ||
runtimeClasspath += main.output | ||
} | ||
} | ||
|
||
loom { | ||
runs { | ||
testmodClient { | ||
client() | ||
name "Testmod Client" | ||
source sourceSets.testmod | ||
runDir "run/test" | ||
} | ||
testmodServer { | ||
server() | ||
name "Testmod Server" | ||
source sourceSets.testmod | ||
runDir "run/test_server" | ||
} | ||
gametest { | ||
server() | ||
name "Test" | ||
source sourceSets.testmod | ||
vmArg "-Dfabric-api.gametest" | ||
vmArg "-Dfabric-api.gametest.report-file=${project.buildDir}/junit.xml" | ||
runDir "run/gametest_server" | ||
} | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = "UTF-8" | ||
it.options.release.set(17) | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
|
||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${archivesBaseName}" } | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
register("mavenJava", MavenPublication) { | ||
artifactId = archivesBaseName + "_${project.name}" | ||
//noinspection GroovyAssignabilityCheck | ||
from(components.java) | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = "https://mvn.devos.one/${System.getenv("PUBLISH_SUFFIX")}/" | ||
credentials { | ||
username = System.getenv("MAVEN_USER") | ||
password = System.getenv("MAVEN_PASS") | ||
} | ||
authentication { | ||
create("basic", BasicAuthentication) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Gradle Properties | ||
org.gradle.jvmargs = -Xmx2G | ||
org.gradle.parallel = true | ||
|
||
# Metadata | ||
maven_group = io.github.tropheusj | ||
archives_base_name = modid | ||
mod_version = 0.1.0 | ||
|
||
# Dependencies | ||
minecraft_version = 1.20.1 | ||
# https://lambdaurora.dev/tools/import_quilt.html | ||
loader_version = 0.19.2 | ||
qfapi_version = 7.0.5+0.84.0-1.20.1 | ||
qm_build = 9 | ||
|
||
# Dev env mods | ||
# https://modrinth.com/mod/modmenu/versions | ||
mod_menu_version = 7.1.0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.