├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore ├── CHANGES.md ├── LICENSE ├── README.md ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── build-extensions.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── renovate.json ├── settings.gradle.kts ├── src └── main │ ├── java │ └── net │ │ └── notcoded │ │ └── wayfix │ │ ├── WayFix.java │ │ ├── config │ │ ├── ModClothConfig.java │ │ └── ModConfig.java │ │ ├── mixin │ │ ├── GLXMixin.java │ │ ├── MinecraftClientMixin.java │ │ ├── MonitorFixWindowMixin.java │ │ ├── MonitorTrackerMixin.java │ │ ├── TextFieldWidgetMixin.java │ │ ├── WindowMixin.java │ │ └── compat │ │ │ └── MixinPlugin.java │ │ ├── platforms │ │ ├── ModPlatform.java │ │ ├── fabric │ │ │ ├── ModMenuIntegration.java │ │ │ └── WayFixFabric.java │ │ ├── forge │ │ │ └── WayFixForge.java │ │ └── neoforge │ │ │ └── WayFixNeoForge.java │ │ └── util │ │ ├── DesktopFileInjector.java │ │ ├── WindowHelper.java │ │ └── XDGPathResolver.java │ └── resources │ ├── META-INF │ ├── mods.toml │ └── neoforge.mods.toml │ ├── assets │ └── wayfix │ │ ├── com.mojang.minecraft.java-edition.desktop │ │ └── lang │ │ └── en_us.json │ ├── fabric.mod.json │ ├── icon.png │ ├── pack.mcmeta │ └── wayfix.mixins.json ├── stonecutter.gradle.kts └── versions ├── 1.16.5-fabric └── gradle.properties ├── 1.16.5-forge └── gradle.properties ├── 1.17.1-forge └── gradle.properties ├── 1.18.2-forge └── gradle.properties ├── 1.19-fabric └── gradle.properties ├── 1.19-forge └── gradle.properties ├── 1.19.2-forge └── gradle.properties ├── 1.19.3-fabric └── gradle.properties ├── 1.19.3-forge └── gradle.properties ├── 1.20.1-forge └── gradle.properties ├── 1.20.4-neoforge └── gradle.properties ├── 1.20.6-fabric └── gradle.properties ├── 1.20.6-forge └── gradle.properties ├── 1.20.6-neoforge └── gradle.properties └── 1.21-neoforge └── gradle.properties /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | java: [ 14 | 21, 15 | ] 16 | 17 | distribution: [ 18 | "temurin", 19 | ] 20 | 21 | os: [ubuntu-24.04, windows-2022] 22 | 23 | runs-on: ${{ matrix.os }} 24 | steps: 25 | - name: checkout repository 26 | uses: actions/checkout@v4 27 | - name: validate gradle wrapper 28 | uses: gradle/actions/wrapper-validation@v4 29 | - name: setup jdk ${{ matrix.java }} 30 | uses: actions/setup-java@v4 31 | with: 32 | java-version: ${{ matrix.java }} 33 | distribution: ${{ matrix.distribution }} 34 | - name: make gradle wrapper executable 35 | if: ${{ runner.os != 'Windows' }} 36 | run: chmod +x ./gradlew 37 | - name: build 38 | run: ./gradlew chiseledBuild 39 | - name: capture build artifacts 40 | if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS 41 | uses: actions/upload-artifact@v4 42 | with: 43 | name: Artifacts 44 | path: build/libs/ 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Linux ### 2 | *~ 3 | 4 | # temporary files which can be created if a process still has a handle open of a deleted file 5 | .fuse_hidden* 6 | 7 | # .nfs files are created when an open file is removed but is still being accessed 8 | .nfs* 9 | 10 | ### macOS ### 11 | # General 12 | .DS_Store 13 | .AppleDouble 14 | .LSOverride 15 | 16 | # Thumbnails 17 | ._* 18 | 19 | # Files that might appear in the root of a volume 20 | .DocumentRevisions-V100 21 | .fseventsd 22 | .Spotlight-V100 23 | .TemporaryItems 24 | .Trashes 25 | .VolumeIcon.icns 26 | .com.apple.timemachine.donotpresent 27 | 28 | # Directories potentially created on remote AFP share 29 | .AppleDB 30 | .AppleDesktop 31 | Network Trash Folder 32 | Temporary Items 33 | .apdisk 34 | 35 | ### Windows ### 36 | # Windows thumbnail cache files 37 | Thumbs.db 38 | Thumbs.db:encryptable 39 | ehthumbs.db 40 | ehthumbs_vista.db 41 | 42 | # Dump file 43 | *.stackdump 44 | 45 | # Folder config file 46 | [Dd]esktop.ini 47 | 48 | # Recycle Bin used on file shares 49 | $RECYCLE.BIN/ 50 | 51 | # Windows Installer files 52 | *.cab 53 | *.msi 54 | *.msix 55 | *.msm 56 | *.msp 57 | 58 | # Windows shortcuts 59 | *.lnk 60 | 61 | # gradle 62 | 63 | .gradle/ 64 | build/ 65 | out/ 66 | classes/ 67 | 68 | # eclipse 69 | 70 | *.launch 71 | 72 | # idea 73 | 74 | .idea/ 75 | *.iml 76 | *.ipr 77 | *.iws 78 | 79 | # vscode 80 | 81 | .settings/ 82 | .vscode/ 83 | bin/ 84 | .classpath 85 | .project 86 | 87 | # macos 88 | 89 | *.DS_Store 90 | 91 | # fabric 92 | 93 | run/ 94 | 95 | # architectury 96 | 97 | .architectury-transformer\debug.log 98 | .architectury-transformer/debug.log -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | changes: 2 | - fix neoforge config menu not opening on >1.21 3 | - fix forge crashes whilst trying to disable early loading screen 4 | - switch config over to json5 (json with comments) for easier editing -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | WayFix Logo 4 |
5 | 6 | # WayFix 7 | 8 | [![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) 9 | 10 | Fixes multiple issues regarding Wayland compatibility for Minecraft. 11 | 12 | **Recommended to be used with [glfw-wayland](https://github.com/BoyOrigin/glfw-wayland).** 13 |
14 | **With the [Cursor Fix](https://www.reddit.com/r/kde/comments/13ddktm/mouse_cursor_changing_when_over_some_apps_when/).** 15 |
16 | **And [kdotool](https://github.com/jinliu/kdotool)** ***(only if on KDE Plasma)***. 17 | 18 |
19 | 20 | ## Features 21 | - Auto Scale GUI 22 | - 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%) 23 | 24 | - Inject Minecraft Icon at Startup 25 | - Injects the Minecraft Icon at Startup instead of defaulting to the normal Wayland icon. 26 | 27 | - Key Modifiers Fix 28 | - Fixes issues where keyboard combinations like 'CTRL + A' or 'CTRL + C' are sent as characters in chat instead of being recognized as key combinations. 29 | 30 | - Select Monitor 31 | - Select which monitor you want to fullscreen Minecraft to. (primary monitor by default) 32 | 33 | > [!NOTE] 34 | > By default Minecraft sometimes full-screens on the wrong monitor due to Wayland window limitations (unable to get X and Y position). 35 | > This is automatically **fixed only on KDE Plasma** without specifying the monitor by installing **[kdotool](https://github.com/jinliu/kdotool)**. 36 | 37 | ## Building 38 | - Clone the repository 39 | - `git clone https://github.com/not-coded/WayFix` 40 | - Run `./gradlew chiseledBuild` -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("dev.architectury.loom") 3 | id("architectury-plugin") 4 | id("me.modmuss50.mod-publish-plugin") 5 | id("com.github.johnrengelman.shadow") 6 | } 7 | 8 | val minecraft = stonecutter.current.version 9 | val loader = loom.platform.get().name.lowercase() 10 | 11 | version = "${mod.version}+${mod.prop("version_name")}-$loader" 12 | group = mod.group 13 | base { 14 | archivesName.set(mod.id) 15 | } 16 | 17 | val isFabric = loader == "fabric" 18 | val isForge = loader == "forge" 19 | val isNeoForge = loader == "neoforge" 20 | 21 | stonecutter.const("fabric", isFabric) 22 | stonecutter.const("forge", isForge) 23 | stonecutter.const("neoforge", isNeoForge) 24 | 25 | architectury.common(stonecutter.tree.branches.mapNotNull { 26 | if (stonecutter.current.project !in it) null 27 | else it.prop("loom.platform") 28 | }) 29 | repositories { 30 | maven("https://maven.shedaniel.me/") 31 | maven("https://maven.terraformersmc.com/releases/") 32 | maven("https://maven.neoforged.net/releases") 33 | maven("https://maven.minecraftforge.net") 34 | 35 | } 36 | dependencies { 37 | minecraft("com.mojang:minecraft:$minecraft") 38 | 39 | if(isFabric || isForge) { 40 | mappings("net.fabricmc:yarn:$minecraft+build.${mod.dep("yarn_build")}:v2") 41 | } 42 | 43 | modImplementation("me.shedaniel.cloth:cloth-config-${loader}:${mod.dep("cloth_config_version")}") 44 | implementation("org.lwjgl:lwjgl-glfw:3.3.2") 45 | 46 | if (isFabric) { 47 | modImplementation("net.fabricmc:fabric-loader:${mod.dep("fabric_loader")}") 48 | modImplementation("com.terraformersmc:modmenu:${mod.dep("mod_menu_version")}") 49 | } 50 | if (isForge) { 51 | "forge"("net.minecraftforge:forge:${minecraft}-${mod.dep("forge_loader")}") 52 | } 53 | if (isNeoForge) { 54 | "neoForge"("net.neoforged:neoforge:${mod.dep("neoforge_loader")}") 55 | mappings(loom.layered { 56 | mappings("net.fabricmc:yarn:$minecraft+build.${mod.dep("yarn_build")}:v2") 57 | mod.dep("neoforge_patch").takeUnless { it.startsWith('[') }?.let { 58 | mappings("dev.architectury:yarn-mappings-patch-neoforge:$it") 59 | } 60 | }) 61 | } 62 | } 63 | 64 | loom { 65 | decompilers { 66 | get("vineflower").apply { // Adds names to lambdas - useful for mixins 67 | options.put("mark-corresponding-synthetics", "1") 68 | } 69 | } 70 | if (isForge) { 71 | forge.mixinConfig("wayfix.mixins.json") 72 | } 73 | } 74 | 75 | java { 76 | withSourcesJar() 77 | val javaVersion = mod.dep("java") 78 | val java = if (javaVersion == "8") JavaVersion.VERSION_1_8 else if(javaVersion == "17") JavaVersion.VERSION_17 else JavaVersion.VERSION_21 79 | targetCompatibility = java 80 | sourceCompatibility = java 81 | } 82 | 83 | val shadowBundle: Configuration by configurations.creating { 84 | isCanBeConsumed = false 85 | isCanBeResolved = true 86 | } 87 | 88 | tasks.shadowJar { 89 | configurations = listOf(shadowBundle) 90 | archiveClassifier = "dev-shadow" 91 | } 92 | 93 | tasks.remapJar { 94 | injectAccessWidener = true 95 | input = tasks.shadowJar.get().archiveFile 96 | archiveClassifier = null 97 | dependsOn(tasks.shadowJar) 98 | } 99 | 100 | tasks.jar { 101 | archiveClassifier = "dev" 102 | } 103 | 104 | val buildAndCollect = tasks.register("buildAndCollect") { 105 | group = "versioned" 106 | description = "Must run through 'chiseledBuild'" 107 | from(tasks.remapJar.get().archiveFile, tasks.remapSourcesJar.get().archiveFile) 108 | into(rootProject.layout.buildDirectory.file("libs/${mod.version}/$loader")) 109 | dependsOn("build") 110 | } 111 | 112 | if (stonecutter.current.isActive) { 113 | rootProject.tasks.register("buildActive") { 114 | group = "project" 115 | dependsOn(buildAndCollect) 116 | } 117 | 118 | rootProject.tasks.register("runActive") { 119 | group = "project" 120 | dependsOn(tasks.named("runClient")) 121 | } 122 | } 123 | 124 | tasks.processResources { 125 | var clothConfigSeparator = "_" 126 | if(minecraft == "1.16.5") clothConfigSeparator = "-" 127 | 128 | val expandProps = mapOf( 129 | "version" to version, 130 | "minecraftVersion" to mod.prop("mc_dep"), 131 | "javaVersion" to mod.dep("java"), 132 | "cloth_config_separator" to clothConfigSeparator 133 | ) 134 | 135 | if (isFabric) { 136 | filesMatching("fabric.mod.json") { expand(expandProps) } 137 | exclude("META-INF/mods.toml", "META-INF/neoforge.mods.toml", "pack.mcmeta") 138 | } 139 | 140 | if(isForge || isNeoForge) { 141 | filesMatching("META-INF/*mods.toml") { expand(expandProps) } 142 | exclude("fabric.mod.json") 143 | } 144 | 145 | inputs.properties(expandProps) 146 | 147 | } 148 | 149 | tasks.build { 150 | group = "versioned" 151 | description = "Must run through 'chiseledBuild'" 152 | } 153 | 154 | publishMods { 155 | version.set(project.version.toString()) 156 | displayName.set("${loader.upperCaseFirst()} | ${mod.prop("version_name")} [v${mod.version}]") 157 | type = STABLE 158 | file.set(tasks.remapJar.get().archiveFile) 159 | val mcVersions = mod.prop("mc_targets").split(",") 160 | 161 | changelog = rootProject.file("CHANGES.md").readText() 162 | if(minecraft == "1.16.5" && isForge) changelog = changelog.get() + "\nNOTE: You must disable the early loading screen manually, this can be done by adding \"-Dfml.earlyprogresswindow=false\" to your java arguments or by installing the [No Early loading progress](https://www.curseforge.com/minecraft/mc-mods/no-early-loading-progress) mod." 163 | 164 | modLoaders.add(loader) 165 | if(isFabric) modLoaders.add("quilt") 166 | 167 | 168 | modrinth { 169 | accessToken = providers.environmentVariable("MODRINTH_API_KEY") 170 | 171 | projectId = "hxIWsdEF" 172 | minecraftVersions.addAll(mcVersions) 173 | 174 | requires("cloth-config") 175 | if(isFabric) optional("modmenu") 176 | } 177 | 178 | curseforge { 179 | accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") 180 | 181 | projectId = "1224888" 182 | minecraftVersions.addAll(mcVersions) 183 | 184 | val javaVersion = mod.dep("java") 185 | val java = if (javaVersion == "8") JavaVersion.VERSION_1_8 else if(javaVersion == "17") JavaVersion.VERSION_17 else JavaVersion.VERSION_21 186 | javaVersions.add(java) 187 | 188 | clientRequired = true 189 | serverRequired = false 190 | 191 | changelogType = "markdown" 192 | 193 | requires("cloth-config") 194 | if(isFabric) optional("modmenu") 195 | } 196 | 197 | //TODO: remove this when actually want to release 198 | dryRun = true 199 | } -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | kotlin("jvm") version "2.1.20" 4 | } 5 | 6 | repositories { 7 | mavenCentral() 8 | } -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/build-extensions.kt: -------------------------------------------------------------------------------- 1 | import org.gradle.api.Project 2 | import org.gradle.api.artifacts.dsl.RepositoryHandler 3 | import org.gradle.kotlin.dsl.maven 4 | import org.gradle.language.jvm.tasks.ProcessResources 5 | 6 | val Project.mod: ModData get() = ModData(this) 7 | fun Project.prop(key: String): String? = findProperty(key)?.toString() 8 | fun String.upperCaseFirst() = replaceFirstChar { if (it.isLowerCase()) it.uppercaseChar() else it } 9 | 10 | fun RepositoryHandler.strictMaven(url: String, alias: String, vararg groups: String) = exclusiveContent { 11 | forRepository { maven(url) { name = alias } } 12 | filter { groups.forEach(::includeGroup) } 13 | } 14 | 15 | fun ProcessResources.properties(files: Iterable, vararg properties: Pair) { 16 | for ((name, value) in properties) inputs.property(name, value) 17 | filesMatching(files) { 18 | expand(properties.toMap()) 19 | } 20 | } 21 | 22 | @JvmInline 23 | value class ModData(private val project: Project) { 24 | val id: String get() = requireNotNull(project.prop("mod.id")) { "Missing 'mod.id'" } 25 | val name: String get() = requireNotNull(project.prop("mod.name")) { "Missing 'mod.name'" } 26 | val version: String get() = requireNotNull(project.prop("mod.version")) { "Missing 'mod.version'" } 27 | val group: String get() = requireNotNull(project.prop("mod.group")) { "Missing 'mod.group'" } 28 | 29 | fun prop(key: String) = requireNotNull(project.prop("mod.$key")) { "Missing 'mod.$key'" } 30 | fun dep(key: String) = requireNotNull(project.prop("deps.$key")) { "Missing 'deps.$key'" } 31 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx4G 3 | #org.gradle.parallel=true 4 | org.gradle.caching=false 5 | org.gradle.caching.debug=false 6 | org.gradle.parallel=false 7 | #org.gradle.configureondemand=true 8 | 9 | # Mod properties 10 | mod.version=1.0.8 11 | mod.group=net.notcoded 12 | mod.id=wayfix 13 | mod.name=WayFix 14 | 15 | # Used for the mod metadata 16 | mod.mc_dep=[VERSIONED] 17 | # Used for the release title. I.e. '1.20.x' 18 | mod.version_name=[VERSIONED] 19 | # Space separated versions for publishing. I.e. '1.20, 1.20.1' 20 | mod.mc_targets=[VERSIONED] 21 | 22 | # Mod setup 23 | deps.mixin_extras=0.4.1 24 | deps.fabric_loader=0.14.20 25 | deps.fabric_version=[VERSIONED] 26 | 27 | deps.forge_loader=[VERSIONED] 28 | deps.neoforge_loader=[VERSIONED] 29 | deps.neoforge_patch=[VERSIONED] 30 | 31 | # Mod dependencies 32 | deps.yarn_build=[VERSIONED] 33 | deps.mod_menu_version=[VERSIONED] 34 | deps.cloth_config_version=[VERSIONED] 35 | deps.java=[VERSIONED] -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/not-coded/WayFix/f936eca619e9fc505347f7feca397844509bb96f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH="\\\"\\\"" 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | if ! command -v java >/dev/null 2>&1 137 | then 138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 139 | 140 | Please set the JAVA_HOME variable in your environment to match the 141 | location of your Java installation." 142 | fi 143 | fi 144 | 145 | # Increase the maximum file descriptors if we can. 146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 147 | case $MAX_FD in #( 148 | max*) 149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 150 | # shellcheck disable=SC2039,SC3045 151 | MAX_FD=$( ulimit -H -n ) || 152 | warn "Could not query maximum file descriptor limit" 153 | esac 154 | case $MAX_FD in #( 155 | '' | soft) :;; #( 156 | *) 157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 158 | # shellcheck disable=SC2039,SC3045 159 | ulimit -n "$MAX_FD" || 160 | warn "Could not set maximum file descriptor limit to $MAX_FD" 161 | esac 162 | fi 163 | 164 | # Collect all arguments for the java command, stacking in reverse order: 165 | # * args from the command line 166 | # * the main class name 167 | # * -classpath 168 | # * -D...appname settings 169 | # * --module-path (only if needed) 170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 171 | 172 | # For Cygwin or MSYS, switch paths to Windows format before running java 173 | if "$cygwin" || "$msys" ; then 174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 176 | 177 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 178 | 179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 180 | for arg do 181 | if 182 | case $arg in #( 183 | -*) false ;; # don't mess with options #( 184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 185 | [ -e "$t" ] ;; #( 186 | *) false ;; 187 | esac 188 | then 189 | arg=$( cygpath --path --ignore --mixed "$arg" ) 190 | fi 191 | # Roll the args list around exactly as many times as the number of 192 | # args, so each arg winds up back in the position where it started, but 193 | # possibly modified. 194 | # 195 | # NB: a `for` loop captures its iteration list before it begins, so 196 | # changing the positional parameters here affects neither the number of 197 | # iterations, nor the values presented in `arg`. 198 | shift # remove old arg 199 | set -- "$@" "$arg" # push replacement arg 200 | done 201 | fi 202 | 203 | 204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 206 | 207 | # Collect all arguments for the java command: 208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 209 | # and any embedded shellness will be escaped. 210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 211 | # treated as '${Hostname}' itself on the command line. 212 | 213 | set -- \ 214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 215 | -classpath "$CLASSPATH" \ 216 | -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ 217 | "$@" 218 | 219 | # Stop when "xargs" is not available. 220 | if ! command -v xargs >/dev/null 2>&1 221 | then 222 | die "xargs is not available" 223 | fi 224 | 225 | # Use "xargs" to parse quoted args. 226 | # 227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 228 | # 229 | # In Bash we could simply go: 230 | # 231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 232 | # set -- "${ARGS[@]}" "$@" 233 | # 234 | # but POSIX shell has neither arrays nor command substitution, so instead we 235 | # post-process each arg (as a line of input to sed) to backslash-escape any 236 | # character that might be a shell metacharacter, then use eval to reverse 237 | # that process (while maintaining the separation between arguments), and wrap 238 | # the whole thing up as a single "set" statement. 239 | # 240 | # This will of course break if any of these variables contains a newline or 241 | # an unmatched quote. 242 | # 243 | 244 | eval "set -- $( 245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 246 | xargs -n1 | 247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 248 | tr '\n' ' ' 249 | )" '"$@"' 250 | 251 | exec "$JAVACMD" "$@" 252 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH= 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ], 6 | "dependencyDashboard": false, 7 | "platformAutomerge": true, 8 | "ignoreDeps": [ 9 | "dev.kikugie.stonecutter", 10 | "org.lwjgl", 11 | "org.jetbrains.kotlin.jvm" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | mavenCentral() 4 | gradlePluginPortal() 5 | maven("https://maven.fabricmc.net/") 6 | maven("https://maven.architectury.dev") 7 | maven("https://maven.minecraftforge.net") 8 | maven("https://maven.neoforged.net/releases/") 9 | maven("https://maven.kikugie.dev/snapshots") 10 | } 11 | } 12 | 13 | plugins { 14 | id("dev.kikugie.stonecutter") version "0.5" 15 | } 16 | 17 | stonecutter { 18 | centralScript = "build.gradle.kts" 19 | kotlinController = true 20 | shared { 21 | fun mc(loader: String, vararg versions: String) { 22 | for (version in versions) vers("$version-$loader", version) 23 | } 24 | mc("fabric", "1.16.5", "1.19", "1.19.3", "1.20.6") 25 | mc("forge", "1.16.5", "1.17.1", "1.18.2", "1.19", "1.19.2", "1.19.3", "1.20.1", "1.20.6") // cool forge mixin bs!!!! 26 | mc("neoforge", "1.20.4", "1.20.6", "1.21") 27 | 28 | vcsVersion = "1.20.6-fabric" 29 | } 30 | create(rootProject) 31 | } 32 | 33 | rootProject.name = "WayFix" -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/WayFix.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix; 2 | 3 | import me.shedaniel.autoconfig.AutoConfig; 4 | import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; 5 | import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer; 6 | import net.notcoded.wayfix.config.ModClothConfig; 7 | import net.notcoded.wayfix.config.ModConfig; 8 | import net.notcoded.wayfix.platforms.ModPlatform; 9 | import net.notcoded.wayfix.util.WindowHelper; 10 | import org.apache.logging.log4j.LogManager; 11 | import org.apache.logging.log4j.Logger; 12 | import org.lwjgl.glfw.GLFW; 13 | 14 | public class WayFix { 15 | public static final Logger LOGGER = LogManager.getLogger(WayFix.class); 16 | public static ModConfig config; 17 | public static ModPlatform platform; 18 | 19 | public static void init(ModPlatform platform) { 20 | AutoConfig.register(ModClothConfig.class, JanksonConfigSerializer::new); 21 | WayFix.config = AutoConfig.getConfigHolder(ModClothConfig.class).getConfig(); 22 | WayFix.platform = platform; 23 | 24 | if(platform.isDevelopmentEnvironment() || !WindowHelper.enabled) return; 25 | WindowHelper.checkIfCanUseWindowHelper(); 26 | } 27 | 28 | public static boolean isWayland() { 29 | try { 30 | return GLFW.glfwGetPlatform() == GLFW.GLFW_PLATFORM_WAYLAND; 31 | } catch (NoSuchMethodError ignored) { // <3.3.0 32 | return false; 33 | } 34 | } 35 | 36 | public static boolean supportsWayland() { 37 | try { 38 | return GLFW.glfwPlatformSupported(GLFW.GLFW_PLATFORM_WAYLAND); 39 | } catch (NoSuchMethodError ignored) { // <3.3.0 40 | LOGGER.warn("WayFix is disabling itself due to the LWJGL Version being too low."); 41 | LOGGER.warn("Please update to a LWJGL version such as '3.3.1' or higher."); 42 | return false; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/config/ModClothConfig.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.config; 2 | 3 | import com.google.common.collect.Lists; 4 | import me.shedaniel.autoconfig.AutoConfig; 5 | import me.shedaniel.autoconfig.ConfigData; 6 | import me.shedaniel.autoconfig.annotation.Config; 7 | import me.shedaniel.clothconfig2.api.ConfigBuilder; 8 | import me.shedaniel.clothconfig2.api.ConfigCategory; 9 | import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; 10 | import me.shedaniel.clothconfig2.impl.builders.DropdownMenuBuilder; 11 | import net.minecraft.client.gui.screen.Screen; 12 | import net.minecraft.text.Text; 13 | import net.notcoded.wayfix.WayFix; 14 | import net.notcoded.wayfix.util.WindowHelper; 15 | 16 | import java.util.HashMap; 17 | 18 | //? if <1.19 { 19 | /*import net.minecraft.text.TranslatableText; 20 | *///?} 21 | 22 | @Config(name = "wayfix") 23 | public class ModClothConfig extends ModConfig implements ConfigData { 24 | 25 | public static HashMap monitors = new HashMap<>(); 26 | 27 | public static Screen buildScreen(Screen parent) { 28 | ModConfig config = WayFix.config; 29 | 30 | ConfigBuilder builder = ConfigBuilder.create(); 31 | builder.setParentScreen(parent); 32 | builder.setTitle(getText("title")); 33 | builder.setDoesConfirmSave(false); 34 | 35 | builder.setSavingRunnable(() -> AutoConfig.getConfigHolder(ModClothConfig.class).save()); 36 | 37 | ConfigCategory category = builder.getOrCreateCategory(getText("title")); 38 | ConfigEntryBuilder entryBuilder = builder.entryBuilder(); 39 | 40 | category.addEntry(entryBuilder.startBooleanToggle(getText("autoScaleGUI"), config.autoScaleGUI) 41 | .setDefaultValue(true) 42 | .setTooltip(getText("autoScaleGUI.tooltip"), getText("autoScaleGUI.tooltip2")) 43 | .setSaveConsumer(value -> config.autoScaleGUI = value) 44 | .build()); 45 | 46 | category.addEntry(entryBuilder.startBooleanToggle(getText("injectIcon"), config.injectIcon) 47 | .setDefaultValue(true) 48 | .setTooltip(getText("injectIcon.tooltip")) 49 | .requireRestart() 50 | .setSaveConsumer(value -> config.injectIcon = value) 51 | .build()); 52 | 53 | category.addEntry(entryBuilder.startBooleanToggle(getText("keyModifiersFix"), config.keyModifiersFix) 54 | .setDefaultValue(true) 55 | .setTooltip(getText("keyModifiersFix.tooltip")) 56 | .setSaveConsumer(value -> config.keyModifiersFix = value) 57 | .build()); 58 | 59 | if(!WindowHelper.canUseWindowHelper && WindowHelper.enabled) { 60 | category.addEntry(entryBuilder.startDropdownMenu(getText("monitorName"), DropdownMenuBuilder.TopCellElementBuilder.of(config.monitorName, (s) -> s)) 61 | .setDefaultValue("") 62 | .setSuggestionMode(false) 63 | .setTooltip(getText("monitorName.tooltip"), getText("monitorName.tooltip2"), getText("empty"), getText("monitorName.tooltip3")) 64 | .setSaveConsumer(value -> config.monitorName = value) 65 | .setSelections(Lists.newArrayList(monitors.keySet())) 66 | .build()); 67 | } 68 | 69 | return builder.build(); 70 | } 71 | 72 | private static Text getText(String key) { 73 | //? if >=1.19 { 74 | return Text.translatable("wayfix.option." + key); 75 | //?} elif <1.19 { 76 | /*return new TranslatableText("wayfix.option." + key); 77 | *///?} 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/config/ModConfig.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.config; 2 | 3 | import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; 4 | 5 | public class ModConfig { 6 | 7 | @Comment("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%)") 8 | public boolean autoScaleGUI = true; 9 | 10 | @Comment("Injects the Minecraft Icon at Startup instead of defaulting to the normal Wayland icon.") 11 | public boolean injectIcon = true; 12 | 13 | @Comment("Fixes issues where keyboard combinations like 'CTRL + A' or 'CTRL + C' are sent as characters in chat instead of being recognized as key combinations.") 14 | public boolean keyModifiersFix = true; 15 | 16 | @Comment("Full-screens the minecraft window in the selected monitor.\n[!] If you use KDE Plasma with kdotool installed then you can ignore this setting.\n\nPut the name of the monitor (that is shown in your OS monitor settings) in the quotes.\nIf you don't know the monitor of your name then you can put 'DP-x' (x being a number) e.g. DP-1\n\nLeave empty to use primary monitor.") 17 | public String monitorName = ""; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/GLXMixin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin; 2 | 3 | import com.mojang.blaze3d.platform.GLX; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | //? if ((forge || neoforge) && (1.16.5 || >=1.20.1)) || fabric { 6 | import org.lwjgl.glfw.GLFW; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | import java.util.function.LongSupplier; 12 | 13 | import static net.notcoded.wayfix.WayFix.supportsWayland; 14 | //?} 15 | 16 | /* 17 | - Credits to moehreag 18 | - https://github.com/moehreag/wayland-fixes 19 | */ 20 | 21 | @Mixin(GLX.class) 22 | public abstract class GLXMixin { 23 | //? if ((forge || neoforge) && (1.16.5 || >=1.20.1)) || fabric { 24 | 25 | @Inject(method = "_initGlfw", at = @At("HEAD"), remap = false) 26 | private static void preGLFWInit(CallbackInfoReturnable cir) { 27 | if (supportsWayland()) { 28 | GLFW.glfwInitHint(GLFW.GLFW_PLATFORM, GLFW.GLFW_PLATFORM_WAYLAND); // enable wayland backend if supported 29 | } 30 | } 31 | //?} 32 | } -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/MinecraftClientMixin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin; 2 | 3 | import net.minecraft.client.MinecraftClient; 4 | import net.minecraft.client.util.Window; 5 | 6 | import net.notcoded.wayfix.WayFix; 7 | import org.lwjgl.glfw.GLFW; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Unique; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | 12 | import org.spongepowered.asm.mixin.injection.Redirect; 13 | 14 | //? if forge || neoforge { 15 | /*import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | import net.notcoded.wayfix.platforms.ModPlatform; 18 | *///?} 19 | 20 | //? if forge { 21 | /*import net.notcoded.wayfix.platforms.forge.WayFixForge; 22 | 23 | //? if >1.16.5 <1.20.1 { 24 | /^import com.mojang.blaze3d.systems.RenderSystem; 25 | import static net.notcoded.wayfix.WayFix.supportsWayland; 26 | ^///?} 27 | 28 | //? if >1.16.5 <1.19.2 { 29 | /^import java.util.function.LongSupplier; 30 | ^///?} 31 | 32 | //? if 1.19.2 || 1.19.3 { 33 | /^import net.minecraft.util.TimeSupplier; 34 | ^///?} 35 | 36 | *///?} 37 | 38 | //? if neoforge { 39 | /*import net.notcoded.wayfix.platforms.neoforge.WayFixNeoForge; 40 | *///?} 41 | 42 | @Mixin(MinecraftClient.class) 43 | public abstract class MinecraftClientMixin { 44 | @Redirect(method = "onResolutionChanged", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;calculateScaleFactor(IZ)I")) 45 | private int fixHiDPIScaling(Window instance, int guiScale, boolean forceUnicodeFont) { 46 | // "Auto" or Gui Scale 0 already auto-scales it 47 | if (guiScale != 0 && WayFix.config.autoScaleGUI) { 48 | guiScale = Math.round(guiScale * wayfix$getScaleFactor(instance)); 49 | } 50 | 51 | return instance.calculateScaleFactor(guiScale, forceUnicodeFont); 52 | } 53 | 54 | //? if forge { 55 | 56 | /*//? if >1.16.5 <1.20.1 { 57 | /^//? if >1.16.5 <1.19.2 { 58 | /^¹@Redirect(method = "", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;initBackendSystem()Ljava/util/function/LongSupplier;")) 59 | private LongSupplier preGLFWInit(){ 60 | ¹^///?} elif 1.19.2 || 1.19.3 { 61 | /^¹@Redirect(method = "", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;initBackendSystem()Lnet/minecraft/util/TimeSupplier$Nanoseconds;")) 62 | private TimeSupplier.Nanoseconds preGLFWInit(){ 63 | ¹^///?} 64 | if (supportsWayland()) { 65 | GLFW.glfwInitHint(GLFW.GLFW_PLATFORM, GLFW.GLFW_PLATFORM_WAYLAND); // enable wayland backend if supported 66 | } 67 | return RenderSystem.initBackendSystem(); 68 | } 69 | ^///?} 70 | 71 | *///?} 72 | 73 | @Unique 74 | private float wayfix$getScaleFactor(Window instance) { 75 | float[] pos = new float[1]; 76 | GLFW.glfwGetWindowContentScale(instance.getHandle(), pos, pos); 77 | 78 | return pos[0]; // using x or y doesn't matter 79 | } 80 | 81 | //? if forge || neoforge { 82 | /*@Inject(method = "", at = @At("HEAD")) 83 | private static void initMod(CallbackInfo ci) { 84 | ModPlatform platform; 85 | 86 | //? if neoforge { 87 | /^platform = new WayFixNeoForge.NeoForgePlatform(); 88 | ^///?} 89 | 90 | //? if forge { 91 | /^platform = new WayFixForge.ForgePlatform(); 92 | ^///?} 93 | 94 | WayFix.init(platform); 95 | } 96 | 97 | @Inject(method = "", at = @At("RETURN")) 98 | private void checkEarlyWindow(CallbackInfo ci) { 99 | //? if neoforge { 100 | /^WayFixNeoForge.checkEarlyWindow(); 101 | ^///?} 102 | 103 | //? if forge { 104 | /^WayFixForge.checkEarlyWindow(); 105 | ^///?} 106 | } 107 | *///?} 108 | } -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/MonitorFixWindowMixin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin; 2 | 3 | import net.minecraft.client.util.Monitor; 4 | import net.minecraft.client.util.MonitorTracker; 5 | import net.minecraft.client.util.Window; 6 | import net.notcoded.wayfix.WayFix; 7 | import net.notcoded.wayfix.config.ModClothConfig; 8 | import net.notcoded.wayfix.util.WindowHelper; 9 | import org.lwjgl.glfw.GLFW; 10 | import org.spongepowered.asm.mixin.Final; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Shadow; 13 | import org.spongepowered.asm.mixin.Unique; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.Redirect; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | 22 | @Mixin(Window.class) 23 | public abstract class MonitorFixWindowMixin { 24 | 25 | @Shadow protected abstract void onWindowPosChanged(long window, int x, int y); 26 | 27 | @Shadow @Final private long handle; 28 | 29 | @Redirect(method = "updateWindowRegion", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/MonitorTracker;getMonitor(Lnet/minecraft/client/util/Window;)Lnet/minecraft/client/util/Monitor;")) 30 | private Monitor fixWrongMonitor(MonitorTracker instance, Window window) { 31 | return WindowHelper.canUseWindowHelper ? instance.getMonitor(window) : wayfix$getMonitor(instance); 32 | } 33 | 34 | @Unique 35 | private Monitor wayfix$getMonitor(MonitorTracker instance) { 36 | String monitorName = WayFix.config.monitorName; 37 | long monitorID = GLFW.glfwGetPrimaryMonitor(); 38 | if(!monitorName.trim().isEmpty()) { 39 | monitorID = ModClothConfig.monitors.getOrDefault(monitorName, 0L); 40 | if(monitorID == 0L && 41 | monitorName.toLowerCase().startsWith("dp-") && 42 | Character.isDigit(monitorName.charAt(monitorName.length() - 1)) 43 | ) { 44 | ArrayList values = new ArrayList<>(ModClothConfig.monitors.values()); 45 | values.sort(Collections.reverseOrder()); 46 | 47 | try { 48 | monitorID = values.get(Integer.parseInt(monitorName.substring(monitorName.length() - 1)) - 1); 49 | } catch (Exception ignored) { } 50 | } 51 | } 52 | 53 | 54 | 55 | if(monitorID <= 0 || instance.getMonitor(monitorID) == null) { 56 | WayFix.LOGGER.warn("Error occurred while trying to set monitor."); 57 | WayFix.LOGGER.warn("Using primary monitor instead."); 58 | monitorID = GLFW.glfwGetPrimaryMonitor(); 59 | } 60 | 61 | return instance.getMonitor(monitorID); 62 | } 63 | 64 | 65 | // KDE Plasma ONLY 66 | @Inject(method = "updateWindowRegion", at = @At("HEAD")) 67 | private void fixWrongMonitor(CallbackInfo ci) { 68 | if(!WindowHelper.canUseWindowHelper) return; 69 | 70 | int[] pos = WindowHelper.getWindowPos(); 71 | if(pos == null) return; 72 | 73 | onWindowPosChanged(this.handle, pos[0], pos[1]); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/MonitorTrackerMixin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin; 2 | 3 | import it.unimi.dsi.fastutil.longs.Long2ObjectMap; 4 | import net.minecraft.client.util.Monitor; 5 | import net.minecraft.client.util.MonitorTracker; 6 | import net.notcoded.wayfix.config.ModClothConfig; 7 | import net.notcoded.wayfix.util.WindowHelper; 8 | import org.lwjgl.glfw.GLFW; 9 | import org.spongepowered.asm.mixin.Final; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.Unique; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | 17 | @Mixin(MonitorTracker.class) 18 | public class MonitorTrackerMixin { 19 | @Shadow @Final private Long2ObjectMap pointerToMonitorMap; 20 | 21 | @Inject(method = {"handleMonitorEvent", ""}, at = @At("RETURN")) 22 | private void handleConfigAdditions(CallbackInfo ci) { 23 | if(!WindowHelper.canUseWindowHelper) this.wayfix$refreshMonitors(); 24 | } 25 | 26 | @Unique 27 | private void wayfix$refreshMonitors() { 28 | this.pointerToMonitorMap.forEach((aLong, monitor1) -> 29 | ModClothConfig.monitors.put(GLFW.glfwGetMonitorName(aLong), aLong) 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/TextFieldWidgetMixin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin; 2 | 3 | import net.minecraft.client.gui.screen.Screen; 4 | import net.minecraft.client.gui.widget.TextFieldWidget; 5 | import net.notcoded.wayfix.WayFix; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Unique; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | import static java.lang.Character.toLowerCase; 13 | 14 | /* 15 | - Credits to wired-tomato 16 | - https://github.com/wired-tomato/WayGL 17 | */ 18 | 19 | @Mixin(TextFieldWidget.class) 20 | public class TextFieldWidgetMixin { 21 | @Inject(method = "charTyped", at = @At("HEAD"), cancellable = true) 22 | private void charTyped(char chr, int modifiers, CallbackInfoReturnable cir) { 23 | if (WayFix.config.keyModifiersFix && WayFix.isWayland() && wayfix$isSpecialChar(toLowerCase(chr)) && Screen.hasControlDown()) cir.setReturnValue(false); 24 | } 25 | 26 | @Unique 27 | private boolean wayfix$isSpecialChar(char chr) { 28 | return chr == 'a' // CTRL + A (select all) 29 | || chr == 'v' // CTRL + V (paste) 30 | || chr == 'c' // CTRL + C (copy) 31 | || chr == 'x'; // CTRL + X (cut) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/WindowMixin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin; 2 | 3 | import net.minecraft.client.util.Monitor; 4 | import net.minecraft.client.util.MonitorTracker; 5 | import net.minecraft.client.util.Window; 6 | import net.notcoded.wayfix.WayFix; 7 | import net.notcoded.wayfix.config.ModClothConfig; 8 | import net.notcoded.wayfix.util.DesktopFileInjector; 9 | import net.notcoded.wayfix.util.WindowHelper; 10 | import org.lwjgl.glfw.GLFW; 11 | import org.spongepowered.asm.mixin.Final; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.Shadow; 14 | import org.spongepowered.asm.mixin.Unique; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Inject; 17 | import org.spongepowered.asm.mixin.injection.Redirect; 18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | 22 | import static net.notcoded.wayfix.WayFix.isWayland; 23 | 24 | //? if >=1.20 { 25 | 26 | import net.minecraft.client.util.Icons; 27 | import net.minecraft.resource.ResourcePack; 28 | import java.io.IOException; 29 | //?} elif 1.19.3 { 30 | /*import java.util.ArrayList; 31 | import java.util.Arrays; 32 | import net.minecraft.resource.InputSupplier; 33 | *///?} 34 | 35 | //? if <1.20 { 36 | /*import java.io.InputStream; 37 | *///?} 38 | 39 | /* 40 | - Credits to moehreag for most of the code 41 | - https://github.com/moehreag/wayland-fixes 42 | */ 43 | 44 | @Mixin(Window.class) 45 | public abstract class WindowMixin { 46 | // forge only allows injecting into constructors on return, this is a jank fix, but it works 47 | //? if forge || (neoforge && 1.20.4) { 48 | /*@Redirect(method = "", at = @At(value = "INVOKE", target = "Lorg/lwjgl/glfw/GLFW;glfwDefaultWindowHints()V", remap = false)) 49 | *///?} else { 50 | @Inject(method = "", at = @At(value = "INVOKE", target = "Lorg/lwjgl/glfw/GLFW;glfwDefaultWindowHints()V", shift = At.Shift.AFTER, remap = false)) 51 | private void onWindowHints(CallbackInfo ci) { 52 | //?} 53 | //? if forge || (neoforge && 1.20.4) { 54 | /*private void onWindowHints() { 55 | GLFW.glfwDefaultWindowHints(); 56 | *///?} 57 | if (isWayland()) { 58 | GLFW.glfwWindowHint(GLFW.GLFW_FOCUS_ON_SHOW, GLFW.GLFW_FALSE); 59 | 60 | if(WayFix.config.injectIcon) DesktopFileInjector.inject(); 61 | GLFW.glfwWindowHintString(GLFW.GLFW_WAYLAND_APP_ID, DesktopFileInjector.APP_ID); 62 | } 63 | } 64 | 65 | @Inject(method = "setIcon", at = @At("HEAD"), cancellable = true) 66 | //? if >=1.20 { 67 | 68 | private void injectIcon(ResourcePack resourcePack, Icons icons, CallbackInfo ci) { 69 | //?} elif 1.19.3 { 70 | /*private void injectIcon(InputSupplier smallIconSupplier, InputSupplier bigIconSupplier, CallbackInfo ci) { 71 | *///?} elif <1.19.3 { 72 | 73 | /*private void injectIcon(InputStream icon16, InputStream icon32, CallbackInfo ci) { 74 | *///?} 75 | if (isWayland()) { 76 | //? if >=1.20 { 77 | try { 78 | DesktopFileInjector.setIcon(icons.getIcons(resourcePack)); 79 | } catch (IOException ignored) { } 80 | //?} elif 1.19.3 { 81 | /*DesktopFileInjector.setIcon(new ArrayList<>(Arrays.asList(smallIconSupplier, bigIconSupplier))); 82 | *///?} elif <1.19.3 { 83 | 84 | /*DesktopFileInjector.setIcon(icon16, icon32); 85 | *///?} 86 | 87 | ci.cancel(); 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/mixin/compat/MixinPlugin.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.mixin.compat; 2 | 3 | //?if fabric { 4 | import net.fabricmc.loader.api.FabricLoader; 5 | //?} 6 | import net.notcoded.wayfix.util.WindowHelper; 7 | import org.objectweb.asm.tree.ClassNode; 8 | import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; 9 | import org.spongepowered.asm.mixin.extensibility.IMixinInfo; 10 | 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | public class MixinPlugin implements IMixinConfigPlugin { 15 | @Override 16 | public void onLoad(String s) { 17 | 18 | } 19 | 20 | @Override 21 | public String getRefMapperConfig() { 22 | return null; 23 | } 24 | 25 | @Override 26 | public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { 27 | //?if fabric { 28 | if(mixinClassName.equals("net.notcoded.wayfix.mixin.MonitorFixWindowMixin") 29 | && FabricLoader.getInstance().isModLoaded("vulkanmod") 30 | ) { 31 | WindowHelper.enabled = false; 32 | return false; 33 | } 34 | //?} 35 | return true; 36 | } 37 | 38 | @Override 39 | public void acceptTargets(Set set, Set set1) { 40 | 41 | } 42 | 43 | @Override 44 | public List getMixins() { 45 | return null; 46 | } 47 | 48 | @Override 49 | public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { 50 | 51 | } 52 | 53 | @Override 54 | public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/platforms/ModPlatform.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.platforms; 2 | 3 | public interface ModPlatform { 4 | String getModLoader(); 5 | boolean isModLoaded(String modLoader); 6 | boolean isDevelopmentEnvironment(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/platforms/fabric/ModMenuIntegration.java: -------------------------------------------------------------------------------- 1 | //? if fabric { 2 | package net.notcoded.wayfix.platforms.fabric; 3 | 4 | import com.terraformersmc.modmenu.api.ConfigScreenFactory; 5 | import com.terraformersmc.modmenu.api.ModMenuApi; 6 | import net.notcoded.wayfix.config.ModClothConfig; 7 | 8 | public class ModMenuIntegration implements ModMenuApi { 9 | @Override 10 | public ConfigScreenFactory getModConfigScreenFactory() { 11 | return ModClothConfig::buildScreen; 12 | } 13 | } 14 | //?} 15 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/platforms/fabric/WayFixFabric.java: -------------------------------------------------------------------------------- 1 | //? if fabric { 2 | package net.notcoded.wayfix.platforms.fabric; 3 | 4 | import net.fabricmc.api.ClientModInitializer; 5 | import net.fabricmc.loader.api.FabricLoader; 6 | import net.notcoded.wayfix.WayFix; 7 | import net.notcoded.wayfix.platforms.ModPlatform; 8 | 9 | public class WayFixFabric implements ClientModInitializer { 10 | @Override 11 | public void onInitializeClient() { 12 | WayFix.init(new FabricPlatform()); 13 | } 14 | 15 | public static class FabricPlatform implements ModPlatform { 16 | 17 | @Override 18 | public String getModLoader() { 19 | return "Fabric"; 20 | } 21 | 22 | @Override 23 | public boolean isModLoaded(String modId) { 24 | return FabricLoader.getInstance().isModLoaded(modId); 25 | } 26 | 27 | @Override 28 | public boolean isDevelopmentEnvironment() { 29 | return FabricLoader.getInstance().isDevelopmentEnvironment(); 30 | } 31 | } 32 | } 33 | //?} -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/platforms/forge/WayFixForge.java: -------------------------------------------------------------------------------- 1 | //? if forge { 2 | /*package net.notcoded.wayfix.platforms.forge; 3 | 4 | import net.minecraftforge.api.distmarker.Dist; 5 | import net.minecraftforge.api.distmarker.OnlyIn; 6 | import net.minecraftforge.fml.DistExecutor; 7 | import net.minecraftforge.fml.ModList; 8 | import net.minecraftforge.fml.ModLoadingContext; 9 | import net.minecraftforge.fml.common.Mod; 10 | import net.minecraftforge.fml.loading.FMLLoader; 11 | import net.notcoded.wayfix.config.ModClothConfig; 12 | import net.notcoded.wayfix.platforms.ModPlatform; 13 | 14 | //? if >=1.20.1 { 15 | import net.minecraft.text.Text; 16 | import net.minecraft.client.MinecraftClient; 17 | import net.minecraft.client.toast.SystemToast; 18 | import net.minecraftforge.fml.loading.FMLConfig; 19 | //?} 20 | //? if >=1.19 { 21 | import net.minecraftforge.client.ConfigScreenHandler; 22 | //?} elif 1.18.2 { 23 | /^import net.minecraftforge.client.ConfigGuiHandler; 24 | ^///?} elif 1.17.1 { 25 | /^import net.minecraftforge.fmlclient.ConfigGuiHandler; 26 | ^///?} elif 1.16.5 { 27 | /^import net.minecraftforge.fml.ExtensionPoint; 28 | ^///?} 29 | 30 | @Mod("wayfix") 31 | @OnlyIn(Dist.CLIENT) 32 | public class WayFixForge { 33 | public WayFixForge() { 34 | DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> WayFixForge::setupConfigScreen); 35 | } 36 | 37 | private static void setupConfigScreen() { 38 | //? if >=1.19 { 39 | ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> 40 | new ConfigScreenHandler.ConfigScreenFactory( 41 | (client, parent) -> ModClothConfig.buildScreen(parent) 42 | ) 43 | ); 44 | //?} elif >1.16.5 <1.19 { 45 | /^ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, () -> 46 | new ConfigGuiHandler.ConfigGuiFactory((client, parent) -> ModClothConfig.buildScreen(parent) 47 | )); 48 | ^///?} elif 1.16.5 { 49 | /^ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY, () -> 50 | (client, parent) -> ModClothConfig.buildScreen(parent) 51 | ); 52 | ^///?} 53 | } 54 | 55 | 56 | public static void checkEarlyWindow() { 57 | 58 | //? if >=1.20.1 { 59 | try { 60 | if(!FMLConfig.getBoolConfigValue(FMLConfig.ConfigValue.EARLY_WINDOW_CONTROL)) return; 61 | FMLConfig.updateConfig(FMLConfig.ConfigValue.EARLY_WINDOW_CONTROL, false); 62 | 63 | MinecraftClient.getInstance().getToastManager().add(new SystemToast(SystemToast.Type.WORLD_BACKUP, 64 | Text.translatable("wayfix.toast.restart-game.title"), 65 | Text.translatable("wayfix.toast.restart-game.description")) 66 | ); 67 | } catch(Exception ignored) { } 68 | 69 | //?} 70 | } 71 | 72 | public static class ForgePlatform implements ModPlatform { 73 | @Override 74 | public String getModLoader() { 75 | return "Forge"; 76 | } 77 | 78 | @Override 79 | public boolean isModLoaded(String modId) { 80 | return ModList.get().isLoaded(modId); 81 | } 82 | 83 | @Override 84 | public boolean isDevelopmentEnvironment() { 85 | return !FMLLoader.isProduction(); 86 | } 87 | } 88 | } 89 | *///?} -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/platforms/neoforge/WayFixNeoForge.java: -------------------------------------------------------------------------------- 1 | //? if neoforge { 2 | /*package net.notcoded.wayfix.platforms.neoforge; 3 | 4 | import net.minecraft.client.MinecraftClient; 5 | import net.minecraft.client.toast.SystemToast; 6 | import net.minecraft.text.Text; 7 | import net.neoforged.fml.ModList; 8 | import net.neoforged.fml.loading.FMLConfig; 9 | import net.neoforged.fml.ModLoadingContext; 10 | import net.neoforged.fml.common.Mod; 11 | import net.neoforged.fml.loading.FMLLoader; 12 | import net.notcoded.wayfix.WayFix; 13 | import net.notcoded.wayfix.config.ModClothConfig; 14 | import net.notcoded.wayfix.platforms.ModPlatform; 15 | //? if <1.20.6 { 16 | /^import net.neoforged.neoforge.client.ConfigScreenHandler; 17 | ^///?} else { 18 | import net.neoforged.neoforge.client.gui.IConfigScreenFactory; 19 | //?} 20 | @Mod("wayfix") 21 | public class WayFixNeoForge { 22 | public WayFixNeoForge() { 23 | ModLoadingContext.get().registerExtensionPoint( 24 | //? if <1.20.6 { 25 | /^ConfigScreenHandler.ConfigScreenFactory.class, 26 | () -> new ConfigScreenHandler.ConfigScreenFactory( 27 | ((client, parent) -> ModClothConfig.buildScreen(parent)) 28 | ) 29 | ^///?} else { 30 | IConfigScreenFactory.class, 31 | () -> (client, parent) -> ModClothConfig.buildScreen(parent) 32 | //?} 33 | ); 34 | } 35 | 36 | public static void checkEarlyWindow() { 37 | if(!FMLConfig.getBoolConfigValue(FMLConfig.ConfigValue.EARLY_WINDOW_CONTROL)) return; 38 | FMLConfig.updateConfig(FMLConfig.ConfigValue.EARLY_WINDOW_CONTROL, false); 39 | 40 | try { 41 | MinecraftClient.getInstance().getToastManager().add(new SystemToast(SystemToast.Type.WORLD_BACKUP, 42 | Text.translatable("wayfix.toast.restart-game.title"), 43 | Text.translatable("wayfix.toast.restart-game.description")) 44 | ); 45 | } catch (Exception ignored) { 46 | WayFix.LOGGER.warn("Restart your game! The early loading screen has been disabled."); 47 | } 48 | 49 | } 50 | 51 | public static class NeoForgePlatform implements ModPlatform { 52 | @Override 53 | public String getModLoader() { 54 | return "NeoForge"; 55 | } 56 | 57 | @Override 58 | public boolean isModLoaded(String modId) { 59 | return ModList.get().isLoaded(modId); 60 | } 61 | 62 | @Override 63 | public boolean isDevelopmentEnvironment() { 64 | return !FMLLoader.isProduction(); 65 | } 66 | } 67 | } 68 | *///?} -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.util; 2 | 3 | import net.minecraft.client.MinecraftClient; 4 | //? if >=1.19.3 { 5 | import net.minecraft.resource.InputSupplier; 6 | import java.util.List; 7 | //?} elif <1.19.3 { 8 | /*import java.util.ArrayList; 9 | import java.util.Arrays; 10 | import java.io.ByteArrayInputStream; 11 | *///?} 12 | import net.notcoded.wayfix.WayFix; 13 | import org.apache.commons.io.IOUtils; 14 | import javax.imageio.ImageIO; 15 | import java.awt.image.BufferedImage; 16 | import java.io.File; 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.nio.charset.StandardCharsets; 20 | import java.nio.file.Files; 21 | import java.nio.file.Path; 22 | import java.util.Objects; 23 | 24 | /* 25 | - Credits to moehreag for most of the code 26 | - https://github.com/moehreag/wayland-fixes 27 | */ 28 | 29 | public class DesktopFileInjector { 30 | // The taskbar icon is set to the minecraft launcher's icon if you have it installed 31 | // Adding '.java-edition' fixes it (due to being recognized as a new app) 32 | public static final String APP_ID = "com.mojang.minecraft.java-edition"; 33 | 34 | private static final String ICON_NAME = "minecraft.png"; 35 | private static final String FILE_NAME = APP_ID + ".desktop"; 36 | private static final String RESOURCE_LOCATION = "/assets/wayfix/" + FILE_NAME; 37 | 38 | public static void inject() { 39 | try (InputStream stream = DesktopFileInjector.class.getResourceAsStream(RESOURCE_LOCATION)) { 40 | Path location = getDesktopFileLocation(); 41 | 42 | String desktop = System.getenv("XDG_CURRENT_DESKTOP"); 43 | String version = MinecraftClient.getInstance().getGameVersion(); 44 | injectFile(location, String.format(IOUtils.toString(Objects.requireNonNull(stream), StandardCharsets.UTF_8), 45 | version, ICON_NAME.substring(0, ICON_NAME.lastIndexOf(".")), !desktop.contains("GNOME") ? "Hidden=true" : "").getBytes(StandardCharsets.UTF_8)); 46 | } catch (IOException e) { 47 | WayFix.LOGGER.error("Failed to inject icon: ", e); 48 | } 49 | 50 | } 51 | 52 | //? if >=1.19.3 { 53 | public static void setIcon(List> icons) { 54 | if(!WayFix.config.injectIcon) return; 55 | for (InputSupplier supplier : icons) { 56 | try { 57 | BufferedImage image = ImageIO.read(supplier.get()); 58 | Path target = getIconFileLocation(image.getWidth(), image.getHeight()); 59 | injectFile(target, IOUtils.toByteArray(supplier.get())); 60 | 61 | } catch (IOException e) { 62 | return; 63 | } 64 | } 65 | updateIconSystem(); 66 | } 67 | //?} elif <1.19.3 { 68 | 69 | /*public static void setIcon(InputStream icon16, InputStream icon32) { 70 | if(!WayFix.config.injectIcon) return; 71 | byte[] icon16Byte; 72 | byte[] icon32Byte; 73 | 74 | try { 75 | // https://stackoverflow.com/questions/58534138/does-files-readallbytes-closes-the-inputstream-after-reading-the-file 76 | //? if >=1.18.2 { 77 | icon16Byte = icon16.readAllBytes(); 78 | icon32Byte = icon32.readAllBytes(); 79 | //?} elif <1.18.2 { 80 | /^icon16Byte = IOUtils.toByteArray(icon16); 81 | icon32Byte = IOUtils.toByteArray(icon32); 82 | ^///?} 83 | } catch (IOException e) { 84 | e.printStackTrace(); 85 | return; 86 | } 87 | 88 | ArrayList icons = new ArrayList<>(Arrays.asList(icon16Byte, icon32Byte)); 89 | for(byte[] bytes : icons) { 90 | try { 91 | BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes)); 92 | Path target = getIconFileLocation(image.getWidth(), image.getHeight()); 93 | injectFile(target, bytes); 94 | } catch (IOException e) { 95 | e.printStackTrace(); 96 | return; 97 | } 98 | } 99 | 100 | updateIconSystem(); 101 | } 102 | *///?} 103 | 104 | private static void injectFile(Path target, byte[] data) { 105 | try { 106 | Files.createDirectories(target.getParent()); 107 | new File(String.valueOf(Files.write(target, data))).deleteOnExit(); 108 | } catch (IOException e) { 109 | WayFix.LOGGER.error("Failed to inject file: ", e); 110 | } 111 | } 112 | 113 | 114 | private static Path getIconFileLocation(int width, int height) { 115 | return XDGPathResolver.getUserDataLocation().resolve("icons/hicolor").resolve(width + "x" + height) 116 | .resolve("apps").resolve(ICON_NAME); 117 | } 118 | 119 | private static Path getDesktopFileLocation() { 120 | return XDGPathResolver.getUserDataLocation().resolve("applications").resolve(FILE_NAME); 121 | } 122 | 123 | private static void updateIconSystem() { 124 | String desktop = System.getenv("XDG_CURRENT_DESKTOP"); 125 | 126 | String[] process = new String[]{"xdg-icon-resource", "forceupdate"}; 127 | 128 | if(desktop.contains("KDE")) { 129 | // https://www.reddit.com/r/kde/comments/g986ql/comment/fovvkod 130 | process = new String[]{"dbus-send", "--session", "/KGlobalSettings", "org.kde.KGlobalSettings.notifyChange", "int32:0", "int32:0"}; 131 | } else if(desktop.contains("GNOME")) { 132 | process = new String[]{"gtk-update-icon-cache"}; 133 | } 134 | 135 | ProcessBuilder builder = new ProcessBuilder(process); 136 | try { 137 | builder.start(); 138 | 139 | if(desktop.contains("KDE")) { 140 | new ProcessBuilder("dbus-send", "--session", "/KIconLoader", "org.kde.KIconLoader.iconChanged", "int32:0", "int32:0").start(); 141 | } 142 | 143 | } catch (IOException ignored) { 144 | WayFix.LOGGER.warn("Failed to update the icon cache, you might see the incorrect icons for the game."); 145 | } 146 | } 147 | } -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/util/WindowHelper.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.util; 2 | 3 | import net.minecraft.client.MinecraftClient; 4 | import net.notcoded.wayfix.WayFix; 5 | //? if <1.19 { 6 | /*import org.apache.commons.io.IOUtils; 7 | *///?} 8 | 9 | import java.io.IOException; 10 | import java.util.regex.Matcher; 11 | import java.util.regex.Pattern; 12 | 13 | public class WindowHelper { 14 | 15 | public static boolean enabled = true; 16 | 17 | public static boolean canUseWindowHelper = false; 18 | 19 | public static void checkIfCanUseWindowHelper() { 20 | if(!System.getenv("XDG_CURRENT_DESKTOP").contains("KDE")) return; // kdotool only works with KDE and I haven't found an alternative. 21 | 22 | try { 23 | new ProcessBuilder("kdotool").start(); 24 | canUseWindowHelper = true; 25 | } catch (IOException ignored) { 26 | WayFix.LOGGER.warn("WayFix recommends installing 'kdotool' to properly fix the minecraft full-screening functionality."); 27 | 28 | } 29 | } 30 | 31 | private static String windowID = ""; 32 | 33 | public static int[] getWindowPos() { 34 | if(windowID.trim().isEmpty() && !setWindowID()) return null; 35 | 36 | String[] command = new String[]{"kdotool", "getwindowgeometry", windowID}; 37 | 38 | ProcessBuilder builder = new ProcessBuilder(command); 39 | 40 | try { 41 | Process process = builder.start(); 42 | //? if >=1.18.2 { 43 | String result = new String(process.getInputStream().readAllBytes()); 44 | //?} elif <1.18.2 { 45 | /*String result = new String(IOUtils.toByteArray(process.getInputStream())); 46 | *///?} 47 | Pattern pattern = Pattern.compile("Position:\\s*(\\d+),(\\d+)"); 48 | Matcher matcher = pattern.matcher(result); 49 | if (matcher.find()) { 50 | return new int[]{Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2))}; 51 | } else { 52 | return null; 53 | } 54 | } catch (IOException ignored) { 55 | return null; 56 | } 57 | } 58 | 59 | public static boolean setWindowID() { 60 | if(!MinecraftClient.getInstance().isWindowFocused()) return false; 61 | String[] command = new String[]{"kdotool", "getactivewindow", "getwindowgeometry"}; 62 | 63 | ProcessBuilder builder = new ProcessBuilder(command); 64 | 65 | try { 66 | Process process = builder.start(); 67 | //? if >=1.18.2 { 68 | String result = new String(process.getInputStream().readAllBytes()); 69 | //?} elif <1.18.2 { 70 | /*String result = new String(IOUtils.toByteArray(process.getInputStream())); 71 | *///?} 72 | Pattern pattern = Pattern.compile("Window \\{(\\w+-\\w+-\\w+-\\w+-\\w+)}"); 73 | Matcher matcher = pattern.matcher(result); 74 | if (matcher.find()) { 75 | windowID = "{" + matcher.group(1) + "}"; // let's just hope this is the minecraft window 🙏 76 | return true; 77 | } 78 | return false; 79 | } catch (IOException ignored) { 80 | return false; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/net/notcoded/wayfix/util/XDGPathResolver.java: -------------------------------------------------------------------------------- 1 | package net.notcoded.wayfix.util; 2 | 3 | import java.nio.file.Path; 4 | import java.nio.file.Paths; 5 | 6 | /* 7 | - Credits to moehreag 8 | - https://github.com/moehreag/wayland-fixes 9 | */ 10 | 11 | public class XDGPathResolver { 12 | 13 | private static Path getHome(){ 14 | String home = System.getenv().getOrDefault("HOME", System.getProperty("user.home")); 15 | if (home == null || home.isEmpty()) { 16 | throw new IllegalStateException("could not resolve user home"); 17 | } 18 | return Paths.get(home); 19 | } 20 | 21 | public static Path getUserDataLocation() { 22 | String xdgDataHome = System.getenv("XDG_DATA_HOME"); 23 | if (xdgDataHome == null || xdgDataHome.isEmpty()) { 24 | return getHome().resolve(".local/share/"); 25 | } 26 | return Paths.get(xdgDataHome); 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "*" 3 | issueTrackerURL = "https://github.com/not-coded/WayFix/issues" 4 | displayURL = "https://modrinth.com/mod/wayfix" 5 | license = "LGPL-2.1" 6 | 7 | [[mods]] 8 | modId = "wayfix" 9 | version = "${version}" 10 | displayName = "WayFix" 11 | authors = "NotCoded" 12 | description = "Fixes multiple issues regarding Wayland compatibility for Minecraft." 13 | logoFile = "icon.png" 14 | logoBlur = false 15 | 16 | [[dependencies.wayfix]] 17 | modId = "minecraft" 18 | type = "required" 19 | mandatory = true 20 | versionRange = "${minecraftVersion}" 21 | ordering = "NONE" 22 | side = "CLIENT" 23 | 24 | [[dependencies.wayfix]] 25 | modId = "cloth${cloth_config_separator}config" 26 | type = "required" 27 | mandatory = true 28 | versionRange = "[4.17.101,)" 29 | ordering = "AFTER" 30 | side = "CLIENT" 31 | 32 | [[mixins]] 33 | config = "wayfix.mixins.json" -------------------------------------------------------------------------------- /src/main/resources/META-INF/neoforge.mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "*" 3 | issueTrackerURL = "https://github.com/not-coded/WayFix/issues" 4 | displayURL = "https://modrinth.com/mod/wayfix" 5 | license = "LGPL-2.1" 6 | 7 | [[mods]] 8 | modId = "wayfix" 9 | version = "${version}" 10 | displayName = "WayFix" 11 | authors = "NotCoded" 12 | description = "Fixes multiple issues regarding Wayland compatibility for Minecraft." 13 | logoFile = "icon.png" 14 | logoBlur = false 15 | 16 | [[dependencies.wayfix]] 17 | modId = "minecraft" 18 | type = "required" 19 | versionRange = "${minecraftVersion}" 20 | ordering = "NONE" 21 | side = "CLIENT" 22 | 23 | [[dependencies.wayfix]] 24 | modId = "cloth_config" 25 | type = "required" 26 | versionRange = "[4.17.101,)" 27 | ordering = "AFTER" 28 | side = "CLIENT" 29 | 30 | [[mixins]] 31 | config = "wayfix.mixins.json" -------------------------------------------------------------------------------- /src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Minecraft %s 3 | Comment=Explore your own unique world, survive the night, and create anything you can imagine! 4 | Icon=%s 5 | Type=Application 6 | NoDisplay=true 7 | Categories=Game; 8 | %s -------------------------------------------------------------------------------- /src/main/resources/assets/wayfix/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "wayfix.option.title": "WayFix Options", 3 | "wayfix.option.empty": " ", 4 | 5 | "wayfix.option.autoScaleGUI": "Auto Scale GUI", 6 | "wayfix.option.autoScaleGUI.tooltip": "Auto-scales the GUI scale depending on your display's scaling.", 7 | "wayfix.option.autoScaleGUI.tooltip2": "(e.g. 2 GUI Scale on 1920x1080 at 100% → 4 GUI Scale on 3840x2160 at 200%)", 8 | 9 | "wayfix.option.injectIcon": "Inject Minecraft Icon at Startup", 10 | "wayfix.option.injectIcon.tooltip": "Injects the Minecraft Icon at Startup instead of defaulting to the normal Wayland icon.", 11 | 12 | "wayfix.option.keyModifiersFix": "Key Modifiers Fix", 13 | "wayfix.option.keyModifiersFix.tooltip": "Fixes issues where keyboard combinations like 'CTRL + A' or 'CTRL + C' are sent as characters in chat instead of being recognized as key combinations.", 14 | 15 | "wayfix.option.monitorName": "Select Monitor", 16 | "wayfix.option.monitorName.tooltip": "Full-screens the minecraft window in the selected monitor.", 17 | "wayfix.option.monitorName.tooltip2": "By default Minecraft sometimes full-screens on the wrong monitor due to Wayland limitations.", 18 | "wayfix.option.monitorName.tooltip3": "Leave empty to use primary monitor.", 19 | 20 | "wayfix.toast.restart-game.title": "WayFix: Restart your game!", 21 | "wayfix.toast.restart-game.description": "The early loading screen has been disabled." 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "wayfix", 4 | "version": "${version}", 5 | 6 | "name": "WayFix", 7 | "description": "Fixes multiple issues regarding Wayland compatibility for Minecraft.", 8 | "authors": [ 9 | "NotCoded" 10 | ], 11 | "contact": { 12 | "homepage": "https://modrinth.com/mod/wayfix", 13 | "sources": "https://github.com/not-coded/WayFix", 14 | "issues": "https://github.com/not-coded/WayFix/issues" 15 | }, 16 | 17 | "license": "LGPL-2.1", 18 | "icon": "icon.png", 19 | 20 | "environment": "client", 21 | "entrypoints": { 22 | "client": [ 23 | "net.notcoded.wayfix.platforms.fabric.WayFixFabric" 24 | ], 25 | "modmenu": [ 26 | "net.notcoded.wayfix.platforms.fabric.ModMenuIntegration" 27 | ] 28 | }, 29 | "mixins": [ 30 | "wayfix.mixins.json" 31 | ], 32 | 33 | "depends": { 34 | "fabricloader": ">=0.14.20", 35 | "cloth-config2": ">=4.17.101", 36 | "minecraft": "${minecraftVersion}", 37 | "java": ">=${javaVersion}" 38 | }, 39 | "recommends": { 40 | "modmenu": "*" 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/not-coded/WayFix/f936eca619e9fc505347f7feca397844509bb96f/src/main/resources/icon.png -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "WayFix: Fixes multiple issues regarding Wayland compatibility for Minecraft.", 4 | "pack_format": 15 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/wayfix.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "net.notcoded.wayfix.mixin", 5 | "compatibilityLevel": "JAVA_8", 6 | "client": [ 7 | "GLXMixin", 8 | "MinecraftClientMixin", 9 | "MonitorFixWindowMixin", 10 | "MonitorTrackerMixin", 11 | "TextFieldWidgetMixin", 12 | "WindowMixin" 13 | ], 14 | "injectors": { 15 | "defaultRequire": 1 16 | }, 17 | "plugin": "net.notcoded.wayfix.mixin.compat.MixinPlugin" 18 | } -------------------------------------------------------------------------------- /stonecutter.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("dev.kikugie.stonecutter") 3 | id("dev.architectury.loom") version "1.9.428" apply false 4 | id("architectury-plugin") version "3.4.161" apply false 5 | id("com.github.johnrengelman.shadow") version "8.1.1" apply false 6 | id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false 7 | } 8 | stonecutter active "1.20.6-fabric" /* [SC] DO NOT EDIT */ 9 | stonecutter.automaticPlatformConstants = true 10 | 11 | // Builds every version into `build/libs/{mod.version}/{loader}` 12 | stonecutter registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) { 13 | group = "project" 14 | ofTask("buildAndCollect") 15 | } 16 | stonecutter registerChiseled tasks.register("chiseledPublishMods", stonecutter.chiseled) { 17 | group = "project" 18 | ofTask("publishMods") 19 | } 20 | stonecutter registerChiseled tasks.register("chiseledRunAllClients", stonecutter.chiseled) { 21 | group = "project" 22 | ofTask("runClient") 23 | } 24 | 25 | 26 | 27 | // Builds loader-specific versions into `build/libs/{mod.version}/{loader}` 28 | for (it in stonecutter.tree.branches) { 29 | if (it.id.isEmpty()) continue 30 | val loader = it.id.upperCaseFirst() 31 | stonecutter registerChiseled tasks.register("chiseledBuild$loader", stonecutter.chiseled) { 32 | group = "project" 33 | versions { branch, _ -> branch == it.id } 34 | ofTask("buildAndCollect") 35 | } 36 | } 37 | 38 | // Runs active versions for each loader 39 | for (it in stonecutter.tree.nodes) { 40 | if (it.metadata != stonecutter.current || it.branch.id.isEmpty()) continue 41 | val types = listOf("Client", "Server") 42 | val loader = it.branch.id.upperCaseFirst() 43 | for (type in types) it.tasks.register("runActive$type$loader") { 44 | group = "project" 45 | dependsOn("run$type") 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /versions/1.16.5-fabric/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=>=1.16- <=1.18.2 2 | mod.version_name=1.16-1.18.2 3 | mod.mc_targets=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 4 | 5 | deps.yarn_build=10 6 | 7 | deps.cloth_config_version=4.17.101 8 | deps.mod_menu_version=1.16.23 9 | 10 | deps.java=8 11 | 12 | loom.platform=fabric -------------------------------------------------------------------------------- /versions/1.16.5-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.16, 1.16.5] 2 | mod.version_name=1.16.x 3 | mod.mc_targets=1.16,1.16.1,1.16.2,1.16.3,1.16.4,1.16.5 4 | 5 | deps.yarn_build=10 6 | deps.forge_loader=36.2.34 7 | 8 | deps.cloth_config_version=4.17.101 9 | 10 | deps.java=8 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.17.1-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.17, 1.17.1] 2 | mod.version_name=1.17.x 3 | mod.mc_targets=1.17,1.17.1 4 | 5 | deps.yarn_build=65 6 | deps.forge_loader=37.1.1 7 | 8 | deps.cloth_config_version=5.3.63 9 | 10 | deps.java=8 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.18.2-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.18, 1.18.2] 2 | mod.version_name=1.18.x 3 | mod.mc_targets=1.18,1.18.1,1.18.2 4 | 5 | deps.yarn_build=4 6 | deps.forge_loader=40.3.0 7 | 8 | deps.cloth_config_version=6.5.102 9 | 10 | deps.java=17 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.19-fabric/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=>=1.19- <=1.19.2 2 | mod.version_name=1.19-1.19.2 3 | mod.mc_targets=1.19,1.19.1,1.19.2 4 | 5 | deps.yarn_build=4 6 | 7 | deps.cloth_config_version=8.3.134 8 | deps.mod_menu_version=4.0.0 9 | 10 | deps.java=17 11 | 12 | loom.platform=fabric -------------------------------------------------------------------------------- /versions/1.19-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.19] 2 | mod.version_name=1.19 3 | mod.mc_targets=1.19 4 | 5 | deps.yarn_build=4 6 | deps.forge_loader=41.1.0 7 | 8 | deps.cloth_config_version=8.3.134 9 | 10 | deps.java=17 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.19.2-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.19.1, 1.19.2] 2 | mod.version_name=1.19.1-1.19.2 3 | mod.mc_targets=1.19.1,1.19.2 4 | 5 | deps.yarn_build=28 6 | deps.forge_loader=43.4.0 7 | 8 | deps.cloth_config_version=8.3.134 9 | 10 | deps.java=17 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.19.3-fabric/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=>=1.19.3- <=1.19.4 2 | mod.version_name=1.19.3-1.19.4 3 | mod.mc_targets=1.19.3,1.19.4 4 | 5 | deps.yarn_build=5 6 | 7 | deps.cloth_config_version=9.0.94 8 | deps.mod_menu_version=5.1.0 9 | 10 | deps.java=17 11 | 12 | loom.platform=fabric -------------------------------------------------------------------------------- /versions/1.19.3-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.19.3, 1.19.4] 2 | mod.version_name=1.19.3-1.19.4 3 | mod.mc_targets=1.19.3,1.19.4 4 | 5 | deps.yarn_build=5 6 | deps.forge_loader=44.1.0 7 | 8 | deps.cloth_config_version=9.0.94 9 | 10 | deps.java=17 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.20.1-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.20, 1.20.4] 2 | mod.version_name=1.20-1.20.4 3 | mod.mc_targets=1.20,1.20.1,1.20.2,1.20.3,1.20.4 4 | 5 | deps.yarn_build=10 6 | deps.forge_loader=47.3.0 7 | 8 | deps.cloth_config_version=11.1.136 9 | 10 | deps.java=17 11 | 12 | loom.platform=forge -------------------------------------------------------------------------------- /versions/1.20.4-neoforge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.20.2, 1.20.4] 2 | mod.version_name=1.20.2-1.20.4 3 | mod.mc_targets=1.20.2,1.20.3,1.20.4 4 | 5 | deps.yarn_build=1 6 | deps.neoforge_loader=20.4.237 7 | 8 | deps.cloth_config_version=13.0.138 9 | 10 | deps.java=17 11 | 12 | loom.platform=neoforge -------------------------------------------------------------------------------- /versions/1.20.6-fabric/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=>=1.20- <=1.22 2 | mod.version_name=1.20 3 | mod.mc_targets=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,1.21.5 4 | 5 | deps.yarn_build=1 6 | 7 | deps.cloth_config_version=14.0.139 8 | deps.mod_menu_version=10.0.0 9 | 10 | deps.java=17 11 | 12 | loom.platform=fabric 13 | -------------------------------------------------------------------------------- /versions/1.20.6-forge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.20.5,) 2 | mod.version_name=1.20.5 3 | mod.mc_targets=1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5 4 | 5 | deps.yarn_build=1 6 | deps.forge_loader=50.1.0 7 | 8 | deps.cloth_config_version=14.0.139 9 | 10 | deps.java=17 11 | 12 | loom.platform=forge 13 | -------------------------------------------------------------------------------- /versions/1.20.6-neoforge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.20.5,1.20.6] 2 | mod.version_name=1.20.5-1.20.6 3 | mod.mc_targets=1.20.5,1.20.6 4 | 5 | deps.yarn_build=1 6 | deps.neoforge_loader=20.6.125 7 | deps.neoforge_patch=1.20.6+build.4 8 | 9 | deps.cloth_config_version=14.0.139 10 | 11 | deps.java=21 12 | 13 | loom.platform=neoforge 14 | -------------------------------------------------------------------------------- /versions/1.21-neoforge/gradle.properties: -------------------------------------------------------------------------------- 1 | mod.mc_dep=[1.21,) 2 | mod.version_name=1.21 3 | mod.mc_targets=1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5 4 | 5 | deps.yarn_build=9 6 | deps.neoforge_loader=21.0.167 7 | deps.neoforge_patch=1.21+build.4 8 | 9 | deps.cloth_config_version=15.0.140 10 | 11 | deps.java=21 12 | 13 | loom.platform=neoforge 14 | --------------------------------------------------------------------------------