diff --git a/.github/workflows/build-on-pr.yml b/.github/workflows/build-on-pr.yml index aefc12e..85ec7ed 100644 --- a/.github/workflows/build-on-pr.yml +++ b/.github/workflows/build-on-pr.yml @@ -3,10 +3,7 @@ name: Pull Request Builds -on: - pull_request: - paths: - - "src/**" +on: [pull_request] jobs: Build: @@ -15,10 +12,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 16 + uses: actions/setup-java@v2 with: - java-version: 1.8 + distribution: 'adopt' + java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 with: diff --git a/.github/workflows/devbuild.yml b/.github/workflows/devbuild.yml index 21197a7..8482dcb 100644 --- a/.github/workflows/devbuild.yml +++ b/.github/workflows/devbuild.yml @@ -3,10 +3,7 @@ name: Development Builds -on: - push: - paths: - - "src/**" +on: [push] jobs: Build: @@ -15,10 +12,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 16 + uses: actions/setup-java@v2 with: - java-version: 1.8 + distribution: 'adopt' + java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 with: diff --git a/build.gradle b/build.gradle index d088588..265a903 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.6-SNAPSHOT' + id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' } @@ -9,8 +9,8 @@ repositories { } } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_16 +targetCompatibility = JavaVersion.VERSION_16 archivesBaseName = project.archives_base_name version = project.minecraft_version+'-'+project.mod_version @@ -35,13 +35,8 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": project.version - } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" + filesMatching("fabric.mod.json") { + expand "version": project.mod_version } } @@ -50,6 +45,9 @@ processResources { // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { options.encoding = "UTF-8" + + // Minecraft 1.17 (21w19a) upwards uses Java 16. + it.options.release = 16 } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task diff --git a/gradle.properties b/gradle.properties index 08c7481..cccab10 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use or https://modmuss50.me/fabric.html - minecraft_version=21w18a - yarn_mappings=21w18a+build.10 + minecraft_version=1.17-pre2 + yarn_mappings=1.17-pre2+build.5 loader_version=0.11.3 # check available versions on maven for the given minecraft version you are using - carpet_core_version=1.4.35+v210505 + carpet_core_version=1.4.39+v210531 # Mod Properties - mod_version = 1.4.35 + mod_version = 1.4.39 maven_group = carpet-autocraftingtable archives_base_name = carpet-autocraftingtable diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4b7e1f3..e5338d3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/carpet_autocraftingtable/mixins/CraftingInventoryMixin.java b/src/main/java/carpet_autocraftingtable/mixins/CraftingInventoryMixin.java index 32331d3..9963f5f 100644 --- a/src/main/java/carpet_autocraftingtable/mixins/CraftingInventoryMixin.java +++ b/src/main/java/carpet_autocraftingtable/mixins/CraftingInventoryMixin.java @@ -4,11 +4,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.collection.DefaultedList; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(CraftingInventory.class) public interface CraftingInventoryMixin { + @Mutable @Accessor("stacks") void setInventory(DefaultedList inventory); } diff --git a/src/main/resources/carpet-autocraftingtablemodid.mixins.json b/src/main/resources/carpet-autocraftingtable.mixins.json similarity index 87% rename from src/main/resources/carpet-autocraftingtablemodid.mixins.json rename to src/main/resources/carpet-autocraftingtable.mixins.json index fe45ae8..66f7eb1 100644 --- a/src/main/resources/carpet-autocraftingtablemodid.mixins.json +++ b/src/main/resources/carpet-autocraftingtable.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "carpet_autocraftingtable.mixins", - "compatibilityLevel": "JAVA_8", + "compatibilityLevel": "JAVA_16", "mixins": [ "CrashReport_noopMixin", "CraftingInventoryMixin",