diff --git a/Fabric/build.gradle b/Fabric/build.gradle index c584ce9..2ee1ace 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -40,7 +40,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - it.options.release = 16 + it.options.release = 17 } java { @@ -49,8 +49,8 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_16 - targetCompatibility = JavaVersion.VERSION_16 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } jar { @@ -68,10 +68,11 @@ curseforge { changelog = file('../CHANGELOG.md') mainArtifact(remapJar) - addGameVersion '1.17.1' - addGameVersion '1.17' + addGameVersion '1.18.2' + addGameVersion '1.18.1' + addGameVersion '1.18' addGameVersion 'Fabric' - addGameVersion 'Java 8' + addGameVersion 'Java 17' relations { requiredDependency 'fabric-api' @@ -87,7 +88,7 @@ modrinth { versionType = "release" changelog = rootProject.file("../CHANGELOG.md").text uploadFile = remapJar - gameVersions = [ '1.17.1', '1.17' ] + gameVersions = [ '1.18.2', '1.18.1', '1.18' ] loaders = [ 'fabric' ] dependencies { diff --git a/Fabric/gradle.properties b/Fabric/gradle.properties index 3859663..db3acee 100644 --- a/Fabric/gradle.properties +++ b/Fabric/gradle.properties @@ -7,14 +7,14 @@ org.gradle.configuration-cache=false # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.17.1 +minecraft_version=1.18.2 loader_version=0.18.4 loom_version=1.13-SNAPSHOT # Mod Properties -mod_version=Fabric-MC1.17.1-v1.0.0 +mod_version=Fabric-MC1.18.2-v1.0.0 maven_group=com.aizistral.nochatrestrictions archives_base_name=NoChatRestrictions # Dependencies -fabric_api_version=0.46.1+1.17 \ No newline at end of file +fabric_api_version=0.77.0+1.18.2 \ No newline at end of file diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 437758d..ba926be 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -25,8 +25,8 @@ ], "depends": { "fabricloader": ">=0.18.4", - "minecraft": "~1.17", - "java": ">=16", + "minecraft": "~1.18", + "java": ">=17", "fabric": "*" } } \ No newline at end of file diff --git a/Fabric/src/main/resources/nochatrestrictions.mixins.json b/Fabric/src/main/resources/nochatrestrictions.mixins.json index b58d8b6..c091e42 100644 --- a/Fabric/src/main/resources/nochatrestrictions.mixins.json +++ b/Fabric/src/main/resources/nochatrestrictions.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "com.aizistral.nochatrestrictions.mixins", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_17", "minVersion": "0.8", "mixins": [], "client": [ diff --git a/Forge/build.gradle b/Forge/build.gradle index 1edf24c..0c10a43 100644 --- a/Forge/build.gradle +++ b/Forge/build.gradle @@ -1,28 +1,23 @@ buildscript { repositories { - maven { url = uri("${rootDir}/deps") } - maven { url = 'https://files.minecraftforge.net/maven' } maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } maven { url "https://plugins.gradle.org/m2/" } gradlePluginPortal() - mavenCentral() - jcenter() } dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.4.0' - classpath 'com.modrinth.minotaur:com.modrinth.minotaur.gradle.plugin:2.1.2' classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT' } } -apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'maven-publish' +plugins { + id 'eclipse' + id 'idea' + id 'net.minecraftforge.gradle' version '[6.0,6.2)' + id "com.modrinth.minotaur" version "2.+" + id "com.matthewprenger.cursegradle" version "1.4.0" +} + apply plugin: 'org.spongepowered.mixin' -apply plugin: "com.modrinth.minotaur" -apply plugin: "com.matthewprenger.cursegradle" mixin { add sourceSets.main, "nochatrestrictions.refmap.json" @@ -32,13 +27,17 @@ version = project.modVersion group = 'com.aizistral.nochatrestrictions' archivesBaseName = 'NoChatRestrictions' -// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16. -java.toolchain.languageVersion = JavaLanguageVersion.of(16) +// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. +java.toolchain.languageVersion = JavaLanguageVersion.of(17) + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation +} println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { - mappings channel: 'official', version: '1.17.1' + mappings channel: mapping_channel, version: mapping_version // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') @@ -78,7 +77,7 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.17.1-37.1.1' + minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" annotationProcessor 'org.spongepowered:mixin:0.8.4:processor' annotationProcessor 'com.google.code.gson:gson:2.8.0' annotationProcessor 'com.google.guava:guava:21.0' @@ -116,10 +115,11 @@ curseforge { changelogType = 'markdown' changelog = file('../CHANGELOG.md') - addGameVersion '1.17.1' - addGameVersion '1.17' + addGameVersion '1.18.2' + addGameVersion '1.18.1' + addGameVersion '1.18' addGameVersion 'Forge' - addGameVersion 'Java 8' + addGameVersion 'Java 17' } } @@ -131,7 +131,7 @@ modrinth { versionType = "release" changelog = rootProject.file("../CHANGELOG.md").text uploadFile = jar - gameVersions = [ '1.17.1', '1.17' ] + gameVersions = [ '1.18.2', '1.18.1', '1.18' ] loaders = [ 'forge' ] } diff --git a/Forge/gradle.properties b/Forge/gradle.properties index 55dd44f..2e080e8 100644 --- a/Forge/gradle.properties +++ b/Forge/gradle.properties @@ -3,5 +3,10 @@ org.gradle.jvmargs=-Xmx4G org.gradle.daemon=false -modVersion=Forge-MC1.17.1-v1.0.0 -manifestVersion=1.17.1-v1.0.0 \ No newline at end of file +minecraft_version=1.18.2 +forge_version=40.3.12 +mapping_channel=official +mapping_version=1.18.2 + +modVersion=Forge-MC1.18.2-v1.0.0 +manifestVersion=1.18.2-v1.0.0 \ No newline at end of file diff --git a/Forge/gradle/wrapper/gradle-wrapper.jar b/Forge/gradle/wrapper/gradle-wrapper.jar index 7454180..249e583 100644 Binary files a/Forge/gradle/wrapper/gradle-wrapper.jar and b/Forge/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Forge/gradle/wrapper/gradle-wrapper.properties b/Forge/gradle/wrapper/gradle-wrapper.properties index ffed3a2..0d18421 100644 --- a/Forge/gradle/wrapper/gradle-wrapper.properties +++ b/Forge/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/Forge/gradlew b/Forge/gradlew index c53aefa..a69d9cb 100644 --- a/Forge/gradlew +++ b/Forge/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/Forge/gradlew.bat b/Forge/gradlew.bat index 107acd3..f127cfd 100644 --- a/Forge/gradlew.bat +++ b/Forge/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/Forge/settings.gradle b/Forge/settings.gradle index 3b3befd..b4fdadb 100644 --- a/Forge/settings.gradle +++ b/Forge/settings.gradle @@ -1,6 +1,18 @@ pluginManagement { repositories { - maven { url "https://plugins.gradle.org/m2/" } + maven { url = uri("${rootDir}/deps") } gradlePluginPortal() + maven { + name = 'MinecraftForge' + url = 'https://maven.minecraftforge.net/' + } + maven { + url = 'https://repo.spongepowered.org/repository/maven-public/' + content { includeGroup "org.spongepowered" } + } } -} \ No newline at end of file +} + +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' +} diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml index fee6262..0a273ee 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -21,6 +21,6 @@ description="A mod dedicated to removing restrictions around the use of multipla [[dependencies.nochatrestrictions]] modId="minecraft" mandatory=true - versionRange="[1.17,1.18)" + versionRange="[1.18,1.19)" ordering="NONE" side="BOTH" diff --git a/Forge/src/main/resources/nochatrestrictions.mixins.json b/Forge/src/main/resources/nochatrestrictions.mixins.json index 0d6638e..02723ef 100644 --- a/Forge/src/main/resources/nochatrestrictions.mixins.json +++ b/Forge/src/main/resources/nochatrestrictions.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "com.aizistral.nochatrestrictions.mixins", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_17", "minVersion": "0.8", "refmap": "nochatrestrictions.refmap.json", "mixins": [],