diff --git a/.gitignore b/.gitignore index 3c37caf..9b64176 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,6 @@ run/ # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) !gradle-wrapper.jar +/remappedSrc/me/polishkrowa/ctrlq/mixin/MixinHandledScreen.java +/remappedSrc/me/polishkrowa/ctrlq/mixin/MixinMinecraftClient.java +/remappedSrc/me/polishkrowa/ctrlq/CtrlQ.java diff --git a/build.gradle b/build.gradle index 542fe13..1e9ae7b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,25 @@ plugins { - id 'fabric-loom' version '0.7-SNAPSHOT' + id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' } -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.mod_version group = project.maven_group +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. +} + dependencies { - //to change the versions see the gradle.properties file + // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" @@ -26,33 +34,33 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching("fabric.mod.json") { expand "version": project.version } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } } -// ensure that the encoding is set to UTF-8, no matter what the system default is -// this fixes some edge cases with special characters not displaying correctly -// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" +tasks.withType(JavaCompile).configureEach { + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // If Javadoc is generated, this must be specified in that task too. + it.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 -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() } jar { - from "LICENSE" + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}"} + } } // configure the maven publication @@ -69,9 +77,11 @@ publishing { } } - // select the repositories you want to publish to + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { - // uncomment to publish to the local maven - // mavenLocal() + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index b30bc13..b050e00 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,13 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.16.5 -yarn_mappings=1.16.5+build.5 -loader_version=0.11.2 +minecraft_version=1.17.1 +yarn_mappings=1.17.1+build.1 +loader_version=0.11.6 # Mod Properties -mod_version=1.4 +mod_version=1.5 maven_group=me.PolishKrowa archives_base_name=ctrlq-fabric # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.25.1+build.416-1.16 +fabric_version=0.36.1+1.17 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bb8b2fc..0f80bbf 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-6.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/resources/ctrl-q.mixins.json b/src/main/resources/ctrl-q.mixins.json index e654604..a6c6a0c 100644 --- a/src/main/resources/ctrl-q.mixins.json +++ b/src/main/resources/ctrl-q.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "me.polishkrowa.ctrlq.mixin", - "compatibilityLevel": "JAVA_8", + "compatibilityLevel": "JAVA_16", "mixins": [ ], "client": ["MixinMinecraftClient","MixinHandledScreen"], diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 2fd7e53..7ee2ed8 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -4,8 +4,11 @@ "version": "${version}", "name": "Ctrl Q", "description": "This mod forces CTRL Q to be used to drop a stack of item, overwriting the MacOS CMD key.", - "authors": [], - "contact": {}, + "authors": ["PolishKrowa"], + "contact": { + "homepage": "https://www.curseforge.com/minecraft/mc-mods/ctrl-q", + "sources": "https://github.com/Mrredstone5230/Ctrl-Q" + }, "license": "MIT", "environment": "client", "icon": "assets/ctrl-q/icon.png", @@ -19,6 +22,8 @@ ], "depends": { "fabricloader": ">=0.11.2", - "minecraft": ">=1.16.4" + "minecraft": ">=1.17.1", + "java": ">=16", + "fabric": "*" } }