diff --git a/build.gradle b/build.gradle index ac4e618..6cd7f34 100644 --- a/build.gradle +++ b/build.gradle @@ -1,46 +1,48 @@ plugins { - id 'fabric-loom' version '0.8-SNAPSHOT' + id 'fabric-loom' version '0.12-SNAPSHOT' + id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 - -archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group +repositories { + mavenCentral() +} + 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" + mappings "net.fabricmc:yarn:${project.yarn_version}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Fabric API. This is technically optional, but you probably want it anyway. - // modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. - // You may need to force-disable transitiveness on them. + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" } processResources { inputs.property "version", project.version + filteringCharset "UTF-8" filesMatching("fabric.mod.json") { expand "version": project.version } } -// 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" +def targetJavaVersion = 17 +tasks.withType(JavaCompile).configureEach { + it.options.encoding = "UTF-8" + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { + it.options.release = targetJavaVersion + } } -// 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. -java{ +java { + def javaVersion = JavaVersion.toVersion(targetJavaVersion) + if (JavaVersion.current() < javaVersion) { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + } + archivesBaseName = project.archives_base_name withSourcesJar() } @@ -48,4 +50,21 @@ jar { from("LICENSE") { rename { "${it}_${project.archivesBaseName}" } } -} \ No newline at end of file +} + +// configure the maven publication +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // 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. + } +} diff --git a/gradle.properties b/gradle.properties index 0783cad..f6572d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.17 - yarn_mappings=1.17+build.5 - loader_version=0.11.3 + minecraft_version=1.19 + yarn_version=1.19+build.4 + loader_version=0.14.8 # Mod Properties mod_version = 1.0.0 maven_group = cursedflames.stackablepotions - archives_base_name = Stackable Potions-FABRIC-1.17.x + archives_base_name = Stackable Potions-FABRIC-1.19 # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.13.1+build.370-1.16 + fabric_version=0.57.0+1.19 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f80bbf..aa991fc 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-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/cursedflames/stackablepotions/mixin/ItemsMixin.java b/src/main/java/cursedflames/stackablepotions/mixin/ItemsMixin.java index 5e393d2..ce0a1b1 100644 --- a/src/main/java/cursedflames/stackablepotions/mixin/ItemsMixin.java +++ b/src/main/java/cursedflames/stackablepotions/mixin/ItemsMixin.java @@ -12,18 +12,18 @@ public abstract class ItemsMixin { at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;", ordinal = 0), slice = @Slice( from = @At(value = "NEW", target = "Lnet/minecraft/item/PotionItem;"))) private static int onPotion(int old) { - return 16; + return 64; } @ModifyArg(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;", ordinal = 0), slice = @Slice( from = @At(value = "NEW", target = "Lnet/minecraft/item/SplashPotionItem;"))) private static int onSplashPotion(int old) { - return 16; + return 64; } @ModifyArg(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;", ordinal = 0), slice = @Slice( from = @At(value = "NEW", target = "Lnet/minecraft/item/LingeringPotionItem;"))) private static int onLingeringPotion(int old) { - return 16; + return 64; } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4aa33eb..2394ce4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -23,7 +23,7 @@ "stackablepotions.mixins.json" ], "depends": { - "fabricloader": ">=0.7.4", - "minecraft": "1.17.x" + "fabricloader": ">=0.14.0", + "minecraft": "1.19" } } diff --git a/src/main/resources/stackablepotions.mixins.json b/src/main/resources/stackablepotions.mixins.json index ae501b0..c0b76d8 100644 --- a/src/main/resources/stackablepotions.mixins.json +++ b/src/main/resources/stackablepotions.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "cursedflames.stackablepotions.mixin", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_17", "mixins": [ "ItemsMixin", "ThrowablePotionItemMixin",