├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── crash_report.yml └── workflows │ └── publish.yml ├── .gitignore ├── HEADER ├── LICENSE ├── build.gradle ├── common ├── build.gradle └── src │ └── main │ ├── java │ └── org │ │ └── redlance │ │ └── dima_dencep │ │ └── mods │ │ └── rrls │ │ ├── Rrls.java │ │ ├── RrlsConfig.java │ │ ├── config │ │ ├── AprilFool.java │ │ ├── DoubleLoad.java │ │ ├── HideType.java │ │ └── Type.java │ │ ├── duck │ │ └── OverlayExtender.java │ │ ├── mixins │ │ ├── GameRendererMixin.java │ │ ├── LoadingOverlayMixin.java │ │ ├── MinecraftClientMixin.java │ │ ├── TitleScreenMixin.java │ │ ├── compat │ │ │ ├── ItemRendererMixin.java │ │ │ ├── OverlayMixin.java │ │ │ ├── RendererKeyboardMouseMixin.java │ │ │ └── ServerPackManagerMixin.java │ │ └── workaround │ │ │ ├── CompilationCacheMixin.java │ │ │ ├── EntityRenderDispatcherMixin.java │ │ │ ├── GlCommandEncoderMixin.java │ │ │ ├── GuiGraphicsMixin.java │ │ │ ├── ReloadableResourceManagerMixin.java │ │ │ ├── TextureManagerMixin.java │ │ │ └── textures │ │ │ └── AbstractTextureMixin.java │ │ ├── screens │ │ ├── ConfigurationSectionScreenProxy.java │ │ └── ConfigurationSectionScreenWithOverlay.java │ │ └── utils │ │ ├── DummyGuiGraphics.java │ │ ├── Ease.java │ │ ├── Easing.java │ │ ├── GuiGraphicsGenerator.java │ │ ├── OverlayHelper.java │ │ └── RainbowUtils.java │ └── resources │ ├── architectury.common.json │ ├── assets │ └── rrls │ │ └── lang │ │ ├── be_by.json │ │ ├── en_us.json │ │ ├── es_mx.json │ │ ├── it_it.json │ │ ├── pt_br.json │ │ ├── ru_ru.json │ │ ├── tt_ru.json │ │ ├── uk_ua.json │ │ ├── zh_cn.json │ │ └── zh_tw.json │ ├── icon.png │ ├── rrls.accesswidener │ └── rrls.mixins.json ├── fabric ├── build.gradle └── src │ └── main │ ├── java │ └── org │ │ └── redlance │ │ └── dima_dencep │ │ └── mods │ │ └── rrls │ │ └── fabric │ │ └── RrlsFabric.java │ └── resources │ └── fabric.mod.json ├── forge ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── java │ └── org │ │ └── redlance │ │ └── dima_dencep │ │ └── mods │ │ └── rrls │ │ └── neoforge │ │ ├── RrlsForge.java │ │ └── mixins │ │ ├── NeoForgeLoadingOverlayMixin.java │ │ └── ScreenMixin.java │ └── resources │ ├── META-INF │ └── neoforge.mods.toml │ └── rrls-forge.mixins.json ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | labels: bug 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: "Are you using the latest version of the mod? If not, try updating to see if it resolves your issue. You can [find the latest versions here](https://github.com/dimadencep/RemoveReloadingScreen/releases)." 8 | - type: input 9 | id: version-mc 10 | attributes: 11 | label: Minecraft version. 12 | placeholder: ex. 1.19.4 13 | validations: 14 | required: true 15 | - type: input 16 | id: version-rrls 17 | attributes: 18 | label: Remove Reloading Screen version. 19 | placeholder: ex. 2.0.0-dev 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: what-happened 24 | attributes: 25 | label: What happened? 26 | description: Also tell us, what did you expect to happen? 27 | validations: 28 | required: true 29 | - type: textarea 30 | id: log 31 | attributes: 32 | label: Relevant log. 33 | description: Please upload your latest.log (From the logs folder, it's in your Minecraft root directory, like the mods folder) to any pastebin service ex. gist.github.com, hastebin.com, pastebin.ubuntu.com, paste.ee or paste.gg 34 | validations: 35 | required: true 36 | - type: textarea 37 | id: additional 38 | attributes: 39 | label: Additional information. 40 | description: Provide a list of any other mods you are using, along with their respective versions. If you have any screenshots, videos, or other information that you feel is necessary to explain the issue, feel free to attach them here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/crash_report.yml: -------------------------------------------------------------------------------- 1 | name: Crash Report 2 | description: File a crash report 3 | labels: crash 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: "Are you using the latest version of the mod? If not, try updating to see if it resolves your issue. You can [find the latest versions here](https://github.com/dimadencep/RemoveReloadingScreen/releases)." 8 | - type: input 9 | id: version-mc 10 | attributes: 11 | label: Minecraft version. 12 | placeholder: ex. 1.19.4 13 | validations: 14 | required: true 15 | - type: input 16 | id: version-rrls 17 | attributes: 18 | label: Remove Reloading Screen version. 19 | placeholder: ex. 2.0.0-dev 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: what-happened 24 | attributes: 25 | label: What happened? 26 | validations: 27 | required: true 28 | - type: textarea 29 | id: log 30 | attributes: 31 | label: Relevant logs 32 | description: Please upload your latest.log and crash report log (both files can be found inside theirs respective directories in your Minecraft root folder, like the mods one) to any pastebin service ex. gist.github.com, hastebin.com, pastebin.ubuntu.com, paste.ee or paste.gg 33 | validations: 34 | required: true 35 | - type: textarea 36 | id: additional 37 | attributes: 38 | label: Additional information 39 | description: Provide a list of any other mods you are using, along with their respective versions. If you have any screenshots, videos, or other information that you feel is necessary to explain the issue, feel free to attach them here. -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - '**/stable' 7 | - '**/backport' 8 | - '**/snapshot' 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | 15 | - name: Checkout sources 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Set up JDK 21 21 | uses: actions/setup-java@v4 22 | with: 23 | distribution: 'temurin' 24 | java-version: 21 25 | 26 | - name: Grant execute permission for Gradlew 27 | run: chmod +x gradlew 28 | 29 | - name: Get previous tag 30 | run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV 31 | 32 | - name: Build Changelog 33 | id: build_changelog 34 | uses: metcalfc/changelog-generator@v4.3.1 35 | if: env.previous_tag 36 | with: 37 | mytoken: ${{ secrets.GITHUB_TOKEN }} 38 | base-ref: ${{ env.previous_tag }} 39 | fetch: false 40 | 41 | - name: Read value from Properties-file 42 | id: read_property 43 | uses: christian-draeger/read-properties@1.1.1 44 | with: 45 | path: './gradle.properties' 46 | properties: 'mod_version minecraft_version' 47 | 48 | - name: Upload assets to releases 49 | run: ./gradlew build --no-daemon 50 | env: 51 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 52 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 53 | 54 | - name: Publish Forge to Modrinth & CurseForge 55 | uses: Kir-Antipov/mc-publish@v3.3.0 56 | with: 57 | modrinth-id: ZP7xHXtw 58 | modrinth-token: ${{ secrets.MODRINTH_TOKEN }} 59 | 60 | curseforge-id: 833233 61 | curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} 62 | 63 | files: | 64 | forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar 65 | 66 | name: "[NeoForge ${{ steps.read_property.outputs.minecraft_version }}] v${{ steps.read_property.outputs.mod_version }}" 67 | 68 | changelog: ${{steps.build_changelog.outputs.changelog}} 69 | 70 | version: "${{ steps.read_property.outputs.mod_version }}+mc${{ steps.read_property.outputs.minecraft_version }}-forge" 71 | version-type: beta 72 | 73 | loaders: | 74 | neoforge 75 | 76 | game-version-filter: none 77 | game-versions: | 78 | ${{ steps.read_property.outputs.minecraft_version }} 79 | 80 | java: | 81 | 21 82 | 83 | - name: Publish Fabric to Modrinth & CurseForge 84 | uses: Kir-Antipov/mc-publish@v3.3.0 85 | with: 86 | modrinth-id: ZP7xHXtw 87 | modrinth-token: ${{ secrets.MODRINTH_TOKEN }} 88 | 89 | curseforge-id: 833233 90 | curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} 91 | 92 | files: | 93 | fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar 94 | 95 | name: "[Fabric ${{ steps.read_property.outputs.minecraft_version }}] v${{ steps.read_property.outputs.mod_version }}" 96 | 97 | changelog: ${{steps.build_changelog.outputs.changelog}} 98 | 99 | version: "${{ steps.read_property.outputs.mod_version }}+mc${{ steps.read_property.outputs.minecraft_version }}-fabric" 100 | version-type: beta 101 | 102 | loaders: | 103 | fabric 104 | 105 | game-version-filter: none 106 | game-versions: | 107 | ${{ steps.read_property.outputs.minecraft_version }} 108 | 109 | dependencies: | 110 | forge-config-api-port{modrinth:ohNO6lps}{curseforge:547434} 111 | 112 | java: | 113 | 21 114 | 115 | - name: Publish Fabric & Forge to Github 116 | uses: Kir-Antipov/mc-publish@v3.3.0 117 | with: 118 | github-token: ${{ secrets.GITHUB_TOKEN }} 119 | 120 | github-tag: "${{ steps.read_property.outputs.minecraft_version }}-${{ steps.read_property.outputs.mod_version }}" 121 | 122 | files: | 123 | forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar 124 | fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar 125 | 126 | name: "[${{ steps.read_property.outputs.minecraft_version }}] v${{ steps.read_property.outputs.mod_version }}" 127 | 128 | changelog: ${{steps.build_changelog.outputs.changelog}} 129 | 130 | version-type: release 131 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.ipr 3 | run/ 4 | *.iws 5 | out/ 6 | *.iml 7 | .gradle/ 8 | output/ 9 | bin/ 10 | libs/ 11 | 12 | .classpath 13 | .project 14 | .idea/ 15 | classes/ 16 | .metadata 17 | .vscode 18 | .settings 19 | *.launch -------------------------------------------------------------------------------- /HEADER: -------------------------------------------------------------------------------- 1 | Copyright 2023 - 2025 dima_dencep. 2 | 3 | Licensed under the Open Software License, Version 3.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | 6 | You may obtain a copy of the License at 7 | https://spdx.org/licenses/OSL-3.0.txt -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Open Software License ("OSL") v. 3.0 2 | 3 | This Open Software License (the "License") applies to any original work of 4 | authorship (the "Original Work") whose owner (the "Licensor") has placed the 5 | following licensing notice adjacent to the copyright notice for the Original 6 | Work: 7 | 8 | Licensed under the Open Software License version 3.0 9 | 10 | 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, 11 | non-exclusive, sublicensable license, for the duration of the copyright, to do 12 | the following: 13 | 14 | a) to reproduce the Original Work in copies, either alone or as part of a 15 | collective work; 16 | 17 | b) to translate, adapt, alter, transform, modify, or arrange the Original 18 | Work, thereby creating derivative works ("Derivative Works") based upon the 19 | Original Work; 20 | 21 | c) to distribute or communicate copies of the Original Work and Derivative 22 | Works to the public, with the proviso that copies of Original Work or 23 | Derivative Works that You distribute or communicate shall be licensed under 24 | this Open Software License; 25 | 26 | d) to perform the Original Work publicly; and 27 | 28 | e) to display the Original Work publicly. 29 | 30 | 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, 31 | non-exclusive, sublicensable license, under patent claims owned or controlled 32 | by the Licensor that are embodied in the Original Work as furnished by the 33 | Licensor, for the duration of the patents, to make, use, sell, offer for sale, 34 | have made, and import the Original Work and Derivative Works. 35 | 36 | 3) Grant of Source Code License. The term "Source Code" means the preferred 37 | form of the Original Work for making modifications to it and all available 38 | documentation describing how to modify the Original Work. Licensor agrees to 39 | provide a machine-readable copy of the Source Code of the Original Work along 40 | with each copy of the Original Work that Licensor distributes. Licensor 41 | reserves the right to satisfy this obligation by placing a machine-readable 42 | copy of the Source Code in an information repository reasonably calculated to 43 | permit inexpensive and convenient access by You for as long as Licensor 44 | continues to distribute the Original Work. 45 | 46 | 4) Exclusions From License Grant. Neither the names of Licensor, nor the names 47 | of any contributors to the Original Work, nor any of their trademarks or 48 | service marks, may be used to endorse or promote products derived from this 49 | Original Work without express prior permission of the Licensor. Except as 50 | expressly stated herein, nothing in this License grants any license to 51 | Licensor's trademarks, copyrights, patents, trade secrets or any other 52 | intellectual property. No patent license is granted to make, use, sell, offer 53 | for sale, have made, or import embodiments of any patent claims other than the 54 | licensed claims defined in Section 2. No license is granted to the trademarks 55 | of Licensor even if such marks are included in the Original Work. Nothing in 56 | this License shall be interpreted to prohibit Licensor from licensing under 57 | terms different from this License any Original Work that Licensor otherwise 58 | would have a right to license. 59 | 60 | 5) External Deployment. The term "External Deployment" means the use, 61 | distribution, or communication of the Original Work or Derivative Works in any 62 | way such that the Original Work or Derivative Works may be used by anyone 63 | other than You, whether those works are distributed or communicated to those 64 | persons or made available as an application intended for use over a network. 65 | As an express condition for the grants of license hereunder, You must treat 66 | any External Deployment by You of the Original Work or a Derivative Work as a 67 | distribution under section 1(c). 68 | 69 | 6) Attribution Rights. You must retain, in the Source Code of any Derivative 70 | Works that You create, all copyright, patent, or trademark notices from the 71 | Source Code of the Original Work, as well as any notices of licensing and any 72 | descriptive text identified therein as an "Attribution Notice." You must cause 73 | the Source Code for any Derivative Works that You create to carry a prominent 74 | Attribution Notice reasonably calculated to inform recipients that You have 75 | modified the Original Work. 76 | 77 | 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that 78 | the copyright in and to the Original Work and the patent rights granted herein 79 | by Licensor are owned by the Licensor or are sublicensed to You under the 80 | terms of this License with the permission of the contributor(s) of those 81 | copyrights and patent rights. Except as expressly stated in the immediately 82 | preceding sentence, the Original Work is provided under this License on an "AS 83 | IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without 84 | limitation, the warranties of non-infringement, merchantability or fitness for 85 | a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK 86 | IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this 87 | License. No license to the Original Work is granted by this License except 88 | under this disclaimer. 89 | 90 | 8) Limitation of Liability. Under no circumstances and under no legal theory, 91 | whether in tort (including negligence), contract, or otherwise, shall the 92 | Licensor be liable to anyone for any indirect, special, incidental, or 93 | consequential damages of any character arising as a result of this License or 94 | the use of the Original Work including, without limitation, damages for loss 95 | of goodwill, work stoppage, computer failure or malfunction, or any and all 96 | other commercial damages or losses. This limitation of liability shall not 97 | apply to the extent applicable law prohibits such limitation. 98 | 99 | 9) Acceptance and Termination. If, at any time, You expressly assented to this 100 | License, that assent indicates your clear and irrevocable acceptance of this 101 | License and all of its terms and conditions. If You distribute or communicate 102 | copies of the Original Work or a Derivative Work, You must make a reasonable 103 | effort under the circumstances to obtain the express assent of recipients to 104 | the terms of this License. This License conditions your rights to undertake 105 | the activities listed in Section 1, including your right to create Derivative 106 | Works based upon the Original Work, and doing so without honoring these terms 107 | and conditions is prohibited by copyright law and international treaty. 108 | Nothing in this License is intended to affect copyright exceptions and 109 | limitations (including "fair use" or "fair dealing"). This License shall 110 | terminate immediately and You may no longer exercise any of the rights granted 111 | to You by this License upon your failure to honor the conditions in Section 112 | 1(c). 113 | 114 | 10) Termination for Patent Action. This License shall terminate automatically 115 | and You may no longer exercise any of the rights granted to You by this 116 | License as of the date You commence an action, including a cross-claim or 117 | counterclaim, against Licensor or any licensee alleging that the Original Work 118 | infringes a patent. This termination provision shall not apply for an action 119 | alleging patent infringement by combinations of the Original Work with other 120 | software or hardware. 121 | 122 | 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this 123 | License may be brought only in the courts of a jurisdiction wherein the 124 | Licensor resides or in which Licensor conducts its primary business, and under 125 | the laws of that jurisdiction excluding its conflict-of-law provisions. The 126 | application of the United Nations Convention on Contracts for the 127 | International Sale of Goods is expressly excluded. Any use of the Original 128 | Work outside the scope of this License or after its termination shall be 129 | subject to the requirements and penalties of copyright or patent law in the 130 | appropriate jurisdiction. This section shall survive the termination of this 131 | License. 132 | 133 | 12) Attorneys' Fees. In any action to enforce the terms of this License or 134 | seeking damages relating thereto, the prevailing party shall be entitled to 135 | recover its costs and expenses, including, without limitation, reasonable 136 | attorneys' fees and costs incurred in connection with such action, including 137 | any appeal of such action. This section shall survive the termination of this 138 | License. 139 | 140 | 13) Miscellaneous. If any provision of this License is held to be 141 | unenforceable, such provision shall be reformed only to the extent necessary 142 | to make it enforceable. 143 | 144 | 14) Definition of "You" in This License. "You" throughout this License, 145 | whether in upper or lower case, means an individual or a legal entity 146 | exercising rights under, and complying with all of the terms of, this License. 147 | For legal entities, "You" includes any entity that controls, is controlled by, 148 | or is under common control with you. For purposes of this definition, 149 | "control" means (i) the power, direct or indirect, to cause the direction or 150 | management of such entity, whether by contract or otherwise, or (ii) ownership 151 | of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial 152 | ownership of such entity. 153 | 154 | 15) Right to Use. You may use the Original Work in all ways not otherwise 155 | restricted or conditioned by this License or by law, and Licensor promises not 156 | to interfere with or be responsible for such uses by You. 157 | 158 | 16) Modification of This License. This License is Copyright © 2005 Lawrence 159 | Rosen. Permission is granted to copy, distribute, or communicate this License 160 | without modification. Nothing in this License permits You to modify this 161 | License as applied to the Original Work or to Derivative Works. However, You 162 | may modify the text of this License and copy, distribute or communicate your 163 | modified version (the "Modified License") and apply it to other original works 164 | of authorship subject to the following conditions: (i) You may not indicate in 165 | any way that your Modified License is the "Open Software License" or "OSL" and 166 | you may not use those names in the name of your Modified License; (ii) You 167 | must replace the notice specified in the first paragraph above with the notice 168 | "Licensed under " or with a notice of your own 169 | that is not confusingly similar to the notice in this License; and (iii) You 170 | may not claim that your original works are open source software unless your 171 | Modified License has been approved by Open Source Initiative (OSI) and You 172 | comply with its license review and certification process. -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradleup.shadow" version "8.3.6" apply false 3 | id "architectury-plugin" version "3.4-SNAPSHOT" 4 | id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false 5 | id "net.neoforged.licenser" version "0.7.5" apply false 6 | id "io.github.p03w.machete" version "2.0.1" apply false 7 | } 8 | 9 | architectury { 10 | minecraft = rootProject.minecraft_version 11 | } 12 | 13 | subprojects { 14 | apply plugin: "dev.architectury.loom" 15 | apply plugin: "io.github.p03w.machete" 16 | apply plugin: "net.neoforged.licenser" 17 | 18 | loom { 19 | silentMojangMappingsLicense() 20 | } 21 | 22 | dependencies { 23 | minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" 24 | mappings loom.layered() { 25 | officialMojangMappings() 26 | parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") 27 | } 28 | } 29 | 30 | machete { 31 | ignoredTasks.add("shadowJar") 32 | ignoredTasks.add("jar") 33 | } 34 | 35 | license { 36 | header = rootProject.file('HEADER') 37 | skipExistingHeaders = false 38 | 39 | tasks { 40 | rrls { 41 | files.from rootProject.fileTree("src", { 42 | include "**/*.java" 43 | }) 44 | } 45 | } 46 | } 47 | 48 | processResources { 49 | inputs.property "version", version 50 | inputs.property "minecraft_version", minecraft_version 51 | inputs.property "fabric_version", loader_version 52 | inputs.property "neo_version", forge_version 53 | inputs.property "fcapip_version", fcapip_version 54 | 55 | filesMatching(["META-INF/neoforge.mods.toml", "fabric.mod.json"]) { 56 | expand "version": version, 57 | "minecraft_version": minecraft_version, 58 | "fabric_version": loader_version, 59 | "neo_version": forge_version, 60 | "fcapip_version": fcapip_version 61 | } 62 | } 63 | } 64 | 65 | allprojects { 66 | apply plugin: "java" 67 | apply plugin: "architectury-plugin" 68 | apply plugin: "maven-publish" 69 | 70 | base.archivesName = rootProject.archives_base_name 71 | version = "${rootProject.mod_version}+mc${rootProject.minecraft_version}-${project.name}" 72 | group = rootProject.maven_group 73 | 74 | repositories { 75 | maven { 76 | name = "NeoForged" 77 | url = "https://maven.neoforged.net/releases" 78 | content { 79 | excludeGroupByRegex "org.parchmentmc" 80 | } 81 | } 82 | maven { 83 | name = "ParchmentMC" 84 | url = "https://maven.parchmentmc.org" 85 | } 86 | maven { 87 | name = "Fuzs Mod Resources" 88 | url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" 89 | } 90 | } 91 | 92 | tasks.withType(JavaCompile).configureEach { 93 | options.encoding = "UTF-8" 94 | options.release.set 21 95 | } 96 | 97 | java { 98 | withSourcesJar() 99 | } 100 | 101 | publishing { 102 | repositories { 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /common/build.gradle: -------------------------------------------------------------------------------- 1 | architectury { 2 | common("neoforge", "fabric") 3 | } 4 | 5 | loom { 6 | accessWidenerPath = file("src/main/resources/rrls.accesswidener") 7 | } 8 | 9 | dependencies { 10 | modImplementation "net.fabricmc:fabric-loader:${loader_version}" 11 | 12 | modApi "fuzs.forgeconfigapiport:forgeconfigapiport-common-neoforgeapi:${fcapip_version}" 13 | modCompileOnly("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${fcapip_version}") { 14 | transitive = false 15 | } 16 | } 17 | 18 | jar { 19 | from rootProject.file("LICENSE") 20 | } 21 | 22 | publishing { 23 | publications { 24 | mavenCommon(MavenPublication) { 25 | artifactId = rootProject.archives_base_name 26 | from components.java 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/Rrls.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls; 12 | 13 | import org.apache.logging.log4j.LogManager; 14 | import org.apache.logging.log4j.Logger; 15 | 16 | public class Rrls { 17 | public static final String MOD_ID = "rrls"; 18 | public static final Logger LOGGER = LogManager.getLogger(MOD_ID); 19 | 20 | protected void onInitializeClient() { 21 | // no-op 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/RrlsConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls; 12 | 13 | import net.neoforged.neoforge.common.ModConfigSpec; 14 | import org.apache.commons.lang3.tuple.Pair; 15 | import org.redlance.dima_dencep.mods.rrls.config.DoubleLoad; 16 | import org.redlance.dima_dencep.mods.rrls.config.HideType; 17 | import org.redlance.dima_dencep.mods.rrls.config.Type; 18 | import org.redlance.dima_dencep.mods.rrls.utils.Ease; 19 | 20 | public class RrlsConfig { 21 | public static final Pair CONFIG_SPEC_PAIR = new ModConfigSpec.Builder() 22 | .configure(RrlsConfig::new); 23 | 24 | // Global 25 | public final ModConfigSpec.EnumValue hideType; 26 | public final ModConfigSpec.BooleanValue blockOverlay; 27 | public final ModConfigSpec.BooleanValue miniRender; 28 | public final ModConfigSpec.BooleanValue enableScissor; 29 | 30 | // Splash 31 | public final ModConfigSpec.EnumValue type; 32 | public final ModConfigSpec.BooleanValue rgbProgress; 33 | public final ModConfigSpec.ConfigValue reloadText; 34 | public final ModConfigSpec.ConfigValue animationSpeed; 35 | 36 | // Interpolation 37 | public final ModConfigSpec.BooleanValue interpolateProgress; 38 | public final ModConfigSpec.BooleanValue interpolateAtEnd; 39 | public final ModConfigSpec.EnumValue ease; 40 | public final ModConfigSpec.ConfigValue easingArg; 41 | 42 | // Other 43 | public final ModConfigSpec.BooleanValue resetResources; 44 | public final ModConfigSpec.BooleanValue reInitScreen; 45 | public final ModConfigSpec.BooleanValue earlyPackStatusSend; 46 | public final ModConfigSpec.EnumValue doubleLoad; 47 | 48 | // Platform-specific 49 | public final ModConfigSpec.BooleanValue skipForgeOverlay; 50 | 51 | protected RrlsConfig(ModConfigSpec.Builder builder) { 52 | builder.push("global"); 53 | this.hideType = builder.defineEnum("hideOverlays", HideType.ALL); 54 | this.blockOverlay = builder.define("blockOverlay", false); 55 | this.miniRender = builder.define("miniRender", true); 56 | this.enableScissor = builder.define("enableScissor", false); 57 | builder.pop(); 58 | 59 | builder.push("splash"); 60 | this.type = builder.defineEnum("type", Type.PROGRESS); 61 | this.rgbProgress = builder.define("rgbProgress", false); 62 | this.reloadText = builder.define("reloadText", "Edit in config!"); 63 | this.animationSpeed = builder.define("animationSpeed", 1000.0); 64 | builder.pop(); 65 | 66 | builder.push("interpolation"); 67 | this.interpolateProgress = builder.define("interpolateProgress", false); 68 | this.interpolateAtEnd = builder.define("interpolateAtEnd", true); 69 | this.ease = builder.defineEnum("ease", Ease.INOUTQUINT); 70 | this.easingArg = builder.define("easingArg", Double.NaN, RrlsConfig::isFloatLike); 71 | builder.pop(); 72 | 73 | builder.push("other"); 74 | this.resetResources = builder.define("resetResources", true); 75 | this.reInitScreen = builder.define("reInitScreen", true); 76 | this.earlyPackStatusSend = builder.define("earlyPackStatusSend", false); 77 | this.doubleLoad = builder.defineEnum("doubleLoad", DoubleLoad.FORCE_LOAD); 78 | builder.pop(); 79 | 80 | builder.push("platform"); 81 | this.skipForgeOverlay = builder.define("skipForgeOverlay", false); 82 | builder.pop(); 83 | } 84 | 85 | public static HideType hideType() { 86 | return CONFIG_SPEC_PAIR.getKey().hideType.get(); 87 | } 88 | 89 | public static boolean blockOverlay() { 90 | return CONFIG_SPEC_PAIR.getKey().blockOverlay.get(); 91 | } 92 | 93 | public static boolean miniRender() { 94 | return CONFIG_SPEC_PAIR.getKey().miniRender.get(); 95 | } 96 | 97 | public static boolean enableScissor() { 98 | return CONFIG_SPEC_PAIR.getKey().enableScissor.get(); 99 | } 100 | 101 | public static Type type() { 102 | return CONFIG_SPEC_PAIR.getKey().type.get(); 103 | } 104 | 105 | public static boolean rgbProgress() { 106 | return CONFIG_SPEC_PAIR.getKey().rgbProgress.get(); 107 | } 108 | 109 | public static String reloadText() { 110 | return CONFIG_SPEC_PAIR.getKey().reloadText.get(); 111 | } 112 | 113 | public static boolean interpolateProgress() { 114 | return CONFIG_SPEC_PAIR.getKey().interpolateProgress.get(); 115 | } 116 | 117 | public static boolean interpolateAtEnd() { 118 | return CONFIG_SPEC_PAIR.getKey().interpolateAtEnd.get(); 119 | } 120 | 121 | public static Ease easing() { 122 | return CONFIG_SPEC_PAIR.getKey().ease.get(); 123 | } 124 | 125 | public static Float easingArg() { 126 | float easingArg = CONFIG_SPEC_PAIR.getKey().easingArg.get().floatValue(); 127 | if (Float.isNaN(easingArg)) { 128 | return null; 129 | } 130 | 131 | return easingArg; 132 | } 133 | 134 | public static float animationSpeed() { 135 | return CONFIG_SPEC_PAIR.getKey().animationSpeed.get() 136 | .floatValue(); 137 | } 138 | 139 | public static boolean resetResources() { 140 | return CONFIG_SPEC_PAIR.getKey().resetResources.get(); 141 | } 142 | 143 | public static boolean reInitScreen() { 144 | return CONFIG_SPEC_PAIR.getKey().reInitScreen.get(); 145 | } 146 | 147 | public static boolean earlyPackStatusSend() { 148 | return CONFIG_SPEC_PAIR.getKey().earlyPackStatusSend.get(); 149 | } 150 | 151 | public static DoubleLoad doubleLoad() { 152 | return CONFIG_SPEC_PAIR.getKey().doubleLoad.get(); 153 | } 154 | 155 | public static boolean skipForgeOverlay() { 156 | return CONFIG_SPEC_PAIR.getKey().skipForgeOverlay.get(); 157 | } 158 | 159 | private static boolean isFloatLike(Object obj) { 160 | if (obj == null) { 161 | return false; 162 | } 163 | 164 | return switch (obj) { 165 | case Float ignored -> true; 166 | case Double ignored -> true; 167 | case String str -> { 168 | try { 169 | Float.valueOf(str); 170 | yield true; 171 | } catch (Throwable th) { 172 | yield false; 173 | } 174 | } 175 | default -> false; 176 | }; 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/config/AprilFool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.config; 12 | 13 | import java.util.Calendar; 14 | 15 | @SuppressWarnings("unused") 16 | public enum AprilFool { 17 | ON_APRIL, 18 | ALWAYS, 19 | DISABLED; 20 | 21 | private static Calendar calendar; 22 | 23 | public boolean canUes() { 24 | return switch (this) { 25 | case ON_APRIL -> { 26 | if (calendar == null) { 27 | calendar = Calendar.getInstance(); 28 | calendar.setTimeInMillis(System.currentTimeMillis()); 29 | } 30 | 31 | yield calendar.get(Calendar.MONTH) == Calendar.APRIL && calendar.get(Calendar.DAY_OF_MONTH) == 1; 32 | } 33 | case ALWAYS -> true; 34 | case DISABLED -> false; 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/config/DoubleLoad.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.config; 12 | 13 | import net.minecraft.network.chat.Component; 14 | import net.neoforged.neoforge.common.TranslatableEnum; 15 | 16 | public enum DoubleLoad implements TranslatableEnum { 17 | FORCE_LOAD(Component.translatable("rrls.configuration.doubleload.force")), 18 | LOAD(Component.translatable("rrls.configuration.doubleload.load")), 19 | NONE(Component.translatable("rrls.configuration.hide_doubleload.none")); 20 | 21 | private final Component translatedName; 22 | 23 | DoubleLoad(Component translatedName) { 24 | this.translatedName = translatedName; 25 | } 26 | 27 | public boolean isLoad() { 28 | return switch (this) { 29 | case FORCE_LOAD, LOAD -> true; 30 | case NONE -> false; 31 | }; 32 | } 33 | 34 | @Override 35 | public Component getTranslatedName() { 36 | return this.translatedName; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/config/HideType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.config; 12 | 13 | import net.minecraft.network.chat.Component; 14 | import net.neoforged.neoforge.common.TranslatableEnum; 15 | 16 | public enum HideType implements TranslatableEnum { 17 | ALL(Component.translatable("rrls.configuration.hide.all")), 18 | LOADING(Component.translatable("rrls.configuration.hide.loading")), 19 | RELOADING(Component.translatable("rrls.configuration.hide.reloading")), 20 | NONE(Component.translatable("rrls.configuration.hide_doubleload.none")); 21 | 22 | private final Component translatedName; 23 | 24 | HideType(Component translatedName) { 25 | this.translatedName = translatedName; 26 | } 27 | 28 | public boolean canHide(boolean reloading) { 29 | return switch (this) { 30 | case ALL -> true; 31 | case LOADING -> !reloading; 32 | case RELOADING -> reloading; 33 | case NONE -> false; 34 | }; 35 | } 36 | 37 | public boolean forceClose() { 38 | return this == LOADING || this == ALL; 39 | } 40 | 41 | @Override 42 | public Component getTranslatedName() { 43 | return this.translatedName; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/config/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.config; 12 | 13 | import net.minecraft.network.chat.Component; 14 | import net.neoforged.neoforge.common.TranslatableEnum; 15 | 16 | public enum Type implements TranslatableEnum { 17 | PROGRESS(Component.translatable("rrls.configuration.type.progress")), 18 | TEXT(Component.translatable("rrls.configuration.type.text")), 19 | TEXT_WITH_BACKGROUND(Component.translatable("rrls.configuration.type.textbg")), 20 | NONE(Component.translatable("rrls.configuration.type.none")); 21 | 22 | private final Component translatedName; 23 | 24 | Type(Component translatedName) { 25 | this.translatedName = translatedName; 26 | } 27 | 28 | @Override 29 | public Component getTranslatedName() { 30 | return this.translatedName; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/duck/OverlayExtender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.duck; 12 | 13 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 14 | import net.minecraft.client.gui.GuiGraphics; 15 | 16 | @SuppressWarnings("unused") 17 | public interface OverlayExtender { 18 | OverlayHelper.State rrls$getState(); 19 | void rrls$setState(OverlayHelper.State state); 20 | 21 | default void rrls$miniRender(GuiGraphics graphics, float partialTick) { 22 | throw new UnsupportedOperationException("The '" + getClass().getCanonicalName() + "' overlay doesn't have a mini-render!"); 23 | } 24 | 25 | default void rrls$resetProgress() { 26 | // NO-OP 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/GameRendererMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins; 12 | 13 | import net.minecraft.client.DeltaTracker; 14 | import org.redlance.dima_dencep.mods.rrls.Rrls; 15 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 16 | import org.redlance.dima_dencep.mods.rrls.utils.DummyGuiGraphics; 17 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 18 | import com.llamalad7.mixinextras.sugar.Local; 19 | import net.minecraft.client.Minecraft; 20 | import net.minecraft.client.gui.GuiGraphics; 21 | import net.minecraft.client.gui.screens.Overlay; 22 | import net.minecraft.client.renderer.GameRenderer; 23 | import org.spongepowered.asm.mixin.Final; 24 | import org.spongepowered.asm.mixin.Mixin; 25 | import org.spongepowered.asm.mixin.Shadow; 26 | import org.spongepowered.asm.mixin.Unique; 27 | import org.spongepowered.asm.mixin.injection.At; 28 | import org.spongepowered.asm.mixin.injection.Inject; 29 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 30 | 31 | @Mixin(GameRenderer.class) 32 | public class GameRendererMixin { 33 | @Shadow 34 | @Final 35 | private Minecraft minecraft; 36 | 37 | @Inject( 38 | method = "render", 39 | at = @At( 40 | value = "INVOKE", 41 | target = "Lnet/minecraft/client/gui/GuiGraphics;flush()V", 42 | ordinal = 1 43 | ) 44 | ) 45 | public void rrls$miniRender(DeltaTracker deltaTracker, boolean renderLevel, CallbackInfo ci, @Local(ordinal = 0) GuiGraphics graphics) { 46 | try { 47 | Overlay overlay = this.minecraft.overlay; 48 | 49 | if (OverlayHelper.isRenderingState(overlay)) { 50 | rrls$enableScissor(graphics, () -> overlay.render( 51 | DummyGuiGraphics.INSTANCE, 0, 0, deltaTracker.getGameTimeDeltaTicks() 52 | )); 53 | 54 | if (RrlsConfig.miniRender()) 55 | overlay.rrls$miniRender(graphics, deltaTracker.getGameTimeDeltaTicks()); 56 | } 57 | 58 | } catch (RuntimeException ex) { 59 | Rrls.LOGGER.error("Failed to draw overlay!", ex); 60 | } 61 | } 62 | 63 | @Unique 64 | private static void rrls$enableScissor(GuiGraphics graphics, Runnable runnable) { 65 | if (RrlsConfig.enableScissor()) { 66 | graphics.pose().pushPose(); 67 | graphics.enableScissor(0, 0, 0, 0); 68 | 69 | runnable.run(); 70 | 71 | graphics.disableScissor(); 72 | graphics.pose().popPose(); 73 | } else { 74 | runnable.run(); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/LoadingOverlayMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins; 12 | 13 | import com.llamalad7.mixinextras.sugar.Local; 14 | import com.mojang.blaze3d.systems.CommandEncoder; 15 | import com.mojang.blaze3d.textures.GpuTexture; 16 | import net.minecraft.Util; 17 | import net.minecraft.client.gui.components.FocusableTextWidget; 18 | import net.minecraft.network.chat.Component; 19 | import net.minecraft.util.ARGB; 20 | import net.minecraft.util.Mth; 21 | import org.objectweb.asm.Opcodes; 22 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 23 | import org.redlance.dima_dencep.mods.rrls.config.Type; 24 | import org.redlance.dima_dencep.mods.rrls.utils.DummyGuiGraphics; 25 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 26 | import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; 27 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 28 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 29 | import org.redlance.dima_dencep.mods.rrls.utils.RainbowUtils; 30 | import org.spongepowered.asm.mixin.Final; 31 | import org.spongepowered.asm.mixin.Mixin; 32 | import org.spongepowered.asm.mixin.Shadow; 33 | import org.spongepowered.asm.mixin.Unique; 34 | import org.spongepowered.asm.mixin.injection.At; 35 | import org.spongepowered.asm.mixin.injection.Constant; 36 | import org.spongepowered.asm.mixin.injection.Inject; 37 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 38 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 39 | 40 | import java.util.Optional; 41 | import java.util.function.Consumer; 42 | import net.minecraft.client.Minecraft; 43 | import net.minecraft.client.gui.GuiGraphics; 44 | import net.minecraft.client.gui.screens.LoadingOverlay; 45 | import net.minecraft.client.gui.screens.Overlay; 46 | import net.minecraft.client.gui.screens.Screen; 47 | import net.minecraft.server.packs.resources.ReloadInstance; 48 | 49 | @Mixin(LoadingOverlay.class) 50 | public abstract class LoadingOverlayMixin extends Overlay { 51 | @Shadow 52 | @Final 53 | private Minecraft minecraft; 54 | @Shadow 55 | public float currentProgress; 56 | @Shadow 57 | private long fadeOutStart; 58 | @Shadow 59 | private long fadeInStart; 60 | @Shadow 61 | public abstract void drawProgressBar(GuiGraphics guiGraphics, int minX, int minY, int maxX, int maxY, float partialTick); 62 | 63 | @Unique 64 | private FocusableTextWidget rrls$textWidget; 65 | @Unique 66 | private boolean rrls$isFinished; 67 | 68 | @Inject( 69 | method = "", 70 | at = @At( 71 | value = "TAIL" 72 | ) 73 | ) 74 | private void rrls$init(Minecraft client, ReloadInstance reload, Consumer> onFinish, boolean fadeIn, CallbackInfo ci) { 75 | rrls$setState(OverlayHelper.lookupState(client.screen, fadeIn)); 76 | 77 | if (RrlsConfig.type() == Type.TEXT_WITH_BACKGROUND) 78 | rrls$textWidget = new FocusableTextWidget(1, Component.literal(RrlsConfig.reloadText()), minecraft.font, 12); 79 | } 80 | 81 | @Override 82 | public void rrls$miniRender(GuiGraphics graphics, float partialTick) { 83 | int i = graphics.guiWidth(); 84 | int j = graphics.guiHeight(); 85 | 86 | float ease = 1.0F; 87 | if (RrlsConfig.interpolateProgress()) { 88 | ease -= RrlsConfig.easing().invoke(this.currentProgress, RrlsConfig.easingArg()); 89 | 90 | } else if (this.fadeOutStart > -1L) { 91 | float f = (float)(Util.getMillis() - this.fadeOutStart) / RrlsConfig.animationSpeed(); 92 | ease -= RrlsConfig.easing().invoke(Mth.clamp(f, 0.0F, 1.0F), RrlsConfig.easingArg()); 93 | } 94 | 95 | if (this.rrls$isFinished && ease <= 0.0F) { 96 | this.minecraft.setOverlay(null); 97 | } 98 | 99 | int easeAlpha = Mth.ceil(Mth.lerp(ease, 4.0F /* Fuck Font#adjustColor */, 255.0F)); 100 | int easeColor = ARGB.color(easeAlpha, 255, 255, 255); 101 | 102 | switch (RrlsConfig.type()) { 103 | case Type.PROGRESS -> { 104 | int s = (int) ((double) j * 0.8325); 105 | int r = (int) (Math.min(i * 0.75, j) * 0.5); 106 | 107 | this.drawProgressBar(graphics, i / 2 - r, s - 5, i / 2 + r, s + 5, ease); 108 | } 109 | 110 | case Type.TEXT -> graphics.drawCenteredString( 111 | minecraft.font, RrlsConfig.reloadText(), i / 2, 70, 112 | RrlsConfig.rgbProgress() ? RainbowUtils.rainbowColor(easeAlpha) : easeColor 113 | ); 114 | 115 | case Type.TEXT_WITH_BACKGROUND -> { 116 | if (rrls$textWidget != null) { 117 | rrls$textWidget.setMaxWidth(i); 118 | rrls$textWidget.setX(i / 2 - rrls$textWidget.getWidth() / 2); 119 | rrls$textWidget.setY(j - j / 3); 120 | rrls$textWidget.setColor(easeColor); 121 | 122 | if (RrlsConfig.rgbProgress()) 123 | rrls$textWidget.setColor(RainbowUtils.rainbowColor(easeAlpha)); 124 | 125 | // This will make sure the widget is rendered above other widgets in Pause screen 126 | graphics.pose().pushPose(); 127 | graphics.pose().translate(0, 0, 255); 128 | 129 | rrls$textWidget.render(graphics, 0, 0, partialTick); 130 | 131 | graphics.pose().popPose(); 132 | } 133 | } 134 | case NONE -> {} 135 | } 136 | } 137 | 138 | @Override 139 | public void rrls$resetProgress() { 140 | this.currentProgress = 0; 141 | this.fadeOutStart = -1L; 142 | this.fadeInStart = -1L; 143 | } 144 | 145 | @Inject( 146 | method = "render", 147 | at = @At( 148 | value = "HEAD" 149 | ) 150 | ) 151 | public void rrls$render(GuiGraphics context, int mouseX, int mouseY, float delta, CallbackInfo ci) { 152 | if (rrls$getState() != OverlayHelper.State.DEFAULT) // Update attach (Optifine ❤️) 153 | rrls$setState(OverlayHelper.lookupState(minecraft.screen, rrls$getState() != OverlayHelper.State.WAIT)); 154 | } 155 | 156 | @WrapWithCondition( 157 | method = "render", 158 | at = @At( 159 | value = "INVOKE", 160 | target = "Lnet/minecraft/client/gui/screens/Screen;render(Lnet/minecraft/client/gui/GuiGraphics;IIF)V" 161 | ) 162 | ) 163 | public boolean rrls$screenrender(Screen instance, GuiGraphics graphics, int mouseX, int mouseY, float partialTick) { 164 | return !(graphics instanceof DummyGuiGraphics); 165 | } 166 | 167 | @WrapWithCondition( 168 | method = "render", 169 | at = @At( 170 | value = "INVOKE", 171 | target = "Lnet/minecraft/client/Minecraft;setOverlay(Lnet/minecraft/client/gui/screens/Overlay;)V" 172 | ) 173 | ) 174 | public boolean rrls$reinitScreen(Minecraft instance, Overlay loadingGui) { 175 | return rrls$getState() == OverlayHelper.State.DEFAULT || this.currentProgress >= 0.999F; 176 | } 177 | 178 | @WrapWithCondition( 179 | method = "render", 180 | at = @At( 181 | value = "INVOKE", 182 | target = "Lnet/minecraft/client/gui/screens/Screen;init(Lnet/minecraft/client/Minecraft;II)V" 183 | ) 184 | ) 185 | public boolean rrls$reinitScreen(Screen instance, Minecraft minecraft, int width, int height) { 186 | return RrlsConfig.reInitScreen(); 187 | } 188 | 189 | @WrapOperation( 190 | method = "render", 191 | at = @At( 192 | value = "INVOKE", 193 | target = "Lcom/mojang/blaze3d/systems/CommandEncoder;clearColorTexture(Lcom/mojang/blaze3d/textures/GpuTexture;I)V", 194 | remap = false 195 | ) 196 | ) 197 | public void rrls$_clearColor(CommandEncoder instance, GpuTexture gpuTexture, int i, Operation original, @Local(argsOnly = true) GuiGraphics graphics) { 198 | if (graphics instanceof DummyGuiGraphics) return; 199 | original.call(instance, gpuTexture, i); 200 | } 201 | 202 | @WrapOperation( 203 | method = "drawProgressBar", 204 | at = @At( 205 | value = "INVOKE", 206 | target = "Ljava/lang/Math;round(F)I" 207 | ) 208 | ) 209 | public int rrls$lerp(float i, Operation original, @Local(argsOnly = true) float partialTick) { 210 | if (rrls$getState() != OverlayHelper.State.DEFAULT) { 211 | return original.call(Mth.lerp(partialTick, 0.0F, 255.0F)); 212 | } 213 | 214 | return original.call(i); 215 | } 216 | 217 | @WrapOperation( 218 | method = "drawProgressBar", 219 | at = @At( 220 | value = "INVOKE", 221 | target = "Lnet/minecraft/util/ARGB;color(IIII)I" 222 | ) 223 | ) 224 | public int rrls$rainbowProgress(int alpha, int red, int green, int blue, Operation original, @Local(argsOnly = true) float partialTick) { 225 | if (RrlsConfig.rgbProgress() && rrls$getState() != OverlayHelper.State.DEFAULT) { 226 | return RainbowUtils.rainbowColor(partialTick); 227 | } 228 | 229 | return original.call(alpha, red, green, blue); 230 | } 231 | 232 | @WrapOperation( 233 | method = "render", 234 | at = @At( 235 | value = "FIELD", 236 | target = "Lnet/minecraft/client/gui/screens/LoadingOverlay;fadeOutStart:J", 237 | ordinal = 2 238 | ) 239 | ) 240 | public long rrls$interpolateAtEnd(LoadingOverlay instance, Operation original) { 241 | if (rrls$getState() == OverlayHelper.State.DEFAULT) return original.call(instance); 242 | if (this.fadeOutStart == -1L && this.currentProgress >= 0.999F) { 243 | this.fadeOutStart = Util.getMillis(); 244 | } 245 | if (RrlsConfig.interpolateAtEnd()) { 246 | return this.rrls$isFinished ? 1L : -1L; 247 | } 248 | return original.call(instance); 249 | } 250 | 251 | @WrapOperation( 252 | method = "render", 253 | at = @At( 254 | value = "FIELD", 255 | target = "Lnet/minecraft/client/gui/screens/LoadingOverlay;fadeOutStart:J", 256 | opcode = Opcodes.PUTFIELD 257 | ) 258 | ) 259 | public void rrls$(LoadingOverlay instance, long value, Operation original) { 260 | this.rrls$isFinished = true; 261 | if (rrls$getState() == OverlayHelper.State.DEFAULT || !RrlsConfig.interpolateAtEnd()) { 262 | original.call(instance, value); 263 | } 264 | } 265 | 266 | @ModifyConstant( 267 | method = "render", 268 | constant = { 269 | @Constant( 270 | floatValue = 1000.0F, 271 | ordinal = 0 272 | ), 273 | @Constant( 274 | floatValue = 500.0F, 275 | ordinal = 0 276 | ) 277 | }, 278 | require = 0 279 | ) 280 | public float rrls$changeAnimationSpeed(float instance) { 281 | if (!rrls$getState().isRendering()) { 282 | return instance == 1000.0F ? RrlsConfig.animationSpeed() : RrlsConfig.animationSpeed() / 2; 283 | } 284 | 285 | return instance; 286 | } 287 | 288 | @Override // YAY Conflicts!!! 289 | public boolean isPauseScreen() { 290 | return super.isPauseScreen(); 291 | } 292 | } 293 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/MinecraftClientMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins; 12 | 13 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 14 | import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; 15 | import org.redlance.dima_dencep.mods.rrls.config.DoubleLoad; 16 | import org.redlance.dima_dencep.mods.rrls.Rrls; 17 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 18 | import com.llamalad7.mixinextras.injector.ModifyReturnValue; 19 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 20 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 21 | import com.llamalad7.mixinextras.sugar.Local; 22 | import org.jetbrains.annotations.Nullable; 23 | import org.spongepowered.asm.mixin.Mixin; 24 | import org.spongepowered.asm.mixin.Shadow; 25 | import org.spongepowered.asm.mixin.injection.At; 26 | import org.spongepowered.asm.mixin.injection.Inject; 27 | import org.spongepowered.asm.mixin.injection.ModifyArg; 28 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 29 | 30 | import java.util.concurrent.CompletableFuture; 31 | import net.minecraft.client.Minecraft; 32 | import net.minecraft.client.gui.screens.Overlay; 33 | import net.minecraft.client.main.GameConfig; 34 | import net.minecraft.network.chat.Component; 35 | 36 | @Mixin(Minecraft.class) 37 | public abstract class MinecraftClientMixin { 38 | @Shadow 39 | protected abstract void addResourcePackLoadFailToast(@Nullable Component component); 40 | @Shadow 41 | protected abstract CompletableFuture reloadResourcePacks(boolean bl, @Nullable Minecraft.GameLoadCookie gameLoadCookie); 42 | @Shadow 43 | protected abstract void onResourceLoadFinished(@Nullable Minecraft.GameLoadCookie gameLoadCookie); 44 | @Shadow 45 | private boolean gameLoadFinished; 46 | @Shadow 47 | @Nullable 48 | public Overlay overlay; 49 | 50 | @Inject( 51 | method = "", 52 | at = @At( 53 | value = "INVOKE", 54 | target = "Lcom/mojang/jtracy/TracyClient;isAvailable()Z", 55 | shift = At.Shift.AFTER 56 | ) 57 | ) 58 | public void rrls$init(GameConfig gameConfig, CallbackInfo ci, @Local(ordinal = 0) Minecraft.GameLoadCookie gameLoadCookie) { 59 | if (!RrlsConfig.hideType().forceClose()) return; 60 | 61 | try { 62 | onResourceLoadFinished(gameLoadCookie); 63 | } catch (Throwable th) { 64 | Rrls.LOGGER.error("Failed to complete load early!", th); 65 | this.gameLoadFinished = false; 66 | } 67 | } 68 | 69 | @WrapWithCondition( 70 | method = "onGameLoadFinished", 71 | at = @At( 72 | value = "INVOKE", 73 | target = "Ljava/lang/Runnable;run()V" 74 | ) 75 | ) 76 | public boolean rrls$fixDH(Runnable instance) { 77 | instance.run(); // Forbid DH from redirecting the method. 78 | return false; 79 | } 80 | 81 | @Inject( 82 | method = "clearResourcePacksOnError", 83 | at = @At( 84 | value = "HEAD" 85 | ), 86 | cancellable = true 87 | ) 88 | public void rrls$onResourceReloadFailure(Throwable throwable, Component errorMessage, Minecraft.GameLoadCookie gameLoadCookie, CallbackInfo ci) { 89 | if (!RrlsConfig.resetResources()) { 90 | ci.cancel(); 91 | 92 | Rrls.LOGGER.error("Caught error loading resourcepacks!", throwable); 93 | 94 | if (RrlsConfig.doubleLoad().isLoad()) { 95 | reloadResourcePacks(RrlsConfig.doubleLoad() == DoubleLoad.FORCE_LOAD, gameLoadCookie) 96 | .thenRun(() -> addResourcePackLoadFailToast(errorMessage)); 97 | } 98 | } 99 | } 100 | 101 | @Inject( 102 | method = "clearResourcePacksOnError", 103 | at = @At( 104 | value = "INVOKE", 105 | target = "Lnet/minecraft/client/Minecraft;reloadResourcePacks(ZLnet/minecraft/client/Minecraft$GameLoadCookie;)Ljava/util/concurrent/CompletableFuture;", 106 | shift = At.Shift.BEFORE 107 | ), 108 | cancellable = true 109 | ) 110 | public void rrls$doubleLoad(Throwable throwable, Component errorMessage, Minecraft.GameLoadCookie gameLoadCookie, CallbackInfo ci) { 111 | if (!RrlsConfig.doubleLoad().isLoad()) { 112 | ci.cancel(); 113 | } 114 | } 115 | 116 | @ModifyArg( 117 | method = "clearResourcePacksOnError", 118 | at = @At( 119 | value = "INVOKE", 120 | target = "Lnet/minecraft/client/Minecraft;reloadResourcePacks(ZLnet/minecraft/client/Minecraft$GameLoadCookie;)Ljava/util/concurrent/CompletableFuture;", 121 | ordinal = 0 122 | ), 123 | require = 0 124 | ) 125 | public boolean rrls$doubleLoad(boolean error) { // always true 126 | return RrlsConfig.doubleLoad() == DoubleLoad.FORCE_LOAD; 127 | } 128 | 129 | @WrapOperation( 130 | method = { 131 | "tick", 132 | "handleKeybinds", 133 | "doWorldLoad" 134 | }, 135 | at = @At( 136 | value = "FIELD", 137 | target = "Lnet/minecraft/client/Minecraft;overlay:Lnet/minecraft/client/gui/screens/Overlay;" 138 | ) 139 | ) 140 | public Overlay rrls$miniRender(Minecraft instance, Operation original) { 141 | Overlay overlay = original.call(instance); 142 | 143 | if (OverlayHelper.isRenderingState(overlay)) 144 | return null; 145 | 146 | return overlay; 147 | } 148 | 149 | @ModifyReturnValue( 150 | method = "getOverlay", 151 | at = @At( 152 | value = "RETURN" 153 | ) 154 | ) 155 | public Overlay rrls$blockOverlay(Overlay original) { 156 | if (RrlsConfig.blockOverlay() && OverlayHelper.isRenderingState(original)) 157 | return null; 158 | return original; 159 | } 160 | 161 | @WrapOperation( 162 | method = "forceSetScreen", 163 | at = @At( 164 | value = "INVOKE", 165 | target = "Lnet/minecraft/client/Minecraft;runTick(Z)V" 166 | ) 167 | ) 168 | public void rrls$removeTick(Minecraft instance, boolean renderLevel, Operation original) { 169 | if (!OverlayHelper.isRenderingState(overlay)) original.call(instance, renderLevel); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/TitleScreenMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins; 12 | 13 | import net.minecraft.client.gui.screens.TitleScreen; 14 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 15 | import org.spongepowered.asm.mixin.Mixin; 16 | import org.spongepowered.asm.mixin.injection.Constant; 17 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 18 | 19 | @Mixin(TitleScreen.class) 20 | public class TitleScreenMixin { 21 | @ModifyConstant( 22 | method = "render", 23 | constant = @Constant( 24 | floatValue = 2000.0F, 25 | ordinal = 0 26 | ), 27 | require = 0 28 | ) 29 | public float rrls$changeAnimationSpeed(float instance) { 30 | return RrlsConfig.animationSpeed() * 2; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/compat/ItemRendererMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.compat; 12 | 13 | import net.minecraft.client.renderer.entity.ItemRenderer; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | 16 | /** 17 | * fix for create 18 | */ 19 | @Mixin(ItemRenderer.class) 20 | public class ItemRendererMixin { 21 | /*@Shadow 22 | @Final 23 | private ItemModelShaper itemModelShaper; 24 | 25 | @WrapOperation( 26 | method = "getModel", 27 | at = @At( 28 | value = "INVOKE", 29 | target = "Lnet/minecraft/client/resources/model/BakedModel;getOverrides()Lnet/minecraft/client/renderer/block/model/ItemOverrides;" 30 | ) 31 | ) 32 | public ItemOverrides rrls$fixModelsInMenu(BakedModel instance, Operation original, @Cancellable CallbackInfoReturnable ci) { 33 | if (instance == null) { 34 | ci.setReturnValue(this.itemModelShaper.getModelManager().getMissingModel()); 35 | return null; 36 | } else { 37 | return original.call(instance); 38 | } 39 | }*/ 40 | } 41 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/compat/OverlayMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.compat; 12 | 13 | import org.redlance.dima_dencep.mods.rrls.duck.OverlayExtender; 14 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 15 | import com.llamalad7.mixinextras.injector.ModifyReturnValue; 16 | import net.minecraft.client.gui.screens.Overlay; 17 | import org.spongepowered.asm.mixin.Mixin; 18 | import org.spongepowered.asm.mixin.Unique; 19 | import org.spongepowered.asm.mixin.injection.At; 20 | 21 | @Mixin(Overlay.class) 22 | public class OverlayMixin implements OverlayExtender { 23 | @Unique 24 | public OverlayHelper.State rrls$state = OverlayHelper.State.DEFAULT; 25 | 26 | @Override 27 | public OverlayHelper.State rrls$getState() { 28 | return rrls$state; 29 | } 30 | 31 | @Override 32 | public void rrls$setState(OverlayHelper.State state) { 33 | this.rrls$state = state; 34 | } 35 | 36 | @ModifyReturnValue( 37 | method = "isPauseScreen", 38 | at = @At( 39 | value = "RETURN" 40 | ) 41 | ) 42 | public boolean rrls$pausesGame(boolean original) { 43 | return !rrls$getState().isRendering() && original; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/compat/RendererKeyboardMouseMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.compat; 12 | 13 | import com.mojang.blaze3d.platform.FramerateLimitTracker; 14 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 15 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 16 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 17 | import net.minecraft.client.KeyboardHandler; 18 | import net.minecraft.client.Minecraft; 19 | import net.minecraft.client.MouseHandler; 20 | import net.minecraft.client.gui.screens.Overlay; 21 | import net.minecraft.client.renderer.GameRenderer; 22 | import org.spongepowered.asm.mixin.Mixin; 23 | import org.spongepowered.asm.mixin.injection.At; 24 | 25 | @Mixin(value = { 26 | GameRenderer.class, 27 | KeyboardHandler.class, 28 | MouseHandler.class, 29 | FramerateLimitTracker.class 30 | }) 31 | public class RendererKeyboardMouseMixin { 32 | @WrapOperation( 33 | method = "*", 34 | at = @At( 35 | value = "INVOKE", 36 | target = "Lnet/minecraft/client/Minecraft;getOverlay()Lnet/minecraft/client/gui/screens/Overlay;" 37 | ) 38 | ) 39 | public Overlay rrls$miniRender(Minecraft instance, Operation original) { 40 | Overlay overlay = original.call(instance); 41 | 42 | if (OverlayHelper.isRenderingState(overlay)) 43 | return null; 44 | 45 | return overlay; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/compat/ServerPackManagerMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.compat; 12 | 13 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Inject; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | import java.util.UUID; 20 | import net.minecraft.client.Minecraft; 21 | import net.minecraft.client.multiplayer.ClientPacketListener; 22 | import net.minecraft.client.resources.server.ServerPackManager; 23 | import net.minecraft.network.protocol.common.ServerboundResourcePackPacket; 24 | 25 | @Mixin(ServerPackManager.class) 26 | public class ServerPackManagerMixin { 27 | @Inject( 28 | method = "pushNewPack", 29 | at = @At( 30 | value = "INVOKE", 31 | target = "Lnet/minecraft/client/resources/server/ServerPackManager;registerForUpdate()V" 32 | ) 33 | ) 34 | public void earlyResourcePackStatusSend(UUID id, ServerPackManager.ServerPackData packData, CallbackInfo ci) { 35 | if (RrlsConfig.earlyPackStatusSend()) { 36 | ClientPacketListener handler = Minecraft.getInstance().getConnection(); 37 | 38 | if (handler != null && handler.getConnection() != null && handler.getConnection().isConnected()) { 39 | handler.getConnection().send(new ServerboundResourcePackPacket(id, ServerboundResourcePackPacket.Action.SUCCESSFULLY_LOADED)); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/CompilationCacheMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import com.llamalad7.mixinextras.sugar.Cancellable; 16 | import net.minecraft.client.renderer.PostChain; 17 | import net.minecraft.client.renderer.ShaderManager; 18 | import net.minecraft.resources.ResourceLocation; 19 | import org.redlance.dima_dencep.mods.rrls.Rrls; 20 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 21 | import org.spongepowered.asm.mixin.Mixin; 22 | import org.spongepowered.asm.mixin.injection.At; 23 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 24 | 25 | import java.util.Set; 26 | 27 | /** 28 | * Used to prevent the game from crashing if rrls failed to load the reloader early. 29 | */ 30 | @Mixin(ShaderManager.CompilationCache.class) 31 | public class CompilationCacheMixin { 32 | @WrapOperation( 33 | method = "getOrLoadPostChain", 34 | at = @At( 35 | value = "INVOKE", 36 | target = "Lnet/minecraft/client/renderer/ShaderManager$CompilationCache;loadPostChain(Lnet/minecraft/resources/ResourceLocation;Ljava/util/Set;)Lnet/minecraft/client/renderer/PostChain;" 37 | ) 38 | ) 39 | private PostChain rrls$supressMissingCache(ShaderManager.CompilationCache instance, ResourceLocation name, Set externalTargets, Operation original, @Cancellable CallbackInfoReturnable cir) { 40 | PostChain postChain = original.call(instance, name, externalTargets); 41 | 42 | if (postChain == null && RrlsConfig.hideType().forceClose()) { 43 | cir.setReturnValue(null); 44 | } 45 | 46 | return postChain; 47 | } 48 | 49 | @WrapOperation( 50 | method = { 51 | "loadPostChain" 52 | }, 53 | at = @At( 54 | value = "NEW", 55 | target = "(Ljava/lang/String;)Lnet/minecraft/client/renderer/ShaderManager$CompilationException;" 56 | ) 57 | ) 58 | private ShaderManager.CompilationException rrls$supressMissingCache(String s, Operation original, @Cancellable CallbackInfoReturnable cir) { 59 | ShaderManager.CompilationException exc = original.call(s); 60 | if (RrlsConfig.hideType().forceClose()) { 61 | Rrls.LOGGER.warn("Failed to compile!", exc); 62 | cir.setReturnValue(null); 63 | return null; 64 | } else { 65 | return exc; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/EntityRenderDispatcherMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import com.mojang.blaze3d.vertex.PoseStack; 16 | import net.minecraft.client.Minecraft; 17 | import net.minecraft.client.renderer.MultiBufferSource; 18 | import net.minecraft.client.renderer.entity.EntityRenderDispatcher; 19 | import net.minecraft.client.renderer.entity.EntityRenderer; 20 | import net.minecraft.client.renderer.entity.state.EntityRenderState; 21 | import net.minecraft.world.entity.Entity; 22 | import org.redlance.dima_dencep.mods.rrls.Rrls; 23 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 24 | import org.spongepowered.asm.mixin.Mixin; 25 | import org.spongepowered.asm.mixin.Unique; 26 | import org.spongepowered.asm.mixin.injection.At; 27 | import org.spongepowered.asm.mixin.injection.Inject; 28 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 29 | 30 | @Mixin(EntityRenderDispatcher.class) 31 | public class EntityRenderDispatcherMixin { 32 | @Unique 33 | private static final Minecraft RRLS$MINECRAFT = Minecraft.getInstance(); 34 | 35 | @WrapOperation( 36 | method = "render(Lnet/minecraft/world/entity/Entity;DDDFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", 37 | at = @At( 38 | value = "INVOKE", 39 | target = "Lnet/minecraft/client/renderer/entity/EntityRenderDispatcher;getRenderer(Lnet/minecraft/world/entity/Entity;)Lnet/minecraft/client/renderer/entity/EntityRenderer;" 40 | ) 41 | ) 42 | public EntityRenderer rrls$workaroundEntityCrash(EntityRenderDispatcher instance, Entity entityrenderer, Operation> original) { 43 | try { 44 | return original.call(instance, entityrenderer); 45 | } catch (Throwable th) { 46 | if (RrlsConfig.hideType().forceClose() && RRLS$MINECRAFT.level == null) { 47 | return null; 48 | } 49 | 50 | throw th; 51 | } 52 | } 53 | 54 | @Inject( 55 | method = "render(Lnet/minecraft/world/entity/Entity;DDDFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/renderer/entity/EntityRenderer;)V", 56 | at = @At( 57 | value = "INVOKE", 58 | target = "Lnet/minecraft/CrashReport;forThrowable(Ljava/lang/Throwable;Ljava/lang/String;)Lnet/minecraft/CrashReport;" 59 | ), 60 | cancellable = true 61 | ) 62 | public void rrls$workaroundEntityCrash(E entity, double d, double e, double f, float g, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, EntityRenderer entityRenderer, CallbackInfo ci) { 63 | if (RrlsConfig.hideType().forceClose() && RRLS$MINECRAFT.level == null) { 64 | Rrls.LOGGER.warn("Preverting entity ({}) crash.", entity); 65 | 66 | ci.cancel(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/GlCommandEncoderMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import com.llamalad7.mixinextras.sugar.Cancellable; 16 | import com.mojang.blaze3d.opengl.GlCommandEncoder; 17 | import org.redlance.dima_dencep.mods.rrls.Rrls; 18 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 19 | import org.spongepowered.asm.mixin.Mixin; 20 | import org.spongepowered.asm.mixin.injection.At; 21 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 22 | 23 | @Mixin(GlCommandEncoder.class) 24 | public class GlCommandEncoderMixin { 25 | @WrapOperation( 26 | method = "trySetup", 27 | at = @At( 28 | value = "NEW", 29 | target = "(Ljava/lang/String;)Ljava/lang/IllegalStateException;" 30 | ) 31 | ) 32 | public IllegalStateException rrls$safeSetup(String s, Operation original, @Cancellable CallbackInfoReturnable cir) { 33 | IllegalStateException exc = original.call(s); 34 | if (RrlsConfig.hideType().forceClose()) { 35 | Rrls.LOGGER.warn("Failed to setup!", exc); 36 | cir.setReturnValue(false); 37 | 38 | return null; 39 | } else { 40 | return exc; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/GuiGraphicsMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import net.minecraft.client.gui.GuiGraphics; 16 | import net.minecraft.client.gui.GuiSpriteManager; 17 | import net.minecraft.client.renderer.texture.TextureAtlasSprite; 18 | import net.minecraft.client.resources.metadata.gui.GuiSpriteScaling; 19 | import net.minecraft.resources.ResourceLocation; 20 | import org.spongepowered.asm.mixin.Mixin; 21 | import org.spongepowered.asm.mixin.injection.At; 22 | 23 | @Mixin(GuiGraphics.class) 24 | public abstract class GuiGraphicsMixin { 25 | @WrapOperation( 26 | method = { 27 | "blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIIII)V", 28 | "blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIIIIIII)V" 29 | }, 30 | at = @At( 31 | value = "INVOKE", 32 | target = "Lnet/minecraft/client/gui/GuiSpriteManager;getSprite(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;" 33 | ) 34 | ) 35 | public TextureAtlasSprite rrls$fixSpriteCrash(GuiSpriteManager instance, ResourceLocation location, Operation original) { 36 | try { 37 | return original.call(instance, location); 38 | } catch (Throwable th) { 39 | return null; 40 | } 41 | } 42 | 43 | @WrapOperation( 44 | method = { 45 | "blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIIII)V", 46 | "blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIIIIIII)V" 47 | }, 48 | at = @At( 49 | value = "INVOKE", 50 | target = "Lnet/minecraft/client/gui/GuiSpriteManager;getSpriteScaling(Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;)Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling;" 51 | ) 52 | ) 53 | public GuiSpriteScaling rrls$fixSpriteCrash(GuiSpriteManager instance, TextureAtlasSprite sprite, Operation original) { 54 | if (sprite == null) { 55 | return null; 56 | } 57 | 58 | return original.call(instance, sprite); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/ReloadableResourceManagerMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround; 12 | 13 | import com.google.common.collect.Lists; 14 | import net.minecraft.Util; 15 | import net.minecraft.client.Minecraft; 16 | import net.minecraft.client.gui.GuiSpriteManager; 17 | import net.minecraft.client.gui.font.FontManager; 18 | import net.minecraft.client.renderer.ShaderManager; 19 | import net.minecraft.client.resources.SplashManager; 20 | import net.minecraft.client.resources.language.LanguageManager; 21 | import net.minecraft.server.packs.PackResources; 22 | import net.minecraft.server.packs.PackType; 23 | import net.minecraft.server.packs.resources.CloseableResourceManager; 24 | import net.minecraft.server.packs.resources.MultiPackResourceManager; 25 | import net.minecraft.server.packs.resources.PreparableReloadListener; 26 | import net.minecraft.server.packs.resources.ReloadInstance; 27 | import net.minecraft.server.packs.resources.ReloadableResourceManager; 28 | import net.minecraft.util.Unit; 29 | import org.redlance.dima_dencep.mods.rrls.Rrls; 30 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 31 | import org.spongepowered.asm.mixin.Mixin; 32 | import org.spongepowered.asm.mixin.Shadow; 33 | import org.spongepowered.asm.mixin.Unique; 34 | import org.spongepowered.asm.mixin.injection.At; 35 | import org.spongepowered.asm.mixin.injection.Inject; 36 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 37 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 38 | 39 | import java.util.List; 40 | import java.util.concurrent.CompletableFuture; 41 | import java.util.concurrent.Executor; 42 | import java.util.function.BiConsumer; 43 | 44 | @Mixin(ReloadableResourceManager.class) 45 | public class ReloadableResourceManagerMixin { 46 | @Shadow 47 | private CloseableResourceManager resources; 48 | 49 | @Unique 50 | private static final Minecraft RRLS$MINECRAFT = Minecraft.getInstance(); 51 | 52 | @Unique 53 | private final List rrls$listeners = Lists.newArrayList(); 54 | 55 | @Inject( 56 | method = "registerReloadListener", 57 | at = @At( 58 | value = "TAIL" 59 | ) 60 | ) 61 | public void rrls$initReloader(PreparableReloadListener listener, CallbackInfo ci) { 62 | if (!RrlsConfig.hideType().forceClose()) { 63 | return; 64 | } 65 | 66 | if (listener instanceof FontManager fontManager && 67 | !fontManager.fontSets.containsKey(Minecraft.DEFAULT_FONT) 68 | ) { 69 | rrls$reloadListener(fontManager, RRLS$MINECRAFT, 70 | (unused, throwable) -> rrls$refreshScreen() 71 | ); 72 | } 73 | 74 | if (listener instanceof LanguageManager languageManager && 75 | languageManager.getLanguages().size() <= 1 76 | ) { 77 | rrls$reloadListener(languageManager, Util.backgroundExecutor(), (unused, throwable) -> {}); 78 | } 79 | 80 | if (listener instanceof SplashManager splashManager && 81 | splashManager.splashes.isEmpty() 82 | ) { 83 | rrls$reloadListener(splashManager, Util.backgroundExecutor(), 84 | (unused, throwable) -> rrls$refreshScreen() 85 | ); 86 | } 87 | 88 | if (listener instanceof GuiSpriteManager spriteManager && 89 | spriteManager.textureAtlas.texturesByName.isEmpty() 90 | ) { 91 | rrls$reloadListener(spriteManager, RRLS$MINECRAFT, (unused, throwable) -> {}); 92 | } 93 | 94 | if (listener instanceof ShaderManager shaderManager && 95 | shaderManager.compilationCache.configs == ShaderManager.Configs.EMPTY 96 | ) { 97 | rrls$reloadListener(shaderManager, RRLS$MINECRAFT, (unused, throwable) -> {}); 98 | } 99 | } 100 | 101 | @Inject( 102 | method = "createReload", 103 | at = @At( 104 | value = "INVOKE", 105 | target = "Lnet/minecraft/server/packs/resources/SimpleReloadInstance;create(Lnet/minecraft/server/packs/resources/ResourceManager;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Z)Lnet/minecraft/server/packs/resources/ReloadInstance;" 106 | ) 107 | ) 108 | private void rrls$initReloaders(Executor backgroundExecutor, Executor gameExecutor, CompletableFuture waitingFor, List resourcePacks, CallbackInfoReturnable cir) { 109 | for (PreparableReloadListener listener : this.rrls$listeners) { 110 | rrls$reloadListener(listener, RRLS$MINECRAFT, (unused, throwable) -> {}); 111 | } 112 | this.rrls$listeners.clear(); 113 | } 114 | 115 | @Unique 116 | private void rrls$reloadListener(PreparableReloadListener listener, Executor gameExecutor, BiConsumer action) { 117 | try { 118 | if (this.resources.getNamespaces().isEmpty() || this.resources.getNamespaces().size() < 2 /* EBE workaround */) { 119 | this.resources.close(); 120 | 121 | Rrls.LOGGER.info("Creating new resource manager!"); 122 | this.resources = new MultiPackResourceManager(PackType.CLIENT_RESOURCES, 123 | RRLS$MINECRAFT.getResourcePackRepository().openAllSelected() 124 | ); 125 | } 126 | 127 | Rrls.LOGGER.info("Quick reload listener '{}'", listener.getName()); 128 | 129 | listener.reload( 130 | CompletableFuture::completedFuture, (ReloadableResourceManager) (Object) this, Util.backgroundExecutor(), gameExecutor 131 | ).whenCompleteAsync(action, RRLS$MINECRAFT); 132 | 133 | } catch (Throwable th) { 134 | this.rrls$listeners.add(listener); 135 | Rrls.LOGGER.warn("Failed to reload {}!", listener.getName(), th); 136 | } 137 | } 138 | 139 | @Unique 140 | private void rrls$refreshScreen() { 141 | if (RrlsConfig.reInitScreen() && RRLS$MINECRAFT.screen != null) { 142 | RRLS$MINECRAFT.screen.init(RRLS$MINECRAFT, 143 | RRLS$MINECRAFT.getWindow().getGuiScaledWidth(), RRLS$MINECRAFT.getWindow().getGuiScaledHeight() 144 | ); 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/TextureManagerMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import net.minecraft.Util; 16 | import net.minecraft.client.Minecraft; 17 | import net.minecraft.client.renderer.texture.AbstractTexture; 18 | import net.minecraft.client.renderer.texture.ReloadableTexture; 19 | import net.minecraft.client.renderer.texture.TextureManager; 20 | import net.minecraft.resources.ResourceLocation; 21 | import net.minecraft.server.packs.resources.ResourceManager; 22 | import org.redlance.dima_dencep.mods.rrls.Rrls; 23 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 24 | import org.spongepowered.asm.mixin.Final; 25 | import org.spongepowered.asm.mixin.Mixin; 26 | import org.spongepowered.asm.mixin.Shadow; 27 | import org.spongepowered.asm.mixin.injection.At; 28 | 29 | @Mixin(TextureManager.class) 30 | public abstract class TextureManagerMixin { 31 | @Shadow 32 | @Final 33 | private ResourceManager resourceManager; 34 | 35 | @WrapOperation( 36 | method = "registerForNextReload", 37 | at = @At( 38 | value = "INVOKE", 39 | target = "Lnet/minecraft/client/renderer/texture/TextureManager;register(Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/texture/AbstractTexture;)V" 40 | ) 41 | ) 42 | public void rrls$earlyRegister(TextureManager instance, ResourceLocation path, AbstractTexture texture, Operation original) { 43 | original.call(instance, path, texture); 44 | 45 | if (RrlsConfig.hideType().forceClose() && texture instanceof ReloadableTexture reloadableTexture) { 46 | TextureManager.PendingReload reload = TextureManager.scheduleLoad( 47 | this.resourceManager, path, reloadableTexture, Util.backgroundExecutor() 48 | ); 49 | Rrls.LOGGER.info("Reloading texture '{}'!", path); 50 | reload.newContents().thenAcceptAsync(textureContents -> reload.texture() 51 | .apply(textureContents), Minecraft.getInstance()); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/textures/AbstractTextureMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.mixins.workaround.textures; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import com.llamalad7.mixinextras.sugar.Cancellable; 16 | import com.mojang.blaze3d.textures.GpuTexture; 17 | import net.minecraft.client.Minecraft; 18 | import net.minecraft.client.renderer.texture.AbstractTexture; 19 | import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite; 20 | import org.spongepowered.asm.mixin.Mixin; 21 | import org.spongepowered.asm.mixin.Shadow; 22 | import org.spongepowered.asm.mixin.injection.At; 23 | import org.spongepowered.asm.mixin.injection.Inject; 24 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 25 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 26 | 27 | /** 28 | * I could probably upload the texture right here, 29 | * but I'm too lazy to figure out what mojang did with the renderer 30 | */ 31 | @Mixin(AbstractTexture.class) 32 | public class AbstractTextureMixin { 33 | @Shadow 34 | protected GpuTexture texture; 35 | 36 | @WrapOperation( 37 | method = { 38 | "setClamp", 39 | "setFilter(ZZ)V" 40 | }, 41 | at = @At( 42 | value = "NEW", 43 | target = "(Ljava/lang/String;)Ljava/lang/IllegalStateException;" 44 | ) 45 | ) 46 | private IllegalStateException rrls$supress(String s, Operation original, @Cancellable CallbackInfo ci) { 47 | ci.cancel(); 48 | return null; 49 | } 50 | 51 | @Inject( 52 | method = "getTexture", 53 | at = @At( 54 | value = "HEAD" 55 | ), 56 | cancellable = true 57 | ) 58 | public void rrls$useMissingTexture(CallbackInfoReturnable cir) { 59 | if (this.texture == null) cir.setReturnValue(Minecraft.getInstance().getTextureManager() 60 | .getTexture(MissingTextureAtlasSprite.getLocation()) 61 | .getTexture() 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/screens/ConfigurationSectionScreenProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.screens; 12 | 13 | import com.electronwill.nightconfig.core.UnmodifiableConfig; 14 | import net.minecraft.client.gui.screens.Screen; 15 | import net.minecraft.network.chat.Component; 16 | import net.neoforged.fml.config.ModConfig; 17 | import net.neoforged.neoforge.client.gui.ConfigurationScreen; 18 | import org.jetbrains.annotations.NotNull; 19 | import org.jetbrains.annotations.Nullable; 20 | import org.redlance.dima_dencep.mods.rrls.Rrls; 21 | 22 | public class ConfigurationSectionScreenProxy extends ConfigurationScreen.ConfigurationSectionScreen { 23 | public ConfigurationSectionScreenProxy(Screen parent, ModConfig.Type type, ModConfig modConfig, Component title) { 24 | super(parent, type, modConfig, title); 25 | } 26 | 27 | @Override 28 | @SuppressWarnings("deprecation") 29 | protected @Nullable Element createSection(@NotNull String key, @NotNull UnmodifiableConfig subconfig, @NotNull UnmodifiableConfig subsection) { 30 | ConfigurationScreen.ConfigurationSectionScreen currentSection = this.sectionCache.get(key); 31 | if (currentSection instanceof ConfigurationSectionScreenWithOverlay) { 32 | return super.createSection(key, subconfig, subsection); 33 | } 34 | 35 | ConfigurationScreen.ConfigurationSectionScreen old = this.sectionCache.put(key, new ConfigurationSectionScreenWithOverlay( 36 | this.context, this, subconfig.valueMap(), key, subsection.entrySet(), Component.translatable(getTranslationKey(key)) 37 | ).rebuild()); 38 | if (old != null) { 39 | Rrls.LOGGER.warn("Removed section ({}) from config!", old); 40 | } 41 | 42 | return super.createSection(key, subconfig, subsection); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/screens/ConfigurationSectionScreenWithOverlay.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.screens; 12 | 13 | import com.electronwill.nightconfig.core.UnmodifiableConfig; 14 | import net.minecraft.client.Minecraft; 15 | import net.minecraft.client.gui.screens.LoadingOverlay; 16 | import net.minecraft.client.gui.screens.Screen; 17 | import net.minecraft.network.chat.Component; 18 | import net.minecraft.server.packs.resources.ReloadInstance; 19 | import net.minecraft.util.Mth; 20 | import net.neoforged.neoforge.client.gui.ConfigurationScreen; 21 | import org.jetbrains.annotations.NotNull; 22 | 23 | import java.util.Map; 24 | import java.util.Set; 25 | import java.util.concurrent.CompletableFuture; 26 | 27 | public class ConfigurationSectionScreenWithOverlay extends ConfigurationScreen.ConfigurationSectionScreen implements ReloadInstance { 28 | protected final LoadingOverlay overlay; 29 | protected float currentProgress; 30 | 31 | public ConfigurationSectionScreenWithOverlay(Context parentContext, Screen parent, Map valueSpecs, String key, Set entrySet, Component title) { 32 | super(parentContext, parent, valueSpecs, key, entrySet, title); 33 | this.overlay = new LoadingOverlay(Minecraft.getInstance(), this, th -> {}, false); 34 | } 35 | 36 | public void resetProgress() { 37 | this.currentProgress = 0F; 38 | this.overlay.rrls$resetProgress(); 39 | if (this.minecraft != null && this.minecraft.overlay == null) { 40 | this.minecraft.setOverlay(this.overlay); 41 | } 42 | } 43 | 44 | @Override 45 | protected void onChanged(@NotNull String key) { 46 | super.onChanged(key); 47 | resetProgress(); 48 | } 49 | 50 | @Override 51 | public @NotNull ConfigurationSectionScreenWithOverlay rebuild() { 52 | super.rebuild(); 53 | return this; 54 | } 55 | 56 | @Override 57 | public void tick() { 58 | super.tick(); 59 | if (this.minecraft != null && this.minecraft.overlay == this.overlay) { 60 | this.currentProgress += 0.1F; 61 | } 62 | } 63 | 64 | @Override 65 | public void added() { 66 | super.added(); 67 | resetProgress(); 68 | } 69 | 70 | @Override 71 | public void removed() { 72 | super.removed(); 73 | if (this.minecraft != null && this.minecraft.overlay == this.overlay) { 74 | this.minecraft.setOverlay(null); 75 | } 76 | } 77 | 78 | @Override 79 | public @NotNull CompletableFuture done() { 80 | return CompletableFuture.completedFuture(null); 81 | } 82 | 83 | @Override 84 | public float getActualProgress() { 85 | return Mth.clamp(this.currentProgress, 0.0F, 1.0F); 86 | } 87 | 88 | @Override 89 | public boolean isDone() { 90 | return this.minecraft != null && this.minecraft.overlay == this.overlay && this.currentProgress > 1.5F; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/utils/DummyGuiGraphics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.utils; 12 | 13 | import com.mojang.blaze3d.vertex.VertexConsumer; 14 | import net.minecraft.client.Minecraft; 15 | import net.minecraft.client.gui.Font; 16 | import net.minecraft.client.gui.GuiGraphics; 17 | import net.minecraft.client.gui.navigation.ScreenRectangle; 18 | import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; 19 | import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner; 20 | import net.minecraft.client.renderer.MultiBufferSource; 21 | import net.minecraft.client.renderer.RenderType; 22 | import net.minecraft.client.renderer.texture.TextureAtlasSprite; 23 | import net.minecraft.client.resources.metadata.gui.GuiSpriteScaling; 24 | import net.minecraft.network.chat.Component; 25 | import net.minecraft.network.chat.FormattedText; 26 | import net.minecraft.network.chat.Style; 27 | import net.minecraft.resources.ResourceLocation; 28 | import net.minecraft.util.FormattedCharSequence; 29 | import net.minecraft.world.entity.LivingEntity; 30 | import net.minecraft.world.inventory.tooltip.TooltipComponent; 31 | import net.minecraft.world.item.ItemStack; 32 | import net.minecraft.world.level.Level; 33 | import org.jetbrains.annotations.Nullable; 34 | 35 | import java.util.List; 36 | import java.util.Optional; 37 | import java.util.function.Consumer; 38 | import java.util.function.Function; 39 | 40 | @SuppressWarnings("unused") 41 | public class DummyGuiGraphics extends GuiGraphics { 42 | public static final DummyGuiGraphics INSTANCE = new DummyGuiGraphics(); 43 | 44 | private DummyGuiGraphics() { 45 | super(Minecraft.getInstance(), null); 46 | } 47 | 48 | @Override 49 | public void flush() { 50 | } 51 | 52 | @Override 53 | public void hLine(int minX, int maxX, int y, int color) { 54 | } 55 | 56 | @Override 57 | public void hLine(RenderType renderType, int minX, int maxX, int y, int color) { 58 | } 59 | 60 | @Override 61 | public void vLine(int x, int minY, int maxY, int color) { 62 | } 63 | 64 | @Override 65 | public void vLine(RenderType renderType, int x, int minY, int maxY, int color) { 66 | } 67 | 68 | @Override 69 | public void enableScissor(int minX, int minY, int maxX, int maxY) { 70 | } 71 | 72 | @Override 73 | public void disableScissor() { 74 | } 75 | 76 | @Override 77 | public boolean containsPointInScissor(int x, int y) { 78 | return false; 79 | } 80 | 81 | @Override 82 | public void applyScissor(@Nullable ScreenRectangle rectangle) { 83 | } 84 | 85 | @Override 86 | public void fill(int minX, int minY, int maxX, int maxY, int color) { 87 | } 88 | 89 | @Override 90 | public void fill(int minX, int minY, int maxX, int maxY, int z, int color) { 91 | } 92 | 93 | @Override 94 | public void fill(RenderType renderType, int minX, int minY, int maxX, int maxY, int color) { 95 | } 96 | 97 | @Override 98 | public void fill(RenderType renderType, int minX, int minY, int maxX, int maxY, int z, int color) { 99 | } 100 | 101 | @Override 102 | public void fillGradient(int x1, int y1, int x2, int y2, int colorFrom, int colorTo) { 103 | } 104 | 105 | @Override 106 | public void fillGradient(int x1, int y1, int x2, int y2, int z, int colorFrom, int colorTo) { 107 | } 108 | 109 | @Override 110 | public void fillGradient(RenderType renderType, int x1, int y1, int x2, int y2, int colorFrom, int colorTo, int z) { 111 | } 112 | 113 | @Override 114 | public void fillGradient(VertexConsumer consumer, int x1, int y1, int x2, int y2, int z, int colorFrom, int colorTo) { 115 | } 116 | 117 | @Override 118 | public void fillRenderType(RenderType renderType, int x1, int y1, int x2, int y2, int z) { 119 | } 120 | 121 | @Override 122 | public void drawCenteredString(Font font, String text, int x, int y, int color) { 123 | } 124 | 125 | @Override 126 | public void drawCenteredString(Font font, Component text, int x, int y, int color) { 127 | } 128 | 129 | @Override 130 | public void drawCenteredString(Font font, FormattedCharSequence text, int x, int y, int color) { 131 | } 132 | 133 | @Override 134 | public int drawString(Font font, @Nullable String text, int x, int y, int color) { 135 | return -1; 136 | } 137 | 138 | @Override 139 | public int drawString(Font font, @Nullable String text, int x, int y, int color, boolean dropShadow) { 140 | return -1; 141 | } 142 | 143 | @Override 144 | public int drawString(Font font, FormattedCharSequence text, int x, int y, int color) { 145 | return -1; 146 | } 147 | 148 | @Override 149 | public int drawString(Font font, FormattedCharSequence text, int x, int y, int color, boolean dropShadow) { 150 | return -1; 151 | } 152 | 153 | @Override 154 | public int drawString(Font font, Component text, int x, int y, int color) { 155 | return -1; 156 | } 157 | 158 | @Override 159 | public int drawString(Font font, Component text, int x, int y, int color, boolean dropShadow) { 160 | return -1; 161 | } 162 | 163 | @Override 164 | public void drawWordWrap(Font font, FormattedText text, int x, int y, int lineWidth, int color) { 165 | } 166 | 167 | @Override 168 | public void drawWordWrap(Font font, FormattedText text, int x, int y, int lineWidth, int color, boolean dropShadow) { 169 | } 170 | 171 | @Override 172 | public int drawStringWithBackdrop(Font font, Component text, int x, int y, int xOffset, int color) { 173 | return -1; 174 | } 175 | 176 | @Override 177 | public void renderOutline(int x, int y, int width, int height, int color) { 178 | } 179 | 180 | @Override 181 | public void blitSprite(Function renderTypeGetter, ResourceLocation sprite, int x, int y, int width, int height) { 182 | } 183 | 184 | @Override 185 | public void blitSprite(Function renderTypeGetter, ResourceLocation sprite, int x, int y, int width, int height, int blitOffset) { 186 | } 187 | 188 | @Override 189 | public void blitSprite(Function renderTypeGetter, ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight) { 190 | } 191 | 192 | @Override 193 | public void blitSprite(Function renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height) { 194 | } 195 | 196 | @Override 197 | public void blitSprite(Function renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height, int blitOffset) { 198 | } 199 | 200 | @Override 201 | public void blitSprite(Function renderTypeGetter, TextureAtlasSprite sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight, int blitOffset) { 202 | } 203 | 204 | @Override 205 | public void blitNineSlicedSprite(Function renderTypeGetter, TextureAtlasSprite sprite, GuiSpriteScaling.NineSlice nineSlice, int x, int y, int blitOffset, int width, int height) { 206 | } 207 | 208 | @Override 209 | public void blitNineSliceInnerSegment(Function renderTypeGetter, GuiSpriteScaling.NineSlice nineSlice, TextureAtlasSprite sprite, int x, int y, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight, int blitOffset) { 210 | } 211 | 212 | @Override 213 | public void blitTiledSprite(Function renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight, int blitOffset) { 214 | } 215 | 216 | @Override 217 | public void blit(Function renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight, int color) { 218 | } 219 | 220 | @Override 221 | public void blit(Function renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) { 222 | } 223 | 224 | @Override 225 | public void blit(Function renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int width, int height, int textureWidth, int textureHeight) { 226 | } 227 | 228 | @Override 229 | public void blit(Function renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int width, int height, int textureWidth, int textureHeight, int color) { 230 | } 231 | 232 | @Override 233 | public void innerBlit(Function renderTypeGetter, ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, float minU, float maxU, float minV, float maxV, int color) { 234 | } 235 | 236 | @Override 237 | public void renderItem(ItemStack stack, int x, int y) { 238 | } 239 | 240 | @Override 241 | public void renderItem(ItemStack stack, int x, int y, int seed) { 242 | } 243 | 244 | @Override 245 | public void renderItem(ItemStack stack, int x, int y, int seed, int guiOffset) { 246 | } 247 | 248 | @Override 249 | public void renderFakeItem(ItemStack stack, int x, int y) { 250 | } 251 | 252 | @Override 253 | public void renderFakeItem(ItemStack stack, int x, int y, int seed) { 254 | } 255 | 256 | @Override 257 | public void renderItem(LivingEntity entity, ItemStack stack, int x, int y, int seed) { 258 | } 259 | 260 | @Override 261 | public void renderItem(@Nullable LivingEntity entity, @Nullable Level level, ItemStack stack, int x, int y, int seed) { 262 | } 263 | 264 | @Override 265 | public void renderItem(@Nullable LivingEntity entity, @Nullable Level level, ItemStack stack, int x, int y, int seed, int guiOffset) { 266 | } 267 | 268 | @Override 269 | public void renderItemDecorations(Font font, ItemStack stack, int x, int y) { 270 | } 271 | 272 | @Override 273 | public void renderItemDecorations(Font font, ItemStack stack, int x, int y, @Nullable String text) { 274 | } 275 | 276 | @Override 277 | public void renderTooltip(Font font, ItemStack stack, int mouseX, int mouseY) { 278 | } 279 | 280 | @Override 281 | public void renderTooltip(Font font, List tooltipLines, Optional visualTooltipComponent, int mouseX, int mouseY) { 282 | } 283 | 284 | @Override 285 | public void renderTooltip(Font font, List tooltipLines, Optional visualTooltipComponent, int mouseX, int mouseY, @Nullable ResourceLocation sprite) { 286 | } 287 | 288 | @Override 289 | public void renderTooltip(Font font, Component text, int mouseX, int mouseY) { 290 | } 291 | 292 | @Override 293 | public void renderTooltip(Font font, Component text, int mouseX, int mouseY, @Nullable ResourceLocation sprite) { 294 | } 295 | 296 | @Override 297 | public void renderComponentTooltip(Font font, List tooltipLines, int mouseX, int mouseY) { 298 | } 299 | 300 | @Override 301 | public void renderComponentTooltip(Font font, List tooltipLines, int mouseX, int mouseY, @Nullable ResourceLocation sprite) { 302 | } 303 | 304 | @Override 305 | public void renderTooltip(Font font, List tooltipLines, int mouseX, int mouseY) { 306 | } 307 | 308 | @Override 309 | public void renderTooltip(Font font, List tooltipLines, int mouseX, int mouseY, @Nullable ResourceLocation sprite) { 310 | } 311 | 312 | @Override 313 | public void renderTooltip(Font font, List tooltipLines, ClientTooltipPositioner tooltipPositioner, int mouseX, int mouseY) { 314 | } 315 | 316 | @Override 317 | public void renderTooltipInternal(Font font, List tooltipLines, int mouseX, int mouseY, ClientTooltipPositioner tooltipPositioner, @Nullable ResourceLocation sprite) { 318 | } 319 | 320 | @Override 321 | public void renderItemBar(ItemStack stack, int x, int y) { 322 | } 323 | 324 | @Override 325 | public void renderItemCount(Font font, ItemStack stack, int x, int y, @Nullable String text) { 326 | } 327 | 328 | @Override 329 | public void renderItemCooldown(ItemStack stack, int x, int y) { 330 | } 331 | 332 | @Override 333 | public void renderComponentHoverEffect(Font font, @Nullable Style style, int mouseX, int mouseY) { 334 | } 335 | 336 | @Override 337 | public void drawSpecial(Consumer drawer) { 338 | } 339 | } 340 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/utils/Ease.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.utils; 12 | 13 | import java.util.function.Function; 14 | 15 | /** 16 | * Easings form easings.net
17 | * + constant + linear 18 | */ 19 | public enum Ease { 20 | LINEAR(0, arg -> easeIn(f -> f)), 21 | CONSTANT(1, arg -> easeIn(f -> 0f)), 22 | 23 | // Sine 24 | INSINE(6, arg -> easeIn(Easing::sine)), 25 | OUTSINE(7, arg -> easeOut(Easing::sine)), 26 | INOUTSINE(8, arg -> easeInOut(Easing::sine)), 27 | 28 | // Cubic 29 | INCUBIC(9, arg -> easeIn(Easing::cubic)), 30 | OUTCUBIC(10, arg -> easeOut(Easing::cubic)), 31 | INOUTCUBIC(11, arg -> easeInOut(Easing::cubic)), 32 | 33 | // Quadratic 34 | INQUAD(12, arg -> easeIn(Easing::quadratic)), 35 | OUTQUAD(13, arg -> easeOut(Easing::quadratic)), 36 | INOUTQUAD(14, arg -> easeInOut(Easing::quadratic)), 37 | 38 | // Quart 39 | INQUART(15, arg -> easeIn(Easing.pow(4))), 40 | OUTQUART(16, arg -> easeOut(Easing.pow(4))), 41 | INOUTQUART(17, arg -> easeInOut(Easing.pow(4))), 42 | 43 | // Quint 44 | INQUINT(18, arg -> easeIn(Easing.pow(5))), 45 | OUTQUINT(19, arg -> easeOut(Easing.pow(5))), 46 | INOUTQUINT(20, arg -> easeInOut(Easing.pow(5))), 47 | 48 | // Expo 49 | INEXPO(21, arg -> easeIn(Easing::exp)), 50 | OUTEXPO(22, arg -> easeOut(Easing::exp)), 51 | INOUTEXPO(23, arg -> easeInOut(Easing::exp)), 52 | 53 | // Cricle 54 | INCIRC(24, arg -> easeIn(Easing::circle)), 55 | OUTCIRC(25, arg -> easeOut(Easing::circle)), 56 | INOUTCIRC(26, arg -> easeInOut(Easing::circle)), 57 | 58 | // Back 59 | INBACK(27, arg -> easeIn(Easing.back(arg))), 60 | OUTBACK(28, arg -> easeOut(Easing.back(arg))), 61 | INOUTBACK(29, arg -> easeInOut(Easing.back(arg))), 62 | 63 | // Elastic 64 | INELASTIC(30, arg -> easeIn(Easing.elastic(arg))), 65 | OUTELASTIC(31, arg -> easeOut(Easing.elastic(arg))), 66 | INOUTELASTIC(32, arg -> easeInOut(Easing.elastic(arg))), 67 | 68 | // Bounce 69 | INBOUNCE(33, arg -> easeIn(Easing.bounce(arg))), 70 | OUTBOUNCE(34, arg -> easeOut(Easing.bounce(arg))), 71 | INOUTBOUNCE(35, arg -> easeInOut(Easing.bounce(arg))), 72 | 73 | CATMULLROM(36, arg -> easeInOut(Easing::catmullRom)), 74 | STEP(37, arg -> easeIn(Easing.step(arg))); 75 | 76 | final byte id; 77 | private final Function> impl; 78 | 79 | /** 80 | * @param id id 81 | * @param impl implementation 82 | */ 83 | Ease(byte id, Function> impl) { 84 | this.id = id; 85 | this.impl = impl; 86 | } 87 | 88 | /** 89 | * @param id id 90 | * @param impl implementation 91 | */ 92 | Ease(int id, Function> impl) { 93 | this((byte) id, impl); 94 | } 95 | 96 | /** 97 | * Run the easing 98 | * @param t float between 0 and 1 99 | * @param n float easing argument 100 | * @return ease(t, n) 101 | */ 102 | public float invoke(float t, Float n) { 103 | return this.impl.apply(n).apply(t); 104 | } 105 | 106 | public static Function easeIn(Function function) { 107 | return function; 108 | } 109 | 110 | public static Function easeOut(Function function) { 111 | return time -> 1 - function.apply(1 - time); 112 | } 113 | 114 | public static Function easeInOut(Function function) { 115 | return time -> { 116 | if (time < 0.5F) { 117 | return function.apply(time * 2F) / 2F; 118 | } 119 | 120 | return 1 - function.apply((1 - time) * 2F) / 2F; 121 | }; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/utils/Easing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.utils; 12 | 13 | import java.util.function.Function; 14 | 15 | public class Easing { 16 | public static float sine(float n) { 17 | return 1 - (float) Math.cos(n * Math.PI / 2F); 18 | } 19 | 20 | public static float cubic(float n) { 21 | return n * n * n; 22 | } 23 | 24 | public static float quadratic(float n) { 25 | return n * n; 26 | } 27 | 28 | public static Function pow(float n) { 29 | return t -> (float) Math.pow(t, n); 30 | } 31 | 32 | public static float exp(float n) { 33 | return (float) Math.pow(2, 10 * (n - 1)); 34 | } 35 | 36 | public static float circle(float n) { 37 | return 1 - (float) Math.sqrt(1 - n * n); 38 | } 39 | 40 | public static Function back(Float n) { 41 | final float n2 = n == null ? 1.70158F : n * 1.70158F; 42 | 43 | return t -> t * t * ((n2 + 1) * t - n2); 44 | } 45 | 46 | public static Function elastic(Float n) { 47 | float n2 = n == null ? 1 : n; 48 | 49 | return t -> (float) (1 - Math.pow(Math.cos(t * Math.PI / 2f), 3) * Math.cos(t * n2 * Math.PI)); 50 | } 51 | 52 | public static Function bounce(Float n) { 53 | final float n2 = n == null ? 0.5F : n; 54 | 55 | Function one = x -> 121f / 16f * x * x; 56 | Function two = x -> (float) (121f / 4f * n2 * Math.pow(x - 6f / 11f, 2) + 1 - n2); 57 | Function three = x -> (float) (121 * n2 * n2 * Math.pow(x - 9f / 11f, 2) + 1 - n2 * n2); 58 | Function four = x -> (float) (484 * n2 * n2 * n2 * Math.pow(x - 10.5f / 11f, 2) + 1 - n2 * n2 * n2); 59 | 60 | return t -> Math.min(Math.min(one.apply(t), two.apply(t)), Math.min(three.apply(t), four.apply(t))); 61 | } 62 | 63 | public static Function step(Float n) { 64 | float n2 = n == null ? 2 : n; 65 | 66 | if (n2 < 2) 67 | throw new IllegalArgumentException("Steps must be >= 2, got: " + n2); 68 | 69 | final int steps = (int)n2; 70 | 71 | return t -> { 72 | float result = 0; 73 | 74 | if (t < 0) 75 | return result; 76 | 77 | float stepLength = (1 / (float)steps); 78 | 79 | if (t > (result = (steps - 1) * stepLength)) 80 | return result; 81 | 82 | int testIndex; 83 | int leftBorderIndex = 0; 84 | int rightBorderIndex = steps - 1; 85 | 86 | while (rightBorderIndex - leftBorderIndex != 1) { 87 | testIndex = leftBorderIndex + (rightBorderIndex - leftBorderIndex) / 2; 88 | 89 | if (t >= testIndex * stepLength) { 90 | leftBorderIndex = testIndex; 91 | } 92 | else { 93 | rightBorderIndex = testIndex; 94 | } 95 | } 96 | 97 | return leftBorderIndex * stepLength; 98 | }; 99 | } 100 | 101 | public static float catmullRom(float n) { 102 | return (0.5f * (2.0f * (n + 1) + ((n + 2) - n) * 1 103 | + (2.0f * n - 5.0f * (n + 1) + 4.0f * (n + 2) - (n + 3)) * 1 104 | + (3.0f * (n + 1) - n - 3.0f * (n + 2) + (n + 3)) * 1)); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/utils/GuiGraphicsGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.utils; 12 | 13 | import net.minecraft.client.gui.GuiGraphics; 14 | import org.objectweb.asm.ClassReader; 15 | import org.objectweb.asm.ClassVisitor; 16 | import org.objectweb.asm.ClassWriter; 17 | import org.objectweb.asm.MethodVisitor; 18 | import org.objectweb.asm.tree.AnnotationNode; 19 | import org.objectweb.asm.tree.ClassNode; 20 | import org.objectweb.asm.tree.MethodNode; 21 | import org.redlance.dima_dencep.mods.rrls.Rrls; 22 | import org.spongepowered.asm.util.asm.ASM; 23 | 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | import java.nio.file.Files; 27 | import java.nio.file.Path; 28 | import java.util.ArrayList; 29 | import java.util.Objects; 30 | 31 | public class GuiGraphicsGenerator extends ClassVisitor { 32 | protected final ClassNode output; 33 | 34 | protected GuiGraphicsGenerator(ClassNode output) { 35 | super(ASM.API_VERSION); 36 | this.output = output; 37 | } 38 | 39 | @Override 40 | public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { 41 | for (MethodNode node : this.output.methods) { 42 | if (node.name.equals(name) && node.desc.equals(descriptor)) { 43 | Rrls.LOGGER.info("Skipping {}{}...", name, descriptor); 44 | 45 | return super.visitMethod(access, name, descriptor, signature, exceptions); 46 | } 47 | } 48 | 49 | MethodNode methodNode = new MethodNode(access, name, descriptor, signature, exceptions); 50 | if (methodNode.invisibleAnnotations == null) { 51 | methodNode.invisibleAnnotations = new ArrayList<>(); 52 | } 53 | methodNode.invisibleAnnotations.add(new AnnotationNode("Ljava/lang/Override;")); 54 | 55 | Rrls.LOGGER.info("Adding {}{}...", name, descriptor); 56 | this.output.methods.add(methodNode); 57 | 58 | return methodNode; 59 | } 60 | 61 | public static void main(String... args) throws IOException { 62 | ClassNode guiGraphicsNode = GuiGraphicsGenerator.readClassNode(GuiGraphics.class, ClassReader.SKIP_CODE | ClassReader.SKIP_FRAMES); 63 | ClassNode dummyGuiGraphics = GuiGraphicsGenerator.readClassNode(DummyGuiGraphics.class, ClassReader.EXPAND_FRAMES); 64 | 65 | guiGraphicsNode.accept(new GuiGraphicsGenerator(dummyGuiGraphics)); 66 | 67 | ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); 68 | dummyGuiGraphics.accept(writer); 69 | 70 | Files.write(Path.of("DummyGuiGraphics.class"), writer.toByteArray()); 71 | } 72 | 73 | private static ClassNode readClassNode(Class clazz, int parsingOptions) { 74 | ClassNode classNode = new ClassNode(); 75 | 76 | try (InputStream is = clazz.getClassLoader().getResourceAsStream( 77 | clazz.getName().replace(".", "/") + ".class") 78 | ) { 79 | ClassReader cr = new ClassReader(Objects.requireNonNull(is)); 80 | cr.accept(classNode, parsingOptions); 81 | } catch (IOException e) { 82 | Rrls.LOGGER.warn("Failed to read '{}'!", clazz.getName()); 83 | } 84 | 85 | return classNode; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/utils/OverlayHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.utils; 12 | 13 | import net.minecraft.client.gui.screens.GenericMessageScreen; 14 | import net.minecraft.client.gui.screens.Overlay; 15 | import net.minecraft.client.gui.screens.Screen; 16 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 17 | 18 | public class OverlayHelper { 19 | public static State lookupState(Screen screen, boolean reloading) { 20 | if (!RrlsConfig.hideType().canHide(reloading)) 21 | return State.DEFAULT; 22 | 23 | if (reloading || RrlsConfig.hideType().forceClose()) 24 | return State.HIDE; 25 | 26 | if (screen instanceof GenericMessageScreen) // Loading Minecraft 27 | return State.WAIT; 28 | 29 | return screen != null ? State.HIDE : State.WAIT; 30 | } 31 | 32 | public static boolean isRenderingState(Overlay overlay) { 33 | return overlay != null && overlay.rrls$getState().isRendering(); 34 | } 35 | 36 | public enum State { 37 | DEFAULT(false), 38 | HIDE(true), 39 | WAIT(false); 40 | 41 | private final boolean render; 42 | 43 | State(boolean r) { 44 | this.render = r; 45 | } 46 | 47 | public boolean isRendering() { 48 | return render; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /common/src/main/java/org/redlance/dima_dencep/mods/rrls/utils/RainbowUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.utils; 12 | 13 | import net.minecraft.Util; 14 | import net.minecraft.util.ARGB; 15 | import net.minecraft.util.Mth; 16 | 17 | public class RainbowUtils { 18 | private static float makeChannel(float speed, float shift, int offset) { 19 | return (1F + Mth.sin(speed * shift + offset)) * 0.5F; 20 | } 21 | 22 | public static int rainbowColor(float alpha) { 23 | float time = Util.getNanos() * 1E-9F; 24 | float speed = 0.5F; // TODO config 25 | 26 | return ARGB.colorFromFloat(alpha, 27 | makeChannel(speed, time, 0), 28 | makeChannel(speed, time, 2), 29 | makeChannel(speed, time, 4) 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /common/src/main/resources/architectury.common.json: -------------------------------------------------------------------------------- 1 | { 2 | "injected_interfaces": { 3 | "net/minecraft/class_4071": [ 4 | "org/redlance/dima_dencep/mods/rrls/duck/OverlayExtender" 5 | ] 6 | }, 7 | "accessWidener": "rrls.accesswidener" 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/be_by.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Remove Reloading Screen", 3 | "rrls.configuration.hideOverlays": "Схаваць экраны перазагрузкі", 4 | "rrls.configuration.rgbProgress": "Каляровы радок прагрэсу", 5 | "rrls.configuration.rgbProgress.tooltip": "§cМОЖА ВЫКЛІКАЦЬ ЭПІЛЕПСІЮ", 6 | "rrls.configuration.miniRender": "Адлюстраванне прагрэссу перазагрузкі пакетаў рэсурсаў", 7 | "rrls.configuration.resetResources": "Скідваць пакеты рэсурсаў, калі не атрымалася загрузіць", 8 | "rrls.configuration.reInitScreen": "Рэініцыялізацыя бягучага экрана пасля перазагрузкі", 9 | "rrls.configuration.reInitScreen.tooltip": "Адключэнне гэтай функцыі можа выклікаць праблемы пасля сканчэння перазагрузкі" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Remove Reloading Screen", 3 | "rrls.configuration.global": "Global", 4 | "rrls.configuration.splash": "Splash overlay", 5 | "rrls.configuration.interpolation": "Interpolation", 6 | "rrls.configuration.other": "Other", 7 | "rrls.configuration.platform": "Platform-specific", 8 | "rrls.configuration.hideOverlays": "Overlays that will be hidden", 9 | "rrls.configuration.rgbProgress": "Colorful", 10 | "rrls.configuration.rgbProgress.tooltip": "§cMAY CAUSE EPILEPSY", 11 | "rrls.configuration.miniRender": "Render a mini (aka hidden) version of the overlay", 12 | "rrls.configuration.enableScissor": "Trim the rendering of the default overlay", 13 | "rrls.configuration.enableScissor.tooltip": "Enable this if the window is flooded with color (mostly black)", 14 | "rrls.configuration.type": "What will be displayed on reloading", 15 | "rrls.configuration.reloadText": "The text that will be displayed if TEXT is selected above", 16 | "rrls.configuration.interpolateProgress": "Interpolate progress", 17 | "rrls.configuration.interpolateProgress.tooltip": "In vanilla minecraft interpolation starts at ~75%, turn it on if you want to do progress based interpolation.\nThis can lead to early fading, but is necessary for some easings.", 18 | "rrls.configuration.interpolateAtEnd": "Interpolate at the end", 19 | "rrls.configuration.interpolateAtEnd.tooltip": "Start interpolation only when the progress bar is completely filled.", 20 | "rrls.configuration.ease": "Easing", 21 | "rrls.configuration.ease.tooltip": "See https://easings.net/", 22 | "rrls.configuration.easingArg": "Easing argument", 23 | "rrls.configuration.resetResources": "Reset resources when failed load", 24 | "rrls.configuration.reInitScreen": "Reinitializing the current screen after a reload", 25 | "rrls.configuration.reInitScreen.tooltip": "Disabling this feature may eliminate the hang-up after the reload is complete", 26 | "rrls.configuration.earlyPackStatusSend": "Early sending of status about server resourcepack", 27 | "rrls.configuration.earlyPackStatusSend.tooltip": "Some servers specifically wait for the player to load resources, because of this the game may be displayed incorrectly\nExample: You were underground while reloading resources", 28 | "rrls.configuration.animationSpeed": "Splash animation speed", 29 | "rrls.configuration.animationSpeed.tooltip": "In milliseconds", 30 | "rrls.configuration.doubleLoad": "Reload resources again if an error occurs", 31 | "rrls.configuration.blockOverlay": "Complete blocking of overlay usage", 32 | "rrls.configuration.blockOverlay.tooltip": "Use at your own risk!", 33 | "rrls.configuration.skipForgeOverlay": "Replace the (Neo)Forge loading overlay with vanilla", 34 | "rrls.configuration.type.progress": "Progress Bar", 35 | "rrls.configuration.type.text": "Custom text", 36 | "rrls.configuration.type.textbg": "Custom text with background", 37 | "rrls.configuration.type.none": "Nothing", 38 | "rrls.configuration.hide.all": "All overlays", 39 | "rrls.configuration.hide.loading": "Loading only", 40 | "rrls.configuration.hide.reloading": "Reloading only", 41 | "rrls.configuration.doubleload.force": "Force load", 42 | "rrls.configuration.doubleload.load": "Load", 43 | "rrls.configuration.hide_doubleload.none": "None" 44 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/es_mx.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Remove Reloading Screen", 3 | "rrls.configuration.global": "Global", 4 | "rrls.configuration.splash": "Superposición de pantalla de inicio", 5 | "rrls.configuration.other": "Otro", 6 | "rrls.configuration.platform": "Específico de la plataforma", 7 | "rrls.configuration.hideOverlays": "Superposiciones que se ocultarán", 8 | "rrls.configuration.rgbProgress": "Colorido", 9 | "rrls.configuration.rgbProgress.tooltip": "§cPUEDE CAUSAR EPILEPSIA", 10 | "rrls.configuration.miniRender": "Mostrar una versión mini (oculta) de la superposición", 11 | "rrls.configuration.type": "Lo que se mostrará al recargar", 12 | "rrls.configuration.reloadText": "El texto que se mostrará si se selecciona TEXTO arriba", 13 | "rrls.configuration.resetResources": "Restablecer recursos cuando la carga falla", 14 | "rrls.configuration.reInitScreen": "Reinicializar la pantalla actual después de una recarga", 15 | "rrls.configuration.reInitScreen.tooltip": "Desactivar esta función puede eliminar el bloqueo después de que se complete la recarga", 16 | "rrls.configuration.removeOverlayAtEnd": "Ocultar la superposición al final", 17 | "rrls.configuration.removeOverlayAtEnd.tooltip": "¿Carga infinita?", 18 | "rrls.configuration.earlyPackStatusSend": "Envío temprano del estado del paquete de recursos del servidor", 19 | "rrls.configuration.earlyPackStatusSend.tooltip": "Algunos servidores esperan específicamente a que el jugador cargue los recursos, debido a esto, el juego puede mostrarse incorrectamente\nEjemplo: Estabas bajo tierra mientras se recargaban los recursos", 20 | "rrls.configuration.animationSpeed": "Velocidad de animación de la pantalla de inicio", 21 | "rrls.configuration.animationSpeed.tooltip": "En milisegundos", 22 | "rrls.configuration.doubleLoad": "Volver a cargar los recursos si ocurre un error", 23 | "rrls.configuration.blockOverlay": "Bloqueo completo del uso de superposiciones", 24 | "rrls.configuration.blockOverlay.tooltip": "¡Úsalo bajo tu propio riesgo!", 25 | "rrls.configuration.skipForgeOverlay": "Reemplaza la superposición de carga de (Neo)Forge con la de vainilla" 26 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/it_it.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Rimuovi la schermata di ri-caricamento (Remove Reloading Screen)", 3 | "rrls.configuration.hideOverlays": "Nascondi la schermata di ri-caricamento", 4 | "rrls.configuration.rgbProgress": "Barra di avanzamento colorata", 5 | "rrls.configuration.rgbProgress.tooltip": "§cPOTREBBE CAUSARE EPILESSIA", 6 | "rrls.configuration.miniRender": "Visualizzazione del processo di ricaricamento dei pacchetti di risorse", 7 | "rrls.configuration.resetResources": "Ripristina i pacchetti di risorse se il caricamento fallisce", 8 | "rrls.configuration.reInitScreen": "Reinizza la schermata corrente dopo un ricaricamento", 9 | "rrls.configuration.reInitScreen.tooltip": "La disattivare questa funzione può eliminare il blocco dopo il completamento del ricaricamento" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/pt_br.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Remover tela de recarga", 3 | "rrls.configuration.hideOverlays": "Ocultar tela de recarga", 4 | "rrls.configuration.rgbProgress": "Texto colorido ao recarregar", 5 | "rrls.configuration.rgbProgress.tooltip": "PODE CAUSAR EPILEPSIA", 6 | "rrls.configuration.miniRender": "Exibição do processo de recarga de recursos", 7 | "rrls.configuration.resetResources": "Redefinir recursos quando falha no carregamento", 8 | "rrls.configuration.reInitScreen": "Reiniciando a tela atual após uma recarga", 9 | "rrls.configuration.reInitScreen.tooltip": "Desativar esse recurso pode eliminar o desligamento após a conclusão do recarregamento", 10 | "rrls.configuration.reloadText": "Recarregar texto" 11 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/ru_ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Удалить экран перезагрузки (Remove Reloading Screen)", 3 | "rrls.configuration.global": "Глобальные", 4 | "rrls.configuration.splash": "Экран (пере)загрузки", 5 | "rrls.configuration.interpolation": "Интерполяция", 6 | "rrls.configuration.other": "Прочее", 7 | "rrls.configuration.platform": "Для конкретной платформы", 8 | "rrls.configuration.hideOverlays": "Оверлеи, которые будут скрыты", 9 | "rrls.configuration.rgbProgress": "Разноцветность", 10 | "rrls.configuration.rgbProgress.tooltip": "§cМОЖЕТ ВЫЗВАТЬ ЭПИЛЕПСИЮ", 11 | "rrls.configuration.miniRender": "Отображение мини(скрытой)-версии оверлея", 12 | "rrls.configuration.enableScissor": "Обрезать рендеринг стандартного оверлея", 13 | "rrls.configuration.enableScissor.tooltip": "Включите эту опцию, если окно заливается цветом (в основном черным)", 14 | "rrls.configuration.type": "Что будет отображаться при перезагрузке", 15 | "rrls.configuration.reloadText": "Текст, который будет отображаться, если выше выбран пункт TEXT", 16 | "rrls.configuration.interpolateProgress": "Интерполировать прогресс", 17 | "rrls.configuration.interpolateProgress.tooltip": "В ванильном minecraft интерполяция начинается с ~75%, включите ее, если хотите делать интерполяцию на основе прогресса.\nЭто может привести к раннему затуханию, но необходимо для некоторых изингов.", 18 | "rrls.configuration.interpolateAtEnd": "Интерполировать в конце", 19 | "rrls.configuration.interpolateAtEnd.tooltip": "Начинать интерполяцию только тогда, когда индикатор выполнения полностью заполнится.", 20 | "rrls.configuration.ease": "Изинг", 21 | "rrls.configuration.ease.tooltip": "См. https://easings.net/", 22 | "rrls.configuration.easingArg": "Аргумент изинга", 23 | "rrls.configuration.resetResources": "Сброс ресурсов при неудачной загрузке", 24 | "rrls.configuration.reInitScreen": "Повторная инициализация текущего экрана после перезагрузки", 25 | "rrls.configuration.reInitScreen.tooltip": "Отключение этой функции может устранить зависание после завершения перезагрузки", 26 | "rrls.configuration.earlyPackStatusSend": "Ранняя отправка статуса о состоянии ресурспака сервера", 27 | "rrls.configuration.earlyPackStatusSend.tooltip": "Некоторые серверы специально ждут, пока игрок загрузит ресурсы, из-за этого игра может отображаться некорректно\nНапример: Вы оказались под землей во время перезагрузки ресурсов", 28 | "rrls.configuration.animationSpeed": "Скорость анимации сплеша", 29 | "rrls.configuration.animationSpeed.tooltip": "В милисекундах", 30 | "rrls.configuration.doubleLoad": "Повторная загрузка ресурсов при возникновении ошибки", 31 | "rrls.configuration.blockOverlay": "Полная блокировка использований оверлеев", 32 | "rrls.configuration.blockOverlay.tooltip": "Используйте на свой страх и риск!", 33 | "rrls.configuration.skipForgeOverlay": "Заменяет оверлей загрузки (Neo)Forge на ванильный", 34 | "rrls.configuration.type.progress": "Прогресс-бар", 35 | "rrls.configuration.type.text": "Пользовательский текст", 36 | "rrls.configuration.type.textbg": "Пользовательский текст с фоном", 37 | "rrls.configuration.type.none": "Ничего", 38 | "rrls.configuration.hide.all": "Все наложения", 39 | "rrls.configuration.hide.loading": "Только загрузка", 40 | "rrls.configuration.hide.reloading": "Только перезагрузка", 41 | "rrls.configuration.doubleload.force": "Принудительная загрузка", 42 | "rrls.configuration.doubleload.load": "Загрузка", 43 | "rrls.configuration.hide_doubleload.none": "Ничего" 44 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/tt_ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "modmenu.descriptionTranslation.rrls": "Ресурслар яңадан йөкләү экранын бетерә, һәм яңадан кушу вакытында уенны ачык калдыра", 3 | "rrls.configuration.title": "Remove Reloading Screen көйләүләре", 4 | "rrls.configuration.hideOverlays": "Яңадан йөкләү экранын яшерү", 5 | "rrls.configuration.rgbProgress": "Төсле прогрессбар", 6 | "rrls.configuration.rgbProgress.tooltip": "§cЭПИЛЕПСИЯНЕ ЧАКЫРА АЛА", 7 | "rrls.configuration.miniRender": "Ресурслар яңадан йөкләү процессын күрсәтү", 8 | "rrls.configuration.type": "Яңадан йөкләгәндә күрсәтелүче", 9 | "rrls.configuration.reloadText": "Күрсәтеләчәҡ текст, әгәр TEXT өстә сайланса", 10 | "rrls.configuration.resetResources": "Йөкләп булмаганда ресурсларын ташлату", 11 | "rrls.configuration.reInitScreen": "Яңадан йөкләүдән соң хәзерге экран кабат әзерләү", 12 | "rrls.configuration.reInitScreen.tooltip": "Функция сүндерелгәндә, яңадан йөкләүне тәмамланганнан соң асылынып торуны бетерә ала", 13 | "rrls.configuration.earlyPackStatusSend": "Серверның ресурс җыелмасы турында халәтне иртә җибәрү", 14 | "rrls.configuration.earlyPackStatusSend.tooltip": "Уенчы ресурсларны йөкләү өчен кайбер серверлар махсус көтә, бу сәбәпле уен ялгыш күрсәтә ала\nМәсәлән: Ресурслар яңадан йөкләнгәндә Сез җир астында булды", 15 | "rrls.configuration.animationSpeed": "Спләш анимациясе тизлеге", 16 | "rrls.configuration.animationSpeed.tooltip": "Миллисекундта" 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/uk_ua.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "Налаштування Remove Reloading Screen", 3 | "rrls.configuration.global": "Глобальні", 4 | "rrls.configuration.splash": "Накладення спливного тексту", 5 | "rrls.configuration.interpolation": "Інтерполяція", 6 | "rrls.configuration.other": "Інше", 7 | "rrls.configuration.platform": "Окрема платформа", 8 | "rrls.configuration.hideOverlays": "Накладання, які будуть приховані", 9 | "rrls.configuration.rgbProgress": "Барвистий", 10 | "rrls.configuration.rgbProgress.tooltip": "§cМОЖЕ ВИКЛИКАТИ ЕПІЛЕПСІЮ", 11 | "rrls.configuration.miniRender": "Промальовувати малу (також приховану) версію накладення", 12 | "rrls.configuration.enableScissor": "Обрізати промальовування типового накладення", 13 | "rrls.configuration.enableScissor.tooltip": "Увімкніть це, якщо вікно заливається кольором (переважно чорним)", 14 | "rrls.configuration.type": "Що показуватиметься під час перезавантаження", 15 | "rrls.configuration.reloadText": "Текст, який промальовуватиметься, якщо вище вибрано TEXT", 16 | "rrls.configuration.interpolateProgress": "Прогрес інтерполяції", 17 | "rrls.configuration.interpolateProgress.tooltip": "У ванільному Minecraft інтерполяція починається з ~75%, увімкніть її, якщо ви хочете зробити інтерполяцію на основі прогресу\nЦе може призвести до раннього затухання, але необхідно для деяких послаблень", 18 | "rrls.configuration.interpolateAtEnd": "Інтерполяція в кінці", 19 | "rrls.configuration.interpolateAtEnd.tooltip": "Почати інтерполяцію лише тоді, коли панель виконання буде повністю заповнена.", 20 | "rrls.configuration.ease": "Пом'якшення", 21 | "rrls.configuration.ease.tooltip": "Див. https://easings.net/", 22 | "rrls.configuration.easingArg": "Аргумент послаблення", 23 | "rrls.configuration.resetResources": "Скидання ресурсів у разі помилки завантаження", 24 | "rrls.configuration.reInitScreen": "Повторна ініціалізація поточного екрана після перезавантаження", 25 | "rrls.configuration.reInitScreen.tooltip": "Вимкнення цієї функції може усунути зависання після завершення перезавантаження", 26 | "rrls.configuration.earlyPackStatusSend": "Раннє надсилання статусу пакета ресурсів сервера", 27 | "rrls.configuration.earlyPackStatusSend.tooltip": "Деякі сервери спеціально чекають, поки гравець завантажить ресурси, через це гра може промальовуватися некоректно\nПриклад: під час перезавантаження ресурсів ви були під землею", 28 | "rrls.configuration.animationSpeed": "Швидкість анімації спливного тексту", 29 | "rrls.configuration.animationSpeed.tooltip": "У мілісекундах", 30 | "rrls.configuration.doubleLoad": "Перезавантажте ресурси, якщо сталася помилка", 31 | "rrls.configuration.blockOverlay": "Повне блокування використання накладання", 32 | "rrls.configuration.blockOverlay.tooltip": "Використовуйте на свій страх і ризик!", 33 | "rrls.configuration.skipForgeOverlay": "Замінити накладення завантаження (Neo)Forge на ванілльне", 34 | "rrls.configuration.type.progress": "Індикатор прогресу", 35 | "rrls.configuration.type.text": "Власний текст", 36 | "rrls.configuration.type.textbg": "Власний текст із тлом", 37 | "rrls.configuration.type.none": "Нічого", 38 | "rrls.configuration.hide.all": "Усі накладення", 39 | "rrls.configuration.hide.loading": "Лише завантаження", 40 | "rrls.configuration.hide.reloading": "Лише перезавантаження", 41 | "rrls.configuration.doubleload.force": "Примусове завантаження", 42 | "rrls.configuration.doubleload.load": "Завантажити", 43 | "rrls.configuration.hide_doubleload.none": "Нічого", 44 | "modmenu.descriptionTranslation.rrls": "Змушує завантажувати пакети ресурсів у фоновому режимі, дозволяючи вам робити інші речі під час очікування" 45 | } 46 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/zh_cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "移除重新加载屏幕 | Remove Reloading Screen", 3 | "rrls.configuration.global": "全局", 4 | "rrls.configuration.splash": "闪烁标语覆盖层", 5 | "rrls.configuration.interpolation": "插值", 6 | "rrls.configuration.other": "其他", 7 | "rrls.configuration.platform": "特定平台", 8 | "rrls.configuration.hideOverlays": "将会被隐藏的覆盖层", 9 | "rrls.configuration.rgbProgress": "彩色进度条", 10 | "rrls.configuration.rgbProgress.tooltip": "§c可能会引发癫痫", 11 | "rrls.configuration.miniRender": "资源包重新加载进度提示", 12 | "rrls.configuration.enableScissor": "裁剪默认覆盖层的渲染效果", 13 | "rrls.configuration.enableScissor.tooltip": "如果窗口被颜色(大多为黑色)填满,就启用此功能", 14 | "rrls.configuration.type": "在重新加载时将会显示什么", 15 | "rrls.configuration.reloadText": "如果在上方选择了TEXT选项,将会显示的文本内容。", 16 | "rrls.configuration.interpolateProgress": "插值计算进度", 17 | "rrls.configuration.interpolateProgress.tooltip": "在原版Minecraft中,插值从大约75%的进度开始,如果你想要基于进度进行插值计算,就启用此功能。\n这可能会导致提前出现淡入淡出效果,但对于某些缓动效果来说,这是必要的。", 18 | "rrls.configuration.interpolateAtEnd": "结束后隐藏覆盖层", 19 | "rrls.configuration.interpolateAtEnd.tooltip": "仅当进度条完全填满时才开始插值。", 20 | "rrls.configuration.ease": "缓动", 21 | "rrls.configuration.ease.tooltip": "请访问 https://easings.net/ 查看相关内容", 22 | "rrls.configuration.easingArg": "缓动参数", 23 | "rrls.configuration.resetResources": "加载失败时重置资源", 24 | "rrls.configuration.reInitScreen": "重新加载后重新初始化当前界面。", 25 | "rrls.configuration.reInitScreen.tooltip": "禁用此功能可能会消除重新加载完成后出现的卡顿问题。", 26 | "rrls.configuration.earlyPackStatusSend": "提前发送服务器资源包状态", 27 | "rrls.configuration.earlyPackStatusSend.tooltip": "一些服务器会专门等待玩家加载资源,因此游戏可能会显示错误。\n例如:在重新加载资源时,你正处于地下。", 28 | "rrls.configuration.animationSpeed": "加载动画速度", 29 | "rrls.configuration.animationSpeed.tooltip": "以毫秒为单位", 30 | "rrls.configuration.doubleLoad": "如果发生错误,请重新加载资源。", 31 | "rrls.configuration.blockOverlay": "完全阻止覆盖层的使用", 32 | "rrls.configuration.blockOverlay.tooltip": "使用风险自负!", 33 | "rrls.configuration.skipForgeOverlay": "用原版加载界面替换(Neo)Forge加载覆盖界面 ", 34 | "rrls.configuration.type.progress": "进度条", 35 | "rrls.configuration.type.text": "自定义文字", 36 | "rrls.configuration.type.textbg": "自定义带背景的文本", 37 | "rrls.configuration.type.none": "什么都没有", 38 | "rrls.configuration.hide.all": "所有的覆盖层 ", 39 | "rrls.configuration.hide.loading": "仅加载", 40 | "rrls.configuration.hide.reloading": "仅重载", 41 | "rrls.configuration.doubleload.force": "强制加载", 42 | "rrls.configuration.doubleload.load": "加载", 43 | "rrls.configuration.hide_doubleload.none": "无" 44 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/rrls/lang/zh_tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "rrls.configuration.title": "移除重新載入畫面|Remove Reloading Screen", 3 | "rrls.configuration.global": "全域", 4 | "rrls.configuration.splash": "閃爍標語的覆蓋層", 5 | "rrls.configuration.interpolation": "插值", 6 | "rrls.configuration.other": "其他", 7 | "rrls.configuration.platform": "特定平台", 8 | "rrls.configuration.hideOverlays": "將被隱藏的覆蓋層", 9 | "rrls.configuration.rgbProgress": "彩色進度條", 10 | "rrls.configuration.rgbProgress.tooltip": "§c可能會引起癲癇", 11 | "rrls.configuration.miniRender": "資源包(重新)載入進度顯示", 12 | "rrls.configuration.enableScissor": "修剪預設疊加層的繪製效果", 13 | "rrls.configuration.enableScissor.tooltip": "如果視窗被顏色淹沒(大部分為黑色),則啟用此功能", 14 | "rrls.configuration.type": "在重新載入時會顯示什麼", 15 | "rrls.configuration.reloadText": "如果上方選擇為 TEXT,將顯示下列文字。", 16 | "rrls.configuration.interpolateProgress": "插值進度", 17 | "rrls.configuration.interpolateProgress.tooltip": "在原版 Minecraft 中,插值大約從 75% 開始,如果您想執行基於進度的插值,請開啟它。\n這可能會導致過早淡出,但對於某些緩動是必要的。", 18 | "rrls.configuration.interpolateAtEnd": "在結尾插值", 19 | "rrls.configuration.interpolateAtEnd.tooltip": "僅當進度條完全填滿時才開始插值。", 20 | "rrls.configuration.ease": "緩動", 21 | "rrls.configuration.ease.tooltip": "參見 https://easings.net/", 22 | "rrls.configuration.easingArg": "緩動引數", 23 | "rrls.configuration.resetResources": "當載入失敗時重設資源", 24 | "rrls.configuration.reInitScreen": "在重新載入後重新初始化目前畫面。", 25 | "rrls.configuration.reInitScreen.tooltip": "停用此功能可能會在重新載入完成後解決卡住的問題。", 26 | "rrls.configuration.earlyPackStatusSend": "提早傳送伺服器資源包狀態", 27 | "rrls.configuration.earlyPackStatusSend.tooltip": "有些伺服器特別等待玩家載入資源,因此遊戲可能顯示不正確\n例如:重新載入資源時你正在地底下,這可能導致顯示異常", 28 | "rrls.configuration.animationSpeed": "載入動畫速度", 29 | "rrls.configuration.animationSpeed.tooltip": "以毫秒為單位", 30 | "rrls.configuration.doubleLoad": "如果發生錯誤,請重新載入資源", 31 | "rrls.configuration.blockOverlay": "完全阻斷覆蓋層的使用", 32 | "rrls.configuration.blockOverlay.tooltip": "使用風險自負!", 33 | "rrls.configuration.skipForgeOverlay": "用原版替代 (Neo)Forge 載入覆蓋", 34 | "rrls.configuration.type.progress": "進度條", 35 | "rrls.configuration.type.text": "自訂文字", 36 | "rrls.configuration.type.textbg": "含背景的自訂文字", 37 | "rrls.configuration.type.none": "無", 38 | "rrls.configuration.hide.all": "所有覆蓋層", 39 | "rrls.configuration.hide.loading": "僅載入", 40 | "rrls.configuration.hide.reloading": "僅重新載入", 41 | "rrls.configuration.doubleload.force": "強制載入", 42 | "rrls.configuration.doubleload.load": "載入", 43 | "rrls.configuration.hide_doubleload.none": "無" 44 | } -------------------------------------------------------------------------------- /common/src/main/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dima-dencep/rrls/ccdb41e0c50928f6679d6bf3dbed32832aef39ac/common/src/main/resources/icon.png -------------------------------------------------------------------------------- /common/src/main/resources/rrls.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | accessible method net/minecraft/client/gui/GuiGraphics applyScissor (Lnet/minecraft/client/gui/navigation/ScreenRectangle;)V 3 | extendable method net/minecraft/client/gui/GuiGraphics applyScissor (Lnet/minecraft/client/gui/navigation/ScreenRectangle;)V 4 | accessible method net/minecraft/client/gui/GuiGraphics blitSprite (Ljava/util/function/Function;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIII)V 5 | extendable method net/minecraft/client/gui/GuiGraphics blitSprite (Ljava/util/function/Function;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIII)V 6 | accessible method net/minecraft/client/gui/GuiGraphics blitNineSlicedSprite (Ljava/util/function/Function;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling$NineSlice;IIIII)V 7 | extendable method net/minecraft/client/gui/GuiGraphics blitNineSlicedSprite (Ljava/util/function/Function;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling$NineSlice;IIIII)V 8 | accessible method net/minecraft/client/gui/GuiGraphics blitNineSliceInnerSegment (Ljava/util/function/Function;Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling$NineSlice;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIIIII)V 9 | extendable method net/minecraft/client/gui/GuiGraphics blitNineSliceInnerSegment (Ljava/util/function/Function;Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling$NineSlice;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIIIII)V 10 | accessible method net/minecraft/client/gui/GuiGraphics blitTiledSprite (Ljava/util/function/Function;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIIIII)V 11 | extendable method net/minecraft/client/gui/GuiGraphics blitTiledSprite (Ljava/util/function/Function;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIIIII)V 12 | accessible method net/minecraft/client/gui/GuiGraphics innerBlit (Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIIIFFFFI)V 13 | extendable method net/minecraft/client/gui/GuiGraphics innerBlit (Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIIIFFFFI)V 14 | accessible method net/minecraft/client/gui/GuiGraphics renderItem (Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;IIII)V 15 | extendable method net/minecraft/client/gui/GuiGraphics renderItem (Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;IIII)V 16 | accessible method net/minecraft/client/gui/GuiGraphics renderItem (Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;III)V 17 | extendable method net/minecraft/client/gui/GuiGraphics renderItem (Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;III)V 18 | accessible method net/minecraft/client/gui/GuiGraphics fillGradient (Lcom/mojang/blaze3d/vertex/VertexConsumer;IIIIIII)V 19 | extendable method net/minecraft/client/gui/GuiGraphics fillGradient (Lcom/mojang/blaze3d/vertex/VertexConsumer;IIIIIII)V 20 | accessible method net/minecraft/client/gui/GuiGraphics renderTooltipInternal (Lnet/minecraft/client/gui/Font;Ljava/util/List;IILnet/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipPositioner;Lnet/minecraft/resources/ResourceLocation;)V 21 | extendable method net/minecraft/client/gui/GuiGraphics renderTooltipInternal (Lnet/minecraft/client/gui/Font;Ljava/util/List;IILnet/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipPositioner;Lnet/minecraft/resources/ResourceLocation;)V 22 | accessible method net/minecraft/client/gui/GuiGraphics renderItemBar (Lnet/minecraft/world/item/ItemStack;II)V 23 | extendable method net/minecraft/client/gui/GuiGraphics renderItemBar (Lnet/minecraft/world/item/ItemStack;II)V 24 | accessible method net/minecraft/client/gui/GuiGraphics renderItemCount (Lnet/minecraft/client/gui/Font;Lnet/minecraft/world/item/ItemStack;IILjava/lang/String;)V 25 | extendable method net/minecraft/client/gui/GuiGraphics renderItemCount (Lnet/minecraft/client/gui/Font;Lnet/minecraft/world/item/ItemStack;IILjava/lang/String;)V 26 | accessible method net/minecraft/client/gui/GuiGraphics renderItemCooldown (Lnet/minecraft/world/item/ItemStack;II)V 27 | extendable method net/minecraft/client/gui/GuiGraphics renderItemCooldown (Lnet/minecraft/world/item/ItemStack;II)V 28 | accessible field net/minecraft/client/Minecraft overlay Lnet/minecraft/client/gui/screens/Overlay; 29 | accessible class net/minecraft/client/resources/server/ServerPackManager$ServerPackData 30 | accessible method net/minecraft/client/gui/screens/LoadingOverlay drawProgressBar (Lnet/minecraft/client/gui/GuiGraphics;IIIIF)V 31 | accessible field net/minecraft/client/gui/screens/LoadingOverlay currentProgress F 32 | accessible class net/minecraft/client/Minecraft$GameLoadCookie 33 | accessible field net/minecraft/client/gui/font/FontManager fontSets Ljava/util/Map; 34 | accessible field net/minecraft/client/resources/TextureAtlasHolder textureAtlas Lnet/minecraft/client/renderer/texture/TextureAtlas; 35 | accessible field net/minecraft/client/renderer/texture/TextureAtlas texturesByName Ljava/util/Map; 36 | accessible field net/minecraft/client/resources/SplashManager splashes Ljava/util/List; 37 | accessible field net/minecraft/client/renderer/ShaderManager compilationCache Lnet/minecraft/client/renderer/ShaderManager$CompilationCache; 38 | accessible field net/minecraft/client/renderer/ShaderManager$CompilationCache configs Lnet/minecraft/client/renderer/ShaderManager$Configs; 39 | accessible class net/minecraft/client/renderer/ShaderManager$CompilationCache 40 | accessible method net/minecraft/client/renderer/texture/TextureManager scheduleLoad (Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/texture/ReloadableTexture;Ljava/util/concurrent/Executor;)Lnet/minecraft/client/renderer/texture/TextureManager$PendingReload; 41 | accessible class net/minecraft/client/renderer/texture/TextureManager$PendingReload 42 | accessible method net/minecraft/client/Minecraft buildInitialScreens (Lnet/minecraft/client/Minecraft$GameLoadCookie;)Ljava/lang/Runnable; 43 | -------------------------------------------------------------------------------- /common/src/main/resources/rrls.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "org.redlance.dima_dencep.mods.rrls.mixins", 5 | "compatibilityLevel": "JAVA_21", 6 | "client": [ 7 | "GameRendererMixin", 8 | "LoadingOverlayMixin", 9 | "MinecraftClientMixin", 10 | "TitleScreenMixin", 11 | "compat.OverlayMixin", 12 | "compat.RendererKeyboardMouseMixin", 13 | "compat.ServerPackManagerMixin", 14 | "workaround.textures.AbstractTextureMixin", 15 | "workaround.CompilationCacheMixin", 16 | "workaround.EntityRenderDispatcherMixin", 17 | "workaround.GlCommandEncoderMixin", 18 | "workaround.GuiGraphicsMixin", 19 | "workaround.ReloadableResourceManagerMixin", 20 | "workaround.TextureManagerMixin" 21 | ], 22 | "injectors": { 23 | "defaultRequire": 1 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fabric/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradleup.shadow" 3 | } 4 | 5 | architectury { 6 | platformSetupLoomIde() 7 | fabric() 8 | } 9 | 10 | loom { 11 | accessWidenerPath = project(":common").loom.accessWidenerPath 12 | } 13 | 14 | configurations { 15 | common 16 | shadowCommon 17 | compileClasspath.extendsFrom common 18 | runtimeClasspath.extendsFrom common 19 | developmentFabric.extendsFrom common 20 | } 21 | 22 | dependencies { 23 | modImplementation "net.fabricmc:fabric-loader:${loader_version}" 24 | modApi("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${fcapip_version}") { 25 | exclude(group: "net.fabricmc.fabric-api") 26 | } 27 | 28 | common(project(path: ":common", configuration: "namedElements")) { transitive = false } 29 | shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive = false } 30 | } 31 | 32 | shadowJar { 33 | configurations = [project.configurations.shadowCommon] 34 | archiveClassifier.set "dev-shadow" 35 | } 36 | 37 | remapJar { 38 | injectAccessWidener = true 39 | 40 | inputFile.set shadowJar.archiveFile 41 | dependsOn shadowJar 42 | archiveClassifier.set null 43 | } 44 | 45 | jar { 46 | archiveClassifier.set "dev" 47 | } 48 | 49 | sourcesJar { 50 | def commonSources = project(":common").sourcesJar 51 | dependsOn commonSources 52 | from commonSources.archiveFile.map { zipTree(it) } 53 | } 54 | 55 | components.java { 56 | withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { 57 | skip() 58 | } 59 | } 60 | 61 | publishing { 62 | publications { 63 | mavenFabric(MavenPublication) { 64 | artifactId = rootProject.archives_base_name 65 | from components.java 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/redlance/dima_dencep/mods/rrls/fabric/RrlsFabric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.fabric; 12 | 13 | import fuzs.forgeconfigapiport.fabric.api.v5.ConfigRegistry; 14 | import fuzs.forgeconfigapiport.fabric.api.v5.client.ConfigScreenFactoryRegistry; 15 | import net.neoforged.fml.config.ModConfig; 16 | import net.neoforged.neoforge.client.gui.ConfigurationScreen; 17 | import org.redlance.dima_dencep.mods.rrls.Rrls; 18 | import net.fabricmc.api.ClientModInitializer; 19 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 20 | import org.redlance.dima_dencep.mods.rrls.screens.ConfigurationSectionScreenProxy; 21 | 22 | public class RrlsFabric extends Rrls implements ClientModInitializer { 23 | @Override 24 | public void onInitializeClient() { 25 | ConfigRegistry.INSTANCE.register(Rrls.MOD_ID, ModConfig.Type.CLIENT, 26 | RrlsConfig.CONFIG_SPEC_PAIR.getRight(), "rrls.toml" 27 | ); 28 | ConfigScreenFactoryRegistry.INSTANCE.register(Rrls.MOD_ID, (modContainer, screen) -> 29 | new ConfigurationScreen(modContainer, screen, ConfigurationSectionScreenProxy::new) 30 | ); 31 | 32 | // After loading config, we load the future stuff 33 | super.onInitializeClient(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /fabric/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "rrls", 4 | "version": "${version}", 5 | "name": "Remove Reloading Screen", 6 | "description": "Makes resource packs load in the background, allowing you to do other things while waiting!", 7 | "authors": [ 8 | "dima_dencep" 9 | ], 10 | "contributors": [ 11 | "ne4t0gg", 12 | "nneewwtt", 13 | "Madis0", 14 | "notlin4", 15 | "oldveseliyschoolnik", 16 | "GodGun968", 17 | "TheBossMagnus", 18 | "LostLuma", 19 | "FITFC", 20 | "Gazmanovich", 21 | "TheLegendofSaram", 22 | "thesh1xx", 23 | "yichifauzi", 24 | "MATRIX-feather", 25 | "Emperormummy", 26 | "StarmanMine142" 27 | ], 28 | "contact": { 29 | "homepage": "https://curseforge.com/minecraft/mc-mods/rrls", 30 | "sources": "https://github.com/dima-dencep/rrls", 31 | "issues": "https://github.com/dima-dencep/rrls/issues" 32 | }, 33 | "license": "OSL-3.0", 34 | "icon": "icon.png", 35 | "environment": "client", 36 | "entrypoints": { 37 | "client": [ 38 | "org.redlance.dima_dencep.mods.rrls.fabric.RrlsFabric" 39 | ] 40 | }, 41 | "mixins": [ 42 | "rrls.mixins.json" 43 | ], 44 | "depends": { 45 | "fabricloader": ">=${fabric_version}", 46 | "minecraft": ">=${minecraft_version}", 47 | "forgeconfigapiport": ">=${fcapip_version}" 48 | }, 49 | "conflicts": { 50 | "dynamicfps": "*" 51 | }, 52 | "custom": { 53 | "dynamic_fps": { 54 | "optimized_overlay": false 55 | }, 56 | "modmenu": { 57 | "links": { 58 | "modmenu.curseforge": "https://curseforge.com/minecraft/mc-mods/rrls", 59 | "modmenu.discord": "https://discord.gg/jdB5JYX7W7", 60 | "modmenu.github_releases": "https://github.com/dima-dencep/rrls/releases", 61 | "modmenu.modrinth": "https://modrinth.com/mod/rrls" 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /forge/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradleup.shadow" 3 | } 4 | 5 | architectury { 6 | platformSetupLoomIde() 7 | neoForge() 8 | } 9 | 10 | loom { 11 | accessWidenerPath = project(":common").loom.accessWidenerPath 12 | } 13 | 14 | configurations { 15 | common 16 | shadowCommon 17 | compileClasspath.extendsFrom common 18 | runtimeClasspath.extendsFrom common 19 | developmentNeoForge.extendsFrom common 20 | } 21 | 22 | dependencies { 23 | neoForge "net.neoforged:neoforge:${forge_version}" 24 | 25 | common(project(path: ":common", configuration: "namedElements")) { transitive = false } 26 | shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false } 27 | } 28 | 29 | shadowJar { 30 | exclude "fabric.mod.json" 31 | 32 | configurations = [project.configurations.shadowCommon] 33 | archiveClassifier.set "dev-shadow" 34 | } 35 | 36 | remapJar { 37 | atAccessWideners.add(loom.accessWidenerPath.get().asFile.name) 38 | 39 | inputFile.set shadowJar.archiveFile 40 | dependsOn shadowJar 41 | archiveClassifier.set null 42 | } 43 | 44 | jar { 45 | archiveClassifier.set "dev" 46 | } 47 | 48 | sourcesJar { 49 | def commonSources = project(":common").sourcesJar 50 | dependsOn commonSources 51 | from commonSources.archiveFile.map { zipTree(it) } 52 | } 53 | 54 | components.java { 55 | withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { 56 | skip() 57 | } 58 | } 59 | 60 | publishing { 61 | publications { 62 | mavenNeoForge(MavenPublication) { 63 | artifactId = rootProject.archives_base_name 64 | from components.java 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /forge/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=neoforge -------------------------------------------------------------------------------- /forge/src/main/java/org/redlance/dima_dencep/mods/rrls/neoforge/RrlsForge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.neoforge; 12 | 13 | import net.neoforged.api.distmarker.Dist; 14 | import net.neoforged.fml.ModContainer; 15 | import net.neoforged.fml.config.ModConfig; 16 | import net.neoforged.neoforge.client.gui.ConfigurationScreen; 17 | import net.neoforged.neoforge.client.gui.IConfigScreenFactory; 18 | import org.redlance.dima_dencep.mods.rrls.Rrls; 19 | import net.neoforged.fml.common.Mod; 20 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 21 | import org.redlance.dima_dencep.mods.rrls.screens.ConfigurationSectionScreenProxy; 22 | 23 | @Mod(value = Rrls.MOD_ID, dist = Dist.CLIENT) 24 | public class RrlsForge extends Rrls { 25 | public RrlsForge(ModContainer container) { 26 | container.registerConfig(ModConfig.Type.STARTUP, RrlsConfig.CONFIG_SPEC_PAIR.getValue(), "rrls.toml"); 27 | container.registerExtensionPoint(IConfigScreenFactory.class, (modContainer, screen) -> 28 | new ConfigurationScreen(modContainer, screen, ConfigurationSectionScreenProxy::new) 29 | ); 30 | 31 | // After loading config, we load the future stuff 32 | super.onInitializeClient(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /forge/src/main/java/org/redlance/dima_dencep/mods/rrls/neoforge/mixins/NeoForgeLoadingOverlayMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.neoforge.mixins; 12 | 13 | import org.redlance.dima_dencep.mods.rrls.RrlsConfig; 14 | import org.redlance.dima_dencep.mods.rrls.utils.DummyGuiGraphics; 15 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 16 | import net.minecraft.client.Minecraft; 17 | import net.minecraft.client.gui.GuiGraphics; 18 | import net.minecraft.client.gui.screens.LoadingOverlay; 19 | import net.minecraft.server.packs.resources.ReloadInstance; 20 | import net.neoforged.fml.earlydisplay.DisplayWindow; 21 | import net.neoforged.fml.loading.progress.ProgressMeter; 22 | import net.neoforged.fml.loading.progress.StartupNotificationManager; 23 | import net.neoforged.neoforge.client.loading.NeoForgeLoadingOverlay; 24 | import org.spongepowered.asm.mixin.Final; 25 | import org.spongepowered.asm.mixin.Mixin; 26 | import org.spongepowered.asm.mixin.Shadow; 27 | import org.spongepowered.asm.mixin.injection.At; 28 | import org.spongepowered.asm.mixin.injection.Constant; 29 | import org.spongepowered.asm.mixin.injection.Inject; 30 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 31 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 32 | 33 | import java.util.Optional; 34 | import java.util.function.Consumer; 35 | 36 | @Mixin(NeoForgeLoadingOverlay.class) 37 | public abstract class NeoForgeLoadingOverlayMixin extends LoadingOverlay { 38 | @Shadow 39 | @Final 40 | private Minecraft minecraft; 41 | @Shadow 42 | @Final 43 | private ProgressMeter progressMeter; 44 | @Shadow 45 | @Final 46 | private DisplayWindow displayWindow; 47 | @Shadow 48 | private float currentProgress; 49 | 50 | public NeoForgeLoadingOverlayMixin(Minecraft client, ReloadInstance monitor, Consumer> exceptionHandler, boolean reloading) { 51 | super(client, monitor, exceptionHandler, reloading); 52 | } 53 | 54 | @Inject( 55 | method = "render", 56 | at = @At( 57 | value = "HEAD" 58 | ), 59 | cancellable = true 60 | ) 61 | public void rrls$render(GuiGraphics context, int mouseX, int mouseY, float delta, CallbackInfo ci) { 62 | boolean earlyLoadingScreenClosed = !StartupNotificationManager.getCurrentProgress().contains(progressMeter); 63 | 64 | if (context instanceof DummyGuiGraphics || RrlsConfig.skipForgeOverlay() || earlyLoadingScreenClosed) { 65 | if (!earlyLoadingScreenClosed) { // Stop forge's early loading screen 66 | progressMeter.complete(); 67 | displayWindow.close(); 68 | 69 | super.currentProgress = currentProgress; 70 | 71 | } else { 72 | currentProgress = super.currentProgress; // Sync progress (For mod compat?) 73 | } 74 | 75 | super.render(context, mouseX, mouseY, delta); 76 | 77 | ci.cancel(); 78 | } else { 79 | rrls$setState(OverlayHelper.lookupState(minecraft.screen, false)); // Forge loading overlay is loading overlay :) 80 | } 81 | } 82 | 83 | @ModifyConstant( 84 | method = "render", 85 | constant = @Constant( 86 | floatValue = 1000.0F, 87 | ordinal = 0 88 | ), 89 | require = 0 90 | ) 91 | public float rrls$changeAnimationSpeed(float instance) { 92 | if (!rrls$getState().isRendering()) { 93 | return RrlsConfig.animationSpeed(); 94 | } 95 | 96 | return instance; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /forge/src/main/java/org/redlance/dima_dencep/mods/rrls/neoforge/mixins/ScreenMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 - 2025 dima_dencep. 3 | * 4 | * Licensed under the Open Software License, Version 3.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * https://spdx.org/licenses/OSL-3.0.txt 9 | */ 10 | 11 | package org.redlance.dima_dencep.mods.rrls.neoforge.mixins; 12 | 13 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 14 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 15 | import com.llamalad7.mixinextras.sugar.Local; 16 | import net.minecraft.client.Minecraft; 17 | import net.minecraft.client.gui.screens.Screen; 18 | import net.neoforged.bus.api.Event; 19 | import net.neoforged.bus.api.IEventBus; 20 | import net.neoforged.fml.loading.LoadingModList; 21 | import org.redlance.dima_dencep.mods.rrls.Rrls; 22 | import org.redlance.dima_dencep.mods.rrls.utils.OverlayHelper; 23 | import org.spongepowered.asm.mixin.Mixin; 24 | import org.spongepowered.asm.mixin.Unique; 25 | import org.spongepowered.asm.mixin.injection.At; 26 | 27 | @Mixin(Screen.class) 28 | public class ScreenMixin { 29 | @Unique 30 | private static final boolean HAS_TWFOREST = LoadingModList.get().getModFileById("twilightforest") != null; 31 | 32 | @WrapOperation( 33 | method = "init(Lnet/minecraft/client/Minecraft;II)V", 34 | at = @At( 35 | value = "INVOKE", 36 | target = "Lnet/neoforged/bus/api/IEventBus;post(Lnet/neoforged/bus/api/Event;)Lnet/neoforged/bus/api/Event;", 37 | ordinal = 1 38 | ) 39 | ) 40 | private Event rrls$fixTWForest(IEventBus instance, Event t, Operation original, @Local(argsOnly = true) Minecraft mc) { 41 | if (HAS_TWFOREST && OverlayHelper.isRenderingState(mc.overlay)) { 42 | Rrls.LOGGER.warn("Canceling '{}' firing because twilightforest is present!", t.getClass().getSimpleName()); 43 | return t; 44 | } 45 | return original.call(instance, t); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /forge/src/main/resources/META-INF/neoforge.mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "*" 3 | issueTrackerURL = "https://github.com/dima-dencep/rrls/issues" 4 | license = "OSL-3.0" 5 | 6 | [[mods]] 7 | displayTest = "IGNORE_ALL_VERSION" 8 | modId = "rrls" 9 | version = "${version}" 10 | displayURL = "https://curseforge.com/minecraft/mc-mods/rrls" 11 | displayName = "Remove Reloading Screen" 12 | updateJSONURL = "https://api.modrinth.com/updates/rrls/forge_updates.json?neoforge=include" 13 | authors = "dima_dencep" 14 | credits = "ne4t0gg, nneewwtt, Madis0, notlin, oldveseliyschoolnik, GodGun968, TheBossMagnus, LostLuma, FITFC, Gazmanovich, TheLegendofSaram, thesh1xx, yichifauzi, MATRIX-feather, Emperormummy, StarmanMine142" 15 | description = "Makes resource packs load in the background, allowing you to do other things while waiting!" 16 | logoFile = "icon.png" 17 | 18 | [[mixins]] 19 | config = "rrls.mixins.json" 20 | [[mixins]] 21 | config = "rrls-forge.mixins.json" 22 | 23 | [[dependencies.rrls]] 24 | modId = "neoforge" 25 | type = "required" 26 | versionRange = "[${neo_version},]" 27 | ordering = "NONE" 28 | side = "BOTH" 29 | 30 | [[dependencies.rrls]] 31 | modId = "minecraft" 32 | type = "required" 33 | versionRange = "[${minecraft_version},)" 34 | ordering = "NONE" 35 | side = "BOTH" 36 | -------------------------------------------------------------------------------- /forge/src/main/resources/rrls-forge.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "org.redlance.dima_dencep.mods.rrls.neoforge.mixins", 5 | "compatibilityLevel": "JAVA_21", 6 | "client": [ 7 | "ScreenMixin", 8 | "NeoForgeLoadingOverlayMixin" 9 | ], 10 | "injectors": { 11 | "defaultRequire": 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx4G 3 | org.gradle.parallel=true 4 | 5 | # Properties 6 | minecraft_version = 1.21.5 7 | parchment_version = 2025.04.19 8 | loader_version = 0.16.14 9 | forge_version = 21.5.66-beta 10 | 11 | # Mod Properties 12 | mod_version = 5.1.6 13 | maven_group = org.redlance.dima_dencep.mods 14 | archives_base_name = rrls 15 | 16 | # Dependencies 17 | fcapip_version = 21.5.1 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dima-dencep/rrls/ccdb41e0c50928f6679d6bf3dbed32832aef39ac/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-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=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 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 | org.gradle.wrapper.GradleWrapperMain \ 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=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 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 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url = "https://maven.fabricmc.net/" } 4 | maven { url = "https://maven.architectury.dev/" } 5 | maven { url = "https://maven.neoforged.net/releases" } 6 | gradlePluginPortal() 7 | } 8 | } 9 | 10 | rootProject.name = "rrls" 11 | 12 | include("common") 13 | include("fabric") 14 | include("forge") 15 | --------------------------------------------------------------------------------