diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12cdc82..e7a3cca 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,27 +10,32 @@ jobs: build: strategy: matrix: - # Use these Java versions java: [ 21, ] - # and run on both Linux and Windows + + distribution: [ + "temurin", + ] + os: [ubuntu-20.04, windows-2022] + runs-on: ${{ matrix.os }} steps: - name: checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/wrapper-validation-action@v3 - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} + distribution: ${{ matrix.distribution }} - name: make gradle wrapper executable if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew - name: build - run: ./gradlew chiseledBuild + run: ./gradlew build - name: capture build artifacts if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS uses: actions/upload-artifact@v4 diff --git a/CHANGES.md b/CHANGES.md index c5359db..951f374 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,4 @@ changes: -- fix icon not properly refreshing on kde plasma and gnome -- fix GNOME not having an app icon ([#3](https://github.com/not-coded/WayFix/issues/3)) \ No newline at end of file +- if you're on kde plasma, minecraft will fullscreen correctly without using the fullscreen config options (basically like x11) + - only if **[kdotool](https://github.com/jinliu/kdotool)** is installed!!!!! +- java 8 support for 1.16.5-1.18.2 version \ No newline at end of file diff --git a/README.md b/README.md index 907437d..3fd1485 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,23 @@ # WayFix -[![Supports minecraft versions from 1.16](https://notcoded.needs.rest/r/badge_minecraft_1.16plus.svg)](https://minecraft.net) [![Cloth Config API](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/requires/cloth-config-api_vector.svg)](https://www.modrinth.com/mod/cloth-config) ![Won't support forge](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/unsupported/forge_vector.svg) +[![Supports minecraft versions from 1.16](https://notcoded.needs.rest/r/badge_minecraft_1.16plus.svg)](https://minecraft.net) [![Cloth Config API](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/requires/cloth-config-api_vector.svg)](https://www.modrinth.com/mod/cloth-config) ![Won't support forge](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/unsupported/forge_vector.svg) ...natively Fixes multiple issues regarding Wayland compatibility for Minecraft. +**Compatible with Forge and NeoForge, using [Sinytra Connector](https://modrinth.com/mod/connector) and [Connector Extras](https://modrinth.com/mod/connector-extras).** Requires disabling the early loading progress window though! + **Recommended to be used with [glfw-wayland](https://github.com/BoyOrigin/glfw-wayland).**
**With the [Cursor Fix](https://www.reddit.com/r/kde/comments/13ddktm/mouse_cursor_changing_when_over_some_apps_when/).** +
+**And [kdotool](https://github.com/jinliu/kdotool)** ***(only if on KDE Plasma)***. ## Features - Auto Scale GUI - - Auto-scales the GUI scale depending on your display's scaling. ***[may look weird when windowed]*** (e.g. 2 GUI Scale on 1920x1080 at 100% -> 4 GUI Scale on 3840x2160 at 200%) + - Auto-scales the GUI scale depending on your display's scaling. (e.g. 2 GUI Scale on 1920x1080 at 100% → 4 GUI Scale on 3840x2160 at 200%) - Inject Minecraft Icon at Startup - Injects the Minecraft Icon at Startup instead of defaulting to the normal Wayland icon. @@ -26,8 +30,12 @@ Fixes multiple issues regarding Wayland compatibility for Minecraft. - Fixes issues where keyboard combinations like 'CTRL + A' or 'CTRL + C' are sent as characters in chat instead of being recognized as key combinations. - **Fullscreen** - - Specify Monitor *(looks different in-game)* ***(by default Minecraft sometimes full-screens on the wrong monitor due to Wayland window limitations)*** - - Specify which monitor you want to fullscreen Minecraft to. (primary monitor by default) (must turn on in seperate config option) + - Select Monitor + - Select which monitor you want to fullscreen Minecraft to. (primary monitor by default) (must turn on in seperate config option) + +> [!NOTE] +> By default Minecraft sometimes full-screens on the wrong monitor due to Wayland window limitations (unable to get X and Y position). +> This is automatically **fixed only on KDE Plasma** without specifying the monitor by installing **[kdotool](https://github.com/jinliu/kdotool)**. ## Building - Clone the repository diff --git a/build.gradle.kts b/build.gradle.kts index 7b52281..a470843 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,54 +1,46 @@ +import java.net.URI +import java.nio.charset.StandardCharsets +import java.nio.file.FileSystems +import java.nio.file.Files +import java.nio.file.StandardOpenOption +import kotlin.io.path.readText + plugins { - id("fabric-loom") version "1.8-SNAPSHOT" + id("fabric-loom") version "1.9.2" id("com.modrinth.minotaur") version "2.+" } -val modName = property("mod.name").toString() -version = "${property("mod.version")}" + "+" + "${property("mod.version_name")}" -group = property("mod.maven_group").toString() +version = property("mod_version")!! +group = property("maven_group")!! base { - archivesName.set(modName) + archivesName.set(property("archives_base_name").toString()) } repositories { + flatDir { dirs("libraries") } + maven("https://maven.shedaniel.me/") maven("https://maven.terraformersmc.com/releases/") } dependencies { - minecraft("com.mojang:minecraft:${property("deps.minecraft")}") - mappings("net.fabricmc:yarn:${property("deps.yarn_mappings")}:v2") - modImplementation("net.fabricmc:fabric-loader:${property("deps.fabric_loader")}") + minecraft("com.mojang:minecraft:${property("minecraft_version")}") + mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2") + modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}") - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${property("deps.cloth_config_version")}") - modImplementation("com.terraformersmc:modmenu:${property("deps.mod_menu_version")}") - - implementation("org.lwjgl:lwjgl-glfw:3.3.2") -} + modImplementation("me.shedaniel.cloth:cloth-config-fabric:${property("cloth_config_version")}") + modImplementation("com.terraformersmc:modmenu:${property("mod_menu_version")}") -loom { - decompilers { - get("vineflower").apply { // Adds names to lambdas - useful for mixins - options.put("mark-corresponding-synthetics", "1") - } - } + modImplementation("net.notcoded:codelib:${property("codelib_version")}") - runConfigs.all { - ideConfigGenerated(true) - vmArgs("-Dmixin.debug.export=true") - runDir = "../../run" - } + implementation("org.lwjgl:lwjgl-glfw:3.3.2") } -val target = ">=${property("mod.min_target")}- <=${property("mod.max_target")}" - tasks.processResources { val expandProps = mapOf( "version" to project.version, - "minecraftVersion" to target, - "javaVersion" to project.property("deps.java") ) filesMatching("fabric.mod.json") { @@ -58,21 +50,90 @@ tasks.processResources { inputs.properties(expandProps) } +tasks.withType { + options.encoding = "UTF-8" + options.release.set(8) +} + java { withSourcesJar() - val javaVersion = if (project.property("deps.java") == "9") JavaVersion.VERSION_1_9 else JavaVersion.VERSION_17 - - sourceCompatibility = javaVersion - targetCompatibility = javaVersion + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } -tasks.register("buildAndCollect") { - group = "build" - from(tasks.remapJar.get().archiveFile) - into(rootProject.layout.buildDirectory.file("libs")) - dependsOn("build") -} +project.gradle.addBuildListener(object : BuildListener { + override fun settingsEvaluated(settings: Settings) { } + + override fun projectsLoaded(gradle: Gradle) { } + + override fun projectsEvaluated(gradle: Gradle) { } + + override fun buildFinished(result: BuildResult) { + if (result.failure != null) return + println("Fixing RefMaps") + + var jarFile = file(layout.buildDirectory.file("libs/wayfix-${project.version}.jar")) + + val env: MutableMap = HashMap() + env.put("create", "true") + + val path: java.nio.file.Path = jarFile.toPath() + val uri: URI? = URI.create("jar:" + path.toUri()) + + FileSystems.newFileSystem(uri, env).use { fs -> + val refMap: java.nio.file.Path? = fs.getPath("wayfix-refmap.json") + if(refMap == null) return + var refMapText = refMap.readText() + + // Fix refmap for the mixin WindowMixin116to1192: + // Lnet/minecraft/class_1041;method_4491(Ljava/io/InputStream;Ljava/io/InputStream;)V + + refMapText = refMapText.replace( + " \"net/notcoded/wayfix/mixin/WindowMixin116to1192\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_3262;Lnet/minecraft/class_8518;)V\"\n" + + " },", + " \"net/notcoded/wayfix/mixin/WindowMixin116to1192\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Ljava/io/InputStream;Ljava/io/InputStream;)V\"\n" + + " }," + ) + + refMapText = refMapText.replace( + " \"net/notcoded/wayfix/mixin/WindowMixin116to1192\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_3262;Lnet/minecraft/class_8518;)V\"\n" + + " },", + " \"net/notcoded/wayfix/mixin/WindowMixin116to1192\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_1041;method_4491(Ljava/io/InputStream;Ljava/io/InputStream;)V\"\n" + + " }," + ) + + // Fix refmap for the mixin WindowMixin1193to1194: + // Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_7367;Lnet/minecraft/class_7367;)V + + refMapText = refMapText.replace( + " \"net/notcoded/wayfix/mixin/WindowMixin1193to1194\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_3262;Lnet/minecraft/class_8518;)V\"\n" + + " },", + " \"net/notcoded/wayfix/mixin/WindowMixin1193to1194\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_7367;Lnet/minecraft/class_7367;)V\"\n" + + " }," + ) + + refMapText = refMapText.replace( + " \"net/notcoded/wayfix/mixin/WindowMixin1193to1194\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_3262;Lnet/minecraft/class_8518;)V\"\n" + + " },", + " \"net/notcoded/wayfix/mixin/WindowMixin1193to1194\": {\n" + + " \"setIcon\": \"Lnet/minecraft/class_1041;method_4491(Lnet/minecraft/class_7367;Lnet/minecraft/class_7367;)V\"\n" + + " }," + ) + + Files.newBufferedWriter(refMap, StandardCharsets.UTF_8, StandardOpenOption.WRITE).use { writer -> + writer.write(refMapText) + } + } + } +}) modrinth { @@ -91,6 +152,5 @@ modrinth { optional.project("modmenu") } - val changes = rootProject.file("CHANGES.md").readText() - changelog = if (project.property("deps.java") == "9") "# Requires Java 9+\n\n$changes" else changes + changelog = rootProject.file("CHANGES.md").readText() } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ecb9228..2e6abde 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,22 +3,19 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true # Mod Information -mod.version=1.0.2 -mod.name=wayfix -mod.maven_group=net.notcoded +mod_version=1.0.5 +archives_base_name=wayfix +maven_group=net.notcoded -mod.version_name=[VERSIONED] - -mod.min_target=[VERSIONED] -mod.max_target=[VERSIONED] - -publishing.supported_versions=[VERSIONED] +publishing.supported_versions=1.16,1.16.1,1.16.2,1.16.3,1.16.4,1.16.5,1.17,1.17.1,1.18,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3,1.19.4,1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4 # Dependencies # https://fabricmc.net/develop -deps.yarn=[VERSIONED] -deps.fabric_loader=0.14.20 -deps.cloth_config_version=[VERSIONED] -deps.mod_menu_version=[VERSIONED] -deps.fabric_api=[VERSIONED] -deps.java=[VERSIONED] + +minecraft_version=1.21 +yarn_mappings=1.21+build.9 +loader_version=0.15.11 + +mod_menu_version=11.0.3 +cloth_config_version=15.0.140 +codelib_version=2.0.0+1.21 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar old mode 100755 new mode 100644 index 7454180..a4b76b9 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5e7606e..e18bc25 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Tue May 07 15:32:39 CEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index c53aefa..f3b75f3 100755 --- a/gradlew +++ b/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. @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -32,10 +34,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: # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +133,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +200,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +216,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/gradlew.bat b/gradlew.bat old mode 100755 new mode 100644 index 107acd3..9b42019 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,94 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="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 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +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! +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 + +:omega diff --git a/libraries/codelib-2.0.0+1.21.jar b/libraries/codelib-2.0.0+1.21.jar new file mode 100644 index 0000000..125a56b Binary files /dev/null and b/libraries/codelib-2.0.0+1.21.jar differ diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7c153a3 --- /dev/null +++ b/renovate.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ], + "dependencyDashboard": false, + "platformAutomerge": true, + "ignoreDeps": ["dev.kikugie.stonecutter"] +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 08149d2..ba3f584 100755 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,26 +1,8 @@ pluginManagement { repositories { maven("https://maven.fabricmc.net/") - gradlePluginPortal() - maven("https://maven.kikugie.dev/snapshots") - } -} - -plugins { - id("dev.kikugie.stonecutter") version "0.5-beta.3" -} - -stonecutter { - kotlinController = true - centralScript = "build.gradle.kts" - - shared { - versions("1.16.5", "1.19", "1.19.3", "1.20.6") - vcsVersion = "1.19.3" } - - create(rootProject) } rootProject.name = "WayFix" \ No newline at end of file diff --git a/src/main/java/net/notcoded/wayfix/WayFix.java b/src/main/java/net/notcoded/wayfix/WayFix.java index ef5549b..fd08cdc 100644 --- a/src/main/java/net/notcoded/wayfix/WayFix.java +++ b/src/main/java/net/notcoded/wayfix/WayFix.java @@ -4,6 +4,7 @@ import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; import net.fabricmc.api.ClientModInitializer; import net.notcoded.wayfix.config.ModConfig; +import net.notcoded.wayfix.util.WindowHelper; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.glfw.GLFW; @@ -16,6 +17,14 @@ public class WayFix implements ClientModInitializer { public void onInitializeClient() { AutoConfig.register(ModConfig.class, GsonConfigSerializer::new); WayFix.config = AutoConfig.getConfigHolder(ModConfig.class).getConfig(); + + WindowHelper.checkIfCanUseWindowHelper(); + if(WindowHelper.canUseWindowHelper) { + WayFix.config.fullscreen.monitorName = ""; + WayFix.config.fullscreen.useMonitorName = false; + WayFix.config.fullscreen.monitorSelector.monitors.clear(); + WayFix.config.fullscreen.monitorSelector.monitors.add(new ModConfig.Monitors("You do not need to use this as it is automatically fixed.", 0)); // most users probably won't understand this, but I'll include it anyway + } } public static boolean isWayland() { diff --git a/src/main/java/net/notcoded/wayfix/mixin/MinecraftClientMixin.java b/src/main/java/net/notcoded/wayfix/mixin/MinecraftClientMixin.java index 4239b8c..06cca68 100644 --- a/src/main/java/net/notcoded/wayfix/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/notcoded/wayfix/mixin/MinecraftClientMixin.java @@ -1,7 +1,6 @@ package net.notcoded.wayfix.mixin; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.option.GameOptions; import net.minecraft.client.util.Window; import net.notcoded.wayfix.WayFix; import org.lwjgl.glfw.GLFW; @@ -10,31 +9,28 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(MinecraftClient.class) public abstract class MinecraftClientMixin { @Shadow @Final private Window window; - @Shadow @Final public GameOptions options; - - @ModifyArg(method = "onResolutionChanged", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;setScaleFactor(D)V")) - private double fixHiDPIScaling(double d) { - int guiScale; - //? if >=1.19 { - guiScale = this.options.getGuiScale().getValue(); - //?} elif <1.19 { - /*guiScale = this.options.guiScale; - *///?} + @Redirect(method = "onResolutionChanged", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;calculateScaleFactor(IZ)I")) + private int fixHiDPIScaling(Window instance, int guiScale, boolean forceUnicodeFont) { + int fixedGuiScale = guiScale; // "Auto" or Gui Scale 0 already auto-scales it - return guiScale != 0 && WayFix.config.autoScaleGUI ? d * getScaleFactor() : d; + if (guiScale != 0 && WayFix.config.autoScaleGUI) { + fixedGuiScale = Math.round(guiScale * getScaleFactor(instance)); + } + + return instance.calculateScaleFactor(fixedGuiScale, forceUnicodeFont); } @Unique - private float getScaleFactor() { + private float getScaleFactor(Window instance) { float[] pos = new float[1]; - GLFW.glfwGetWindowContentScale(this.window.getHandle(), pos, pos); + GLFW.glfwGetWindowContentScale(instance.getHandle(), pos, pos); return pos[0]; // using x or y doesn't matter } diff --git a/src/main/java/net/notcoded/wayfix/mixin/MonitorTrackerMixin.java b/src/main/java/net/notcoded/wayfix/mixin/MonitorTrackerMixin.java index 128bc09..6bd3dc8 100644 --- a/src/main/java/net/notcoded/wayfix/mixin/MonitorTrackerMixin.java +++ b/src/main/java/net/notcoded/wayfix/mixin/MonitorTrackerMixin.java @@ -5,6 +5,7 @@ import net.minecraft.client.util.MonitorTracker; import net.notcoded.wayfix.WayFix; import net.notcoded.wayfix.config.ModConfig; +import net.notcoded.wayfix.util.WindowHelper; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -21,7 +22,7 @@ public class MonitorTrackerMixin { @Inject(method = {"handleMonitorEvent", ""}, at = @At("TAIL")) private void handleConfigAdditions(CallbackInfo ci) { - this.refreshMonitors(); + if(!WindowHelper.canUseWindowHelper) this.refreshMonitors(); } @Unique diff --git a/src/main/java/net/notcoded/wayfix/mixin/WindowMixin.java b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin.java index f799f7f..1ab4bf5 100644 --- a/src/main/java/net/notcoded/wayfix/mixin/WindowMixin.java +++ b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin.java @@ -8,8 +8,11 @@ import net.notcoded.wayfix.WayFix; import net.notcoded.wayfix.config.ModConfig; import net.notcoded.wayfix.util.DesktopFileInjector; +import net.notcoded.wayfix.util.WindowHelper; import org.lwjgl.glfw.GLFW; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -18,42 +21,30 @@ import static net.notcoded.wayfix.WayFix.isWayland; -//? if >=1.20 { - -import net.minecraft.client.util.Icons; -import net.minecraft.resource.ResourcePack; -import java.io.IOException; -//?} elif 1.19.3 { -/*import java.util.ArrayList; -import java.util.Arrays; -import net.minecraft.resource.InputSupplier; -*///?} - -//? if <1.20 { -/*import java.io.InputStream; -*///?} - /* - Credits to moehreag for most of the code - https://github.com/moehreag/wayland-fixes */ @Mixin(Window.class) -public class WindowMixin { +public abstract class WindowMixin { + @Shadow protected abstract void onWindowPosChanged(long window, int x, int y); + + @Shadow @Final private long handle; + @Inject(method = "", at = @At(value = "INVOKE", target = "Lorg/lwjgl/glfw/GLFW;glfwDefaultWindowHints()V", shift = At.Shift.AFTER, remap = false)) private void onWindowHints(WindowEventHandler windowEventHandler, MonitorTracker monitorTracker, WindowSettings windowSettings, String string, String string2, CallbackInfo ci) { if (isWayland()) { GLFW.glfwWindowHint(GLFW.GLFW_FOCUS_ON_SHOW, GLFW.GLFW_FALSE); - if(!WayFix.config.injectIcon) return; // assuming that user wants wayland icon and not broken icon (mc launcher) - DesktopFileInjector.inject(); + if(WayFix.config.injectIcon) DesktopFileInjector.inject(); GLFW.glfwWindowHintString(GLFW.GLFW_WAYLAND_APP_ID, DesktopFileInjector.APP_ID); } } @Redirect(method = "updateWindowRegion", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/MonitorTracker;getMonitor(Lnet/minecraft/client/util/Window;)Lnet/minecraft/client/util/Monitor;")) private Monitor fixWrongMonitor(MonitorTracker instance, Window window) { - return WayFix.config.fullscreen.useMonitorName ? getMonitor(instance) : instance.getMonitor(window); + return WayFix.config.fullscreen.useMonitorName && !WindowHelper.canUseWindowHelper ? getMonitor(instance) : instance.getMonitor(window); } @Unique @@ -69,30 +60,16 @@ private Monitor getMonitor(MonitorTracker instance) { return instance.getMonitor(monitorID); } - - @Inject(method = "setIcon", at = @At("HEAD"), cancellable = true) - //? if >=1.20 { - - private void injectIcon(ResourcePack resourcePack, Icons icons, CallbackInfo ci) { - //?} elif 1.19.3 { - /*private void injectIcon(InputSupplier smallIconSupplier, InputSupplier bigIconSupplier, CallbackInfo ci) { - *///?} elif <1.19.3 { - - /*private void injectIcon(InputStream icon16, InputStream icon32, CallbackInfo ci) { - *///?} - if (isWayland()) { - //? if >=1.20 { - try { - DesktopFileInjector.setIcon(icons.getIcons(resourcePack)); - } catch (IOException ignored) { } - //?} elif 1.19.3 { - /*DesktopFileInjector.setIcon(new ArrayList<>(Arrays.asList(smallIconSupplier, bigIconSupplier))); - *///?} elif <1.19.3 { - - /*DesktopFileInjector.setIcon(icon16, icon32); - *///?} - ci.cancel(); - } + + // KDE Plasma ONLY + @Inject(method = "updateWindowRegion", at = @At("HEAD")) + private void fixWrongMonitor(CallbackInfo ci) { + if(!WindowHelper.canUseWindowHelper) return; + + int[] pos = WindowHelper.getWindowPos(); + if(pos == null) return; + + onWindowPosChanged(this.handle, pos[0], pos[1]); } } \ No newline at end of file diff --git a/src/main/java/net/notcoded/wayfix/mixin/WindowMixin116to1192.java b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin116to1192.java new file mode 100644 index 0000000..e97348f --- /dev/null +++ b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin116to1192.java @@ -0,0 +1,27 @@ +package net.notcoded.wayfix.mixin; + +import net.minecraft.client.util.Window; +import net.notcoded.codelib.common.mixinhelper.annotation.MinecraftVersion; +import net.notcoded.wayfix.util.DesktopFileInjector; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.io.InputStream; + +import static net.notcoded.wayfix.WayFix.isWayland; + +@MinecraftVersion(minecraft = {">=1.16", "<=1.19.2"}) +@Mixin(Window.class) +public class WindowMixin116to1192 { + + // Ignore error + @Inject(method = "setIcon", at = @At("HEAD"), cancellable = true) + private void injectIcon(InputStream icon16, InputStream icon32, CallbackInfo ci) { + if (isWayland()) { + DesktopFileInjector.setIcon(icon16, icon32); + ci.cancel(); + } + } +} diff --git a/src/main/java/net/notcoded/wayfix/mixin/WindowMixin1193to1194.java b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin1193to1194.java new file mode 100644 index 0000000..1839199 --- /dev/null +++ b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin1193to1194.java @@ -0,0 +1,30 @@ +package net.notcoded.wayfix.mixin; + +import net.minecraft.client.util.Window; +import net.minecraft.resource.InputSupplier; +import net.notcoded.codelib.common.mixinhelper.annotation.MinecraftVersion; +import net.notcoded.wayfix.util.DesktopFileInjector; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; + +import static net.notcoded.wayfix.WayFix.isWayland; + +@MinecraftVersion(minecraft = {"1.19.3", "1.19.4"}) +@Mixin(Window.class) +public class WindowMixin1193to1194 { + + // Ignore error + @Inject(method = "setIcon", at = @At("HEAD"), cancellable = true) + private void injectIcon(InputSupplier smallIconSupplier, InputSupplier bigIconSupplier, CallbackInfo ci) { + if (isWayland()) { + DesktopFileInjector.setIcon(new ArrayList<>(Arrays.asList(smallIconSupplier, bigIconSupplier))); + ci.cancel(); + } + } +} diff --git a/src/main/java/net/notcoded/wayfix/mixin/WindowMixin120.java b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin120.java new file mode 100644 index 0000000..9bf9f47 --- /dev/null +++ b/src/main/java/net/notcoded/wayfix/mixin/WindowMixin120.java @@ -0,0 +1,31 @@ +package net.notcoded.wayfix.mixin; + +import net.minecraft.client.util.Icons; +import net.minecraft.client.util.Window; +import net.minecraft.resource.ResourcePack; +import net.notcoded.codelib.common.mixinhelper.annotation.MinecraftVersion; +import net.notcoded.wayfix.util.DesktopFileInjector; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.io.IOException; + +import static net.notcoded.wayfix.WayFix.isWayland; + +@MinecraftVersion(minecraft = ">=1.20") +@Mixin(Window.class) +public class WindowMixin120 { + + // Ignore error + @Inject(method = "setIcon", at = @At("HEAD"), cancellable = true) + private void injectIcon(ResourcePack resourcePack, Icons icons, CallbackInfo ci) { + if (isWayland()) { + try { + DesktopFileInjector.setIcon(icons.getIcons(resourcePack)); + } catch (IOException ignored) { } + ci.cancel(); + } + } +} diff --git a/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java b/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java index b1e25d8..b7fa32d 100644 --- a/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java +++ b/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java @@ -1,14 +1,11 @@ package net.notcoded.wayfix.util; import net.minecraft.client.MinecraftClient; -//? if >=1.19.3 { import net.minecraft.resource.InputSupplier; -import java.util.List; -//?} elif <1.19.3 { -/*import java.util.ArrayList; -import java.util.Arrays; import java.io.ByteArrayInputStream; -*///?} +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import net.notcoded.wayfix.WayFix; import org.apache.commons.io.IOUtils; import javax.imageio.ImageIO; @@ -49,7 +46,7 @@ public static void inject() { } - //? if >=1.19.3 { + // >=1.19.3 public static void setIcon(List> icons) { if(!WayFix.config.injectIcon) return; for (InputSupplier supplier : icons) { @@ -64,17 +61,17 @@ public static void setIcon(List> icons) { } updateIconSystem(); } - //?} elif <1.19.3 { - - /*public static void setIcon(InputStream icon16, InputStream icon32) { + + // <1.19.3 + public static void setIcon(InputStream icon16, InputStream icon32) { if(!WayFix.config.injectIcon) return; byte[] icon16Byte; byte[] icon32Byte; try { // https://stackoverflow.com/questions/58534138/does-files-readallbytes-closes-the-inputstream-after-reading-the-file - icon16Byte = icon16.readAllBytes(); - icon32Byte = icon32.readAllBytes(); + icon16Byte = IOUtils.toByteArray(icon16); + icon32Byte = IOUtils.toByteArray(icon32); } catch (IOException e) { e.printStackTrace(); return; @@ -94,7 +91,6 @@ public static void setIcon(List> icons) { updateIconSystem(); } - *///?} private static void injectFile(Path target, byte[] data) { try { diff --git a/src/main/java/net/notcoded/wayfix/util/WindowHelper.java b/src/main/java/net/notcoded/wayfix/util/WindowHelper.java new file mode 100644 index 0000000..5d8cd5b --- /dev/null +++ b/src/main/java/net/notcoded/wayfix/util/WindowHelper.java @@ -0,0 +1,70 @@ +package net.notcoded.wayfix.util; + +import net.minecraft.client.MinecraftClient; +import net.notcoded.wayfix.WayFix; +import org.apache.commons.compress.utils.IOUtils; + +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class WindowHelper { + + public static boolean canUseWindowHelper = false; + + public static void checkIfCanUseWindowHelper() { + if(!System.getenv("XDG_CURRENT_DESKTOP").contains("KDE")) return; // kdotool only works with KDE and I haven't found an alternative. + + try { + new ProcessBuilder("kdotool").start(); + canUseWindowHelper = true; + } catch (IOException ignored) { + WayFix.LOGGER.warn("WayFix recommends installing 'kdotool' to properly fix the minecraft full-screening functionality."); + } + } + + private static String windowID = ""; + + public static int[] getWindowPos() { + if(windowID.trim().isEmpty() && !setWindowID()) return null; + + String[] command = new String[]{"kdotool", "getwindowgeometry", windowID}; + + ProcessBuilder builder = new ProcessBuilder(command); + + try { + Process process = builder.start(); + String result = new String(IOUtils.toByteArray(process.getInputStream())); + Pattern pattern = Pattern.compile("Position:\\s*(\\d+),(\\d+)"); + Matcher matcher = pattern.matcher(result); + if (matcher.find()) { + return new int[]{Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2))}; + } else { + return null; + } + } catch (IOException ignored) { + return null; + } + } + + public static boolean setWindowID() { + if(!MinecraftClient.getInstance().isWindowFocused()) return false; + String[] command = new String[]{"kdotool", "getactivewindow", "getwindowgeometry"}; + + ProcessBuilder builder = new ProcessBuilder(command); + + try { + Process process = builder.start(); + String result = new String(IOUtils.toByteArray(process.getInputStream())); + Pattern pattern = Pattern.compile("Window \\{(\\w+-\\w+-\\w+-\\w+-\\w+)}"); + Matcher matcher = pattern.matcher(result); + if (matcher.find()) { + windowID = "{" + matcher.group(1) + "}"; // let's just hope this is the minecraft window 🙏 + return true; + } + return false; + } catch (IOException ignored) { + return false; + } + } +} diff --git a/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop b/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop index c3c3cf6..78de0a1 100644 --- a/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop +++ b/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop @@ -2,8 +2,7 @@ Name=Minecraft %s Comment=Explore your own unique world, survive the night, and create anything you can imagine! Icon=%s -Exec=true -Terminal=false Type=Application +NoDisplay=true Categories=Game; -%s \ No newline at end of file +%s diff --git a/src/main/resources/assets/wayfix/lang/en_us.json b/src/main/resources/assets/wayfix/lang/en_us.json index 7c91fb9..d55f8fd 100755 --- a/src/main/resources/assets/wayfix/lang/en_us.json +++ b/src/main/resources/assets/wayfix/lang/en_us.json @@ -2,7 +2,7 @@ "text.autoconfig.wayfix.title": "WayFix Options", "text.autoconfig.wayfix.option.autoScaleGUI": "Auto Scale GUI", - "text.autoconfig.wayfix.option.autoScaleGUI.@Tooltip": "Auto-scales the GUI scale depending on your display's scaling. [may look weird when windowed] (e.g. 2 GUI Scale on 1920x1080 at 100% -> 4 GUI Scale on 3840x2160 at 200%)", + "text.autoconfig.wayfix.option.autoScaleGUI.@Tooltip": "Auto-scales the GUI scale depending on your display's scaling. (e.g. 2 GUI Scale on 1920x1080 at 100% -> 4 GUI Scale on 3840x2160 at 200%)", "text.autoconfig.wayfix.option.injectIcon": "Inject Minecraft Icon at Startup", "text.autoconfig.wayfix.option.injectIcon.@Tooltip": "Injects the Minecraft Icon at Startup instead of defaulting to the normal Wayland icon (requires restart).", @@ -28,4 +28,4 @@ "text.autoconfig.wayfix.option.Monitors.monitorName": "Monitor Name", "text.autoconfig.wayfix.option.Monitors.primary.@PrefixText": "↑↑ Copy me to the \"Select Monitor\" field! (if you want to choose this monitor as the fullscreen one) ↑↑", "text.autoconfig.wayfix.option.Monitors.primary": "Is Primary Monitor" -} \ No newline at end of file +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6599de5..457a967 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -33,8 +33,9 @@ "depends": { "fabricloader": ">=0.14.20", "cloth-config2": ">=4.9.0", - "minecraft": "${minecraftVersion}", - "java": ">=${javaVersion}" + "minecraft": ">=1.16", + "codelib": ">=2.0.0", + "java": ">=8" }, "recommends": { "modmenu": "*" diff --git a/src/main/resources/wayfix.mixins.json b/src/main/resources/wayfix.mixins.json index 406761f..61d00af 100644 --- a/src/main/resources/wayfix.mixins.json +++ b/src/main/resources/wayfix.mixins.json @@ -8,9 +8,13 @@ "MinecraftClientMixin", "MonitorTrackerMixin", "TextFieldWidgetMixin", - "WindowMixin" + "WindowMixin", + "WindowMixin116to1192", + "WindowMixin1193to1194", + "WindowMixin120" ], "injectors": { "defaultRequire": 1 - } + }, + "plugin": "net.notcoded.codelib.common.mixinhelper.MixinPlugin" } \ No newline at end of file diff --git a/stonecutter.gradle.kts b/stonecutter.gradle.kts deleted file mode 100644 index 8ac44d1..0000000 --- a/stonecutter.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id("dev.kikugie.stonecutter") -} -stonecutter active "1.20.6" /* [SC] DO NOT EDIT */ - -stonecutter registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) { - group = "project" - ofTask("buildAndCollect") -} - -stonecutter registerChiseled tasks.register("chiseledModrinth", stonecutter.chiseled) { - group = "project" - ofTask("modrinth") -} diff --git a/versions/1.16.5/gradle.properties b/versions/1.16.5/gradle.properties index b961f90..059827e 100644 --- a/versions/1.16.5/gradle.properties +++ b/versions/1.16.5/gradle.properties @@ -3,7 +3,7 @@ deps.minecraft=1.16.5 deps.yarn_mappings=1.16.5+build.10 deps.cloth_config_version=4.10.11 deps.mod_menu_version=1.16.23 -deps.java=9 +deps.java=8 mod.version_name=1.16-1.18.2 diff --git a/versions/1.20.6/gradle.properties b/versions/1.20.6/gradle.properties index 5597a19..a2ca26a 100644 --- a/versions/1.20.6/gradle.properties +++ b/versions/1.20.6/gradle.properties @@ -10,4 +10,4 @@ mod.version_name=1.20+ mod.min_target=1.20 mod.max_target=1.22 -publishing.supported_versions=1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3 +publishing.supported_versions=1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4