Skip to content

Commit d823afd

Browse files
authored
Merge pull request #4 from tildejustin/1.15.2
upgradle and java 8 compat and /datapack list fix
2 parents a518464 + 1fa9ef1 commit d823afd

12 files changed

Lines changed: 156 additions & 141 deletions

File tree

.github/workflows/test.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
name: "test"
2-
1+
name: test
32
on:
43
push:
4+
# ignores tags
5+
branches:
6+
- "**"
57
pull_request:
8+
workflow_dispatch:
69

710
jobs:
8-
test:
9-
runs-on: "ubuntu-latest"
11+
build:
12+
runs-on: ubuntu-latest
1013
steps:
11-
- name: Checkout sources
12-
uses: actions/checkout@v2
13-
- name: Set up JDK 17
14-
uses: actions/setup-java@v1
14+
- name: checkout repository
15+
uses: actions/checkout@v4
16+
- name: validate gradle wrapper
17+
uses: gradle/wrapper-validation-action@v2
18+
- name: setup java
19+
uses: actions/setup-java@v4
1520
with:
16-
java-version: 17
17-
- name: Build artifacts
18-
run: ./gradlew build
21+
distribution: "temurin"
22+
java-version: 21
23+
- name: build
24+
run: |
25+
chmod +x ./gradlew
26+
./gradlew build

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# gradle
2-
32
.gradle/
43
build/
54
out/
65
classes/
76

87
# eclipse
9-
108
*.launch
119

1210
# idea
13-
1411
.idea/
1512
*.iml
1613
*.ipr
1714
*.iws
1815

1916
# vscode
20-
2117
.settings/
2218
.vscode/
2319
bin/
2420
.classpath
2521
.project
2622

2723
# macos
28-
2924
*.DS_Store
3025

3126
# fabric
32-
3327
run/
28+
29+
# java
30+
hs_err_*.log
31+
replay_*.log
32+
*.hprof
33+
*.jfr

build.gradle

Lines changed: 31 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,59 @@
11
plugins {
2-
id 'fabric-loom' version '1.0-SNAPSHOT'
3-
id 'maven-publish'
4-
id 'org.ajoberstar.grgit' version '4.1.0'
2+
alias libs.plugins.fabric.loom
3+
id "maven-publish"
54
}
65

7-
def getVersionMetadata() {
8-
// CI builds version numbers
9-
def build_id = System.getenv("RELEASE_NUMBER")
10-
if (build_id != null) {
11-
return build_id + ".0.0"
12-
}
13-
14-
// Development builds
15-
if (grgit == null) {
16-
return "dev"
17-
}
18-
19-
// Named development builds
20-
def id = grgit.head().abbreviatedId
21-
if (!grgit.status().clean) {
22-
id += "-dirty"
23-
}
6+
version = "$mod_version+$target_version"
7+
group = maven_group
248

25-
return "rev.${id}"
9+
base {
10+
archivesName = archives_name
2611
}
2712

28-
archivesBaseName = "${project.mod_id}-${project.supported_versions}"
29-
version = "${getVersionMetadata()}"
30-
group = project.maven_group
31-
3213
repositories {
33-
// Add repositories to retrieve artifacts from in here.
34-
// You should only use this when depending on other mods because
35-
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
36-
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
37-
// for more information about repositories.
14+
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }
15+
}
16+
17+
loom {
18+
decompilers {
19+
vineflower {
20+
options.putAll(["mark-corresponding-synthetics": "1", "ind": " "])
21+
}
22+
}
23+
mixin {
24+
useLegacyMixinAp = false
25+
}
3826
}
3927

4028
dependencies {
41-
// To change the versions see the gradle.properties file
42-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
43-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
44-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
29+
minecraft libs.minecraft
30+
mappings variantOf(libs.yarn.mappings) { classifier "v2" }
31+
modImplementation libs.fabric.loader
32+
vineflowerDecompilerClasspath libs.vineflower
4533
}
4634

4735
processResources {
48-
inputs.property "mod_id", project.mod_id
49-
inputs.property "version", project.version
50-
filteringCharset "UTF-8"
51-
52-
filesMatching("fabric.mod.json") {
53-
expand "mod_id": project.mod_id, "version": project.version
36+
filesMatching "fabric.mod.json", {
37+
expand "version": version
5438
}
5539
}
5640

5741
tasks.withType(JavaCompile).configureEach {
58-
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
59-
// it.options.release = 17
42+
it.options.encoding = "UTF-8"
43+
if (JavaVersion.current().isJava9Compatible()) it.options.release.set(8)
6044
}
6145

6246
java {
63-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
64-
// if it is present.
65-
// If you remove this line, sources will not be generated.
66-
withSourcesJar()
47+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
6748
}
6849

6950
jar {
70-
from("LICENSE") {
71-
rename { "${it}_${project.archivesBaseName}"}
72-
}
51+
from "LICENSE"
7352
}
7453

75-
// configure the maven publication
7654
publishing {
77-
publications {
78-
mavenJava(MavenPublication) {
79-
artifact(remapJar) {
80-
builtBy remapJar
81-
}
82-
artifact(sourcesJar) {
83-
builtBy remapSourcesJar
84-
}
85-
}
86-
}
87-
88-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
89-
repositories {
90-
// Add repositories to publish to here.
91-
// Notice: This block does NOT have the same function as the block in the top level.
92-
// The repositories here will be used for publishing your artifact, not for
93-
// retrieving dependencies.
55+
publications.create("mavenJava", MavenPublication) {
56+
from components.java
9457
}
58+
repositories {}
9559
}

gradle.properties

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx2G
1+
org.gradle.jvmargs = -Xmx2G
2+
org.gradle.parallel = true
3+
org.gradle.caching = true
34

4-
# Fabric Properties
5-
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.15.2
7-
yarn_mappings=1.15.2+build.17
8-
loader_version=0.12.12
9-
10-
# Mod Properties
11-
mod_version=1.3.0
12-
maven_group=me.wurgo
13-
archives_base_name=antiresourcereload
14-
15-
# MCSR
16-
mod_id=antiresourcereload
17-
supported_versions=1.15.2
5+
mod_version = 4.0.1
6+
target_version = 1.15.2
7+
archives_name = antiresourcereload
8+
maven_group = me.wurgo

gradle/libs.versions.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[versions]
2+
minecraft = "1.15.2"
3+
yarn_mappings = "1.15.2+build.17"
4+
fabric_loader = "0.15.7"
5+
loom = "1.5-SNAPSHOT"
6+
vineflower = "1.10.0-SNAPSHOT"
7+
8+
[libraries]
9+
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
10+
yarn_mappings = { module = "net.fabricmc:yarn", version.ref = "yarn_mappings" }
11+
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }
12+
vineflower = { module = "org.vineflower:vineflower", version.ref = "vineflower" }
13+
14+
[plugins]
15+
fabric_loom = { id = "fabric-loom", version.ref = "loom" }

gradle/wrapper/gradle-wrapper.jar

-15.7 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

gradlew

Lines changed: 33 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)