├── .gitattributes ├── .github └── workflows │ ├── build.yml │ └── publish.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java └── ru │ └── feytox │ └── feytweaks │ ├── Feytweaks.java │ ├── SignTextPosition.java │ ├── client │ ├── FTConfig.java │ └── FeytweaksClient.java │ └── mixin │ ├── BeaconBlockEntityRendererMixin.java │ ├── SignBlockEntityMixin.java │ ├── SignBlockEntityRendererMixin.java │ ├── SignTextMixin.java │ ├── TextRendererMixin.java │ └── accessors │ ├── TextRendererAccessor.java │ └── WorldRendererAccessor.java └── resources ├── assets └── feytweaks │ ├── icon.png │ └── lang │ ├── en_us.json │ ├── pt_br.json │ ├── ru_ru.json │ └── zh_cn.json ├── fabric.mod.json ├── feytweaks.accesswidener └── feytweaks.mixins.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | # Use these Java versions 14 | java: [ 15 | 21 16 | ] 17 | runs-on: ubuntu-22.04 18 | steps: 19 | - name: checkout repository 20 | uses: actions/checkout@v4 21 | - name: validate gradle wrapper 22 | uses: gradle/wrapper-validation-action@v3.3.2 23 | - name: setup jdk ${{ matrix.java }} 24 | uses: actions/setup-java@v4 25 | with: 26 | java-version: ${{ matrix.java }} 27 | distribution: 'microsoft' 28 | - name: make gradle wrapper executable 29 | run: chmod +x ./gradlew 30 | - name: build 31 | run: ./gradlew build 32 | - name: capture build artifacts 33 | if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java 34 | uses: actions/upload-artifact@v4 35 | with: 36 | name: Artifacts 37 | path: build/libs/ -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish to Modrinth and CurseForge 2 | on: 3 | [ workflow_dispatch ] 4 | 5 | jobs: 6 | build: 7 | permissions: 8 | contents: write 9 | strategy: 10 | matrix: 11 | java: [ 21 ] 12 | os: [ ubuntu-22.04 ] 13 | runs-on: ${{ matrix.os }} 14 | steps: 15 | - name: checkout repository 16 | uses: actions/checkout@v4 17 | 18 | - name: validate gradle wrapper 19 | uses: gradle/wrapper-validation-action@v1 20 | 21 | - name: setup jdk ${{ matrix.java }} 22 | uses: actions/setup-java@v4 23 | with: 24 | java-version: ${{ matrix.java }} 25 | distribution: 'microsoft' 26 | 27 | - name: make gradle wrapper executable 28 | if: ${{ runner.os != 'Windows' }} 29 | run: chmod +x ./gradlew 30 | 31 | - name: build 32 | run: ./gradlew build 33 | 34 | - name: publish to Modrinth and CurseForge 35 | uses: Kir-Antipov/mc-publish@v3.3 36 | with: 37 | modrinth-id: Wa72oW2W 38 | modrinth-token: ${{ secrets.MODRINTH_TOKEN }} 39 | 40 | curseforge-id: 663213 41 | curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} 42 | 43 | name: "[1.21] FeyTweaks 1.2.8" 44 | changelog-file: CHANGELOG.* 45 | game-versions: | 46 | 1.21 47 | 48 | dependencies: | 49 | fabric-api 50 | modmenu(optional) 51 | midnightlib(embedded) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .gradle/ 4 | build/ 5 | out/ 6 | classes/ 7 | 8 | # eclipse 9 | 10 | *.launch 11 | 12 | # idea 13 | 14 | .idea/ 15 | *.iml 16 | *.ipr 17 | *.iws 18 | 19 | # vscode 20 | 21 | .settings/ 22 | .vscode/ 23 | bin/ 24 | .classpath 25 | .project 26 | 27 | # macos 28 | 29 | *.DS_Store 30 | 31 | # fabric 32 | 33 | run/ 34 | 35 | # java 36 | 37 | hs_err_*.log 38 | replay_*.log 39 | *.hprof 40 | *.jfr 41 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Update to Minecraft 1.21 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Feytox 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## EN 2 | The mod allows you to optimize the signs and beacons, thereby increasing your FPS. 3 | * Features of FeyTweaks: 4 | + Sign optimization 5 | - Fully hide the text on the signs at a distance (ON by default) 6 | - Hiding text out of view (ON by default) 7 | - Hiding the outline of glowing text (ON by default) 8 | - Convert text outline to shadow: normal mode and fast mode [Beta] 9 | - Fully hide the text glow effect at a distance 10 | - Glow effect optimization [Beta] 11 | + Beacon optimization 12 | - Fully hide the beacon beams at a distance 13 | - Hiding beams out of view (ON by default) 14 | - Beacon beams optimization (ON by default) 15 | 16 | 17 | ## RU 18 | Мод позволяет оптимизировать таблички и маяки, тем самым повышая ваш FPS. 19 | * Все функции FeyTweaks 20 | + Оптимизация табличек 21 | - Полное скрытие текста на табличках на расстоянии (по-умолчанию ВКЛ) 22 | - Скрытие текста вне поля зрения (по-умолчанию ВКЛ) 23 | - Скрытие обводки светящегося текста (по-умолчанию ВКЛ) 24 | - Преобразование обводки текста в тень (обычный/быстрый режим) 25 | - Полное скрытие эффекта свечения текста на расстоянии 26 | - Оптимизация эффекта свечения [Бета] 27 | + Оптимизация маяков 28 | - Полное скрытие лучей маяков на расстоянии 29 | - Скрытие лучей маяков вне поля зрения (по-умолчанию ВКЛ) 30 | - Оптимизация лучей маяков (по-умолчанию ВКЛ) 31 | 32 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'fabric-loom' version '1.7-SNAPSHOT' 3 | id 'maven-publish' 4 | } 5 | 6 | version = project.mod_version 7 | group = project.maven_group 8 | 9 | repositories { 10 | maven { 11 | name = "Modrinth" 12 | url = "https://api.modrinth.com/maven" 13 | content { 14 | includeGroup "maven.modrinth" 15 | } 16 | } 17 | maven { 18 | url = "https://maven.terraformersmc.com/releases/" 19 | } 20 | maven { url 'https://jitpack.io' } 21 | } 22 | 23 | loom { 24 | accessWidenerPath = file("src/main/resources/feytweaks.accesswidener") 25 | } 26 | 27 | dependencies { 28 | // To change the versions see the gradle.properties file 29 | minecraft "com.mojang:minecraft:${project.minecraft_version}" 30 | mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" 31 | modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" 32 | 33 | // Fabric API. This is technically optional, but you probably want it anyway. 34 | modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" 35 | 36 | modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}" 37 | include "maven.modrinth:midnightlib:${project.midnightlib_version}" 38 | modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" 39 | } 40 | 41 | processResources { 42 | inputs.property "version", project.version 43 | 44 | filesMatching("fabric.mod.json") { 45 | expand "version": project.version 46 | } 47 | } 48 | 49 | tasks.withType(JavaCompile).configureEach { 50 | it.options.release = 21 51 | } 52 | 53 | java { 54 | withSourcesJar() 55 | 56 | sourceCompatibility = JavaVersion.VERSION_21 57 | targetCompatibility = JavaVersion.VERSION_21 58 | } 59 | 60 | jar { 61 | from("LICENSE") { 62 | rename { "${it}_${project.base.archivesName.get()}"} 63 | } 64 | } 65 | 66 | publishing { 67 | publications { 68 | create("mavenJava", MavenPublication) { 69 | artifactId = project.archives_base_name 70 | from components.java 71 | } 72 | } 73 | repositories { 74 | } 75 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1G 2 | 3 | minecraft_version=1.21 4 | yarn_mappings=1.21+build.2 5 | loader_version=0.15.11 6 | 7 | # Mod Properties 8 | mod_version=1.21-1.2.8 9 | maven_group=ru.feytox 10 | archives_base_name=feytweaks 11 | 12 | # Dependencies 13 | fabric_version=0.100.3+1.21 14 | 15 | midnightlib_version = 1.5.7-fabric 16 | modmenu_version = 11.0.0 17 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feytox/FeyTweaks/6f63f62e37cbaaed8e055fade514a856fa208a3e/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.8-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 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /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 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/Feytweaks.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks; 2 | 3 | import net.fabricmc.api.ModInitializer; 4 | import ru.feytox.feytweaks.client.FTConfig; 5 | 6 | public class Feytweaks implements ModInitializer { 7 | @Override 8 | public void onInitialize() { 9 | FTConfig.init(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/SignTextPosition.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks; 2 | 3 | import net.minecraft.util.math.BlockPos; 4 | import org.jetbrains.annotations.NotNull; 5 | import org.jetbrains.annotations.Nullable; 6 | 7 | public interface SignTextPosition { 8 | @Nullable BlockPos ft_getSignPosition(); 9 | void ft_setSignPosition(@NotNull BlockPos blockPos); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/client/FTConfig.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.client; 2 | 3 | import eu.midnightdust.lib.config.MidnightConfig; 4 | 5 | 6 | public class FTConfig extends MidnightConfig { 7 | @Entry 8 | public static boolean toggleMod = true; 9 | 10 | @Comment 11 | public static Comment signs; 12 | 13 | @Entry 14 | public static boolean hideTexts = true; 15 | 16 | @Entry 17 | public static double textDistance = 5; 18 | 19 | @Entry 20 | public static boolean hideGlow = false; 21 | 22 | @Entry(min=0) 23 | public static double hideGlowDistance = 5; 24 | 25 | @Entry 26 | public static boolean signCulling = true; 27 | 28 | @Entry 29 | public static boolean simpleGlow = true; 30 | 31 | @Entry 32 | public static boolean glowToShadow = false; 33 | 34 | @Entry 35 | public static boolean fastGlowToShadow = false; 36 | 37 | @Entry 38 | public static boolean optimizeGlow = false; 39 | 40 | @Comment 41 | public static Comment beacons; 42 | 43 | @Entry 44 | public static boolean hideBeam = false; 45 | 46 | @Entry 47 | public static double beamDistance = 15; 48 | 49 | @Entry 50 | public static boolean beaconCulling = true; 51 | 52 | @Entry 53 | public static boolean optimizeBeam = true; 54 | 55 | public static void init() { 56 | FTConfig.init(FeytweaksClient.MOD_ID, FTConfig.class); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/client/FeytweaksClient.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.client; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.fabricmc.api.EnvType; 5 | import net.fabricmc.api.Environment; 6 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 7 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 8 | import net.minecraft.block.entity.BeaconBlockEntity; 9 | import net.minecraft.block.entity.BlockEntity; 10 | import net.minecraft.block.entity.SignText; 11 | import net.minecraft.client.MinecraftClient; 12 | import net.minecraft.client.network.ClientPlayerEntity; 13 | import net.minecraft.client.option.KeyBinding; 14 | import net.minecraft.client.render.Frustum; 15 | import net.minecraft.client.util.InputUtil; 16 | import net.minecraft.util.math.BlockPos; 17 | import net.minecraft.util.math.Box; 18 | import net.minecraft.util.math.Vec3d; 19 | import org.jetbrains.annotations.Nullable; 20 | import org.lwjgl.glfw.GLFW; 21 | import ru.feytox.feytweaks.SignTextPosition; 22 | import ru.feytox.feytweaks.mixin.accessors.WorldRendererAccessor; 23 | 24 | @Environment(EnvType.CLIENT) 25 | public class FeytweaksClient implements ClientModInitializer { 26 | 27 | public static final String MOD_ID = "feytweaks"; 28 | 29 | @Override 30 | public void onInitializeClient() { 31 | KeyBinding openConfigKey = KeyBindingHelper.registerKeyBinding(new KeyBinding("key." + MOD_ID + ".openConfigKey", 32 | InputUtil.Type.KEYSYM, 33 | GLFW.GLFW_KEY_UNKNOWN, 34 | "feytweaks.midnightconfig.title")); 35 | 36 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 37 | while (openConfigKey.wasPressed()) { 38 | client.setScreen(FTConfig.getScreen(client.currentScreen, MOD_ID)); 39 | } 40 | }); 41 | } 42 | 43 | @Nullable 44 | public static BlockPos getSignPos(SignText signText) { 45 | if (!(signText instanceof SignTextPosition signTextPosition)) return null; 46 | return signTextPosition.ft_getSignPosition(); 47 | } 48 | 49 | public static boolean isOnScreen(BeaconBlockEntity beaconBlockEntity) { 50 | Frustum frustum = ((WorldRendererAccessor) MinecraftClient.getInstance().worldRenderer).getFrustum(); 51 | BlockPos blockPos = beaconBlockEntity.getPos(); 52 | Box box = new Box(blockPos.getX() - 1.0, blockPos.getY() - 1.0, blockPos.getZ() - 1.0, blockPos.getX() + 1.0, 319 - blockPos.getY(), blockPos.getZ() + 1.0); 53 | return frustum.isVisible(box); 54 | } 55 | 56 | public static boolean isOnScreen(BlockEntity blockEntity) { 57 | return isOnScreen(blockEntity.getPos()); 58 | } 59 | 60 | public static boolean isOnScreen(BlockPos blockPos) { 61 | Frustum frustum = ((WorldRendererAccessor) MinecraftClient.getInstance().worldRenderer).getFrustum(); 62 | Box box = new Box(blockPos.getX() - 1.0, blockPos.getY() - 1.0, blockPos.getZ() - 1.0, blockPos.getX() + 1.0, blockPos.getY() + 1.0, blockPos.getZ() + 1.0); 63 | return frustum.isVisible(box); 64 | 65 | } 66 | 67 | public static boolean shouldRenderText(SignText signText) { 68 | BlockPos signPos = FeytweaksClient.getSignPos(signText); 69 | ClientPlayerEntity player = MinecraftClient.getInstance().player; 70 | if (signPos == null || player == null) return true; 71 | 72 | return FTConfig.toggleMod && FTConfig.hideTexts 73 | && signPos.getSquaredDistance(MinecraftClient.getInstance().player.getPos()) > Math.pow(FTConfig.textDistance, 2); 74 | } 75 | 76 | public static boolean shouldRenderBeam(BeaconBlockEntity beaconBlockEntity) { 77 | ClientPlayerEntity player = MinecraftClient.getInstance().player; 78 | if (player == null) return true; 79 | 80 | BlockPos pos = beaconBlockEntity.getPos(); 81 | return FTConfig.toggleMod && FTConfig.hideBeam 82 | && squared2dDistanceTo(Vec3d.ofCenter(pos), player.getPos()) > Math.pow(FTConfig.beamDistance, 2); 83 | } 84 | 85 | private static double squared2dDistanceTo(Vec3d pos1, Vec3d pos2) { 86 | double dx = pos1.getX() - pos2.getX(); 87 | double dz = pos1.getZ() - pos2.getZ(); 88 | return dx * dx + dz * dz; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/BeaconBlockEntityRendererMixin.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; 4 | import com.llamalad7.mixinextras.sugar.Local; 5 | import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef; 6 | import com.llamalad7.mixinextras.sugar.ref.LocalLongRef; 7 | import net.minecraft.block.entity.BeaconBlockEntity; 8 | import net.minecraft.client.render.VertexConsumer; 9 | import net.minecraft.client.render.VertexConsumerProvider; 10 | import net.minecraft.client.render.block.entity.BeaconBlockEntityRenderer; 11 | import net.minecraft.client.util.math.MatrixStack; 12 | import net.minecraft.util.Identifier; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | import ru.feytox.feytweaks.client.FTConfig; 18 | import ru.feytox.feytweaks.client.FeytweaksClient; 19 | 20 | @Mixin(BeaconBlockEntityRenderer.class) 21 | public class BeaconBlockEntityRendererMixin { 22 | 23 | @Inject(method = "render(Lnet/minecraft/block/entity/BeaconBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", 24 | at = @At("HEAD"), cancellable = true) 25 | public void onRender(BeaconBlockEntity beaconBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j, CallbackInfo ci) { 26 | if (FeytweaksClient.shouldRenderBeam(beaconBlockEntity) || (!FeytweaksClient.isOnScreen(beaconBlockEntity) 27 | && FTConfig.beaconCulling)) { 28 | ci.cancel(); 29 | } 30 | } 31 | 32 | @WrapWithCondition(method = "renderBeam(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/util/Identifier;FFJIIIFF)V", 33 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/BeaconBlockEntityRenderer;renderBeamLayer(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIIFFFFFFFFFFFF)V", ordinal = 1)) 34 | private static boolean disableSecondBeamLayer(MatrixStack matrices, VertexConsumer vertices, int color, int yOffset, int height, float x1, float z1, float x2, float z2, float x3, float z3, float x4, float z4, float u1, float u2, float v1, float v2) { 35 | return !FTConfig.optimizeBeam; 36 | } 37 | 38 | @Inject(method = "renderBeam(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/util/Identifier;FFJIIIFF)V", 39 | at = @At("HEAD")) 40 | private static void disableBeamRotation(MatrixStack matrices, VertexConsumerProvider vertexConsumers, Identifier textureId, float tickDelta, float heightScale, long worldTime, int yOffset, int maxY, int color, float innerRadius, float outerRadius, CallbackInfo ci, @Local(ordinal = 0, argsOnly = true) LocalFloatRef tickDeltaRef, @Local(argsOnly = true) LocalLongRef worldTimeRef) { 41 | if (!FTConfig.optimizeBeam) return; 42 | worldTimeRef.set(0); 43 | tickDeltaRef.set(0); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/SignBlockEntityMixin.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyReturnValue; 4 | import net.minecraft.block.entity.SignBlockEntity; 5 | import net.minecraft.block.entity.SignText; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import ru.feytox.feytweaks.SignTextPosition; 9 | 10 | @Mixin(SignBlockEntity.class) 11 | public class SignBlockEntityMixin { 12 | 13 | @ModifyReturnValue(method = "getBackText", at = @At("RETURN")) 14 | private SignText injectFtToBack(SignText original) { 15 | if (!(original instanceof SignTextPosition signTextPosition)) return original; 16 | SignBlockEntity it = ((SignBlockEntity) (Object) this); 17 | signTextPosition.ft_setSignPosition(it.getPos()); 18 | return (SignText) signTextPosition; 19 | } 20 | 21 | @ModifyReturnValue(method = "getFrontText", at = @At("RETURN")) 22 | private SignText injectFtToFront(SignText original) { 23 | if (!(original instanceof SignTextPosition signTextPosition)) return original; 24 | SignBlockEntity it = ((SignBlockEntity) (Object) this); 25 | signTextPosition.ft_setSignPosition(it.getPos()); 26 | return (SignText) signTextPosition; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/SignBlockEntityRendererMixin.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin; 2 | 3 | import net.minecraft.block.entity.SignBlockEntity; 4 | import net.minecraft.client.render.VertexConsumerProvider; 5 | import net.minecraft.client.render.block.entity.SignBlockEntityRenderer; 6 | import net.minecraft.client.util.math.MatrixStack; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | import ru.feytox.feytweaks.client.FTConfig; 12 | import ru.feytox.feytweaks.client.FeytweaksClient; 13 | 14 | @Mixin(SignBlockEntityRenderer.class) 15 | public class SignBlockEntityRendererMixin { 16 | 17 | @Inject(method = "render(Lnet/minecraft/block/entity/SignBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", 18 | at = @At("HEAD"), cancellable = true) 19 | public void onRender(SignBlockEntity signBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j, CallbackInfo ci) { 20 | if (!FeytweaksClient.isOnScreen(signBlockEntity) && FTConfig.signCulling && FTConfig.toggleMod) { 21 | ci.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/SignTextMixin.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin; 2 | 3 | import net.minecraft.block.entity.SignText; 4 | import net.minecraft.client.MinecraftClient; 5 | import net.minecraft.client.network.ClientPlayerEntity; 6 | import net.minecraft.text.OrderedText; 7 | import net.minecraft.text.Text; 8 | import net.minecraft.util.math.BlockPos; 9 | import org.jetbrains.annotations.NotNull; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Unique; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 16 | import ru.feytox.feytweaks.SignTextPosition; 17 | import ru.feytox.feytweaks.client.FTConfig; 18 | import ru.feytox.feytweaks.client.FeytweaksClient; 19 | 20 | import java.util.function.Function; 21 | 22 | @Mixin(SignText.class) 23 | public class SignTextMixin implements SignTextPosition { 24 | 25 | @Unique 26 | @Nullable 27 | private BlockPos ft_signPosition = null; 28 | 29 | @Inject(method = "isGlowing", at = @At("HEAD"), cancellable = true) 30 | public void onIsGlowing(CallbackInfoReturnable cir) { 31 | BlockPos signPos = FeytweaksClient.getSignPos(((SignText)(Object) this)); 32 | ClientPlayerEntity player = MinecraftClient.getInstance().player; 33 | if (signPos == null || player == null) return; 34 | 35 | if (FTConfig.toggleMod && FTConfig.hideGlow 36 | && signPos.getSquaredDistance(player.getPos()) >= Math.pow(FTConfig.hideGlowDistance, 2)) { 37 | cir.setReturnValue(false); 38 | } 39 | } 40 | 41 | @Inject(method = "getOrderedMessages", at = @At("HEAD"), cancellable = true) 42 | public void onGetOrderedMessages(boolean filterText, Function textOrderingFunction, CallbackInfoReturnable cir) { 43 | if (FeytweaksClient.shouldRenderText(((SignText)(Object) this))) { 44 | OrderedText[] emptyRows = new OrderedText[4]; 45 | for (int i = 0; i < 4; i++) { 46 | emptyRows[i] = OrderedText.EMPTY; 47 | } 48 | 49 | cir.setReturnValue(emptyRows); 50 | } 51 | } 52 | 53 | @Override 54 | public @Nullable BlockPos ft_getSignPosition() { 55 | return ft_signPosition; 56 | } 57 | 58 | @Override 59 | public void ft_setSignPosition(@NotNull BlockPos blockPos) { 60 | ft_signPosition = blockPos; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/TextRendererMixin.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin; 2 | 3 | import net.minecraft.client.font.TextRenderer; 4 | import net.minecraft.client.render.VertexConsumerProvider; 5 | import net.minecraft.text.OrderedText; 6 | import net.minecraft.util.DyeColor; 7 | import org.joml.Matrix4f; 8 | import org.joml.Vector3f; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Unique; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | import ru.feytox.feytweaks.client.FTConfig; 16 | import ru.feytox.feytweaks.mixin.accessors.TextRendererAccessor; 17 | 18 | 19 | @Mixin(TextRenderer.class) 20 | public class TextRendererMixin { 21 | 22 | @Inject(method = "drawWithOutline", at = @At("HEAD"), cancellable = true) 23 | public void onDrawWithOutline(OrderedText text, float x, float y, int color, int outlineColor, Matrix4f matrix, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) { 24 | if ((FTConfig.simpleGlow || FTConfig.fastGlowToShadow) && FTConfig.toggleMod) { 25 | if (color == DyeColor.BLACK.getSignColor()) { 26 | color = outlineColor; 27 | } 28 | 29 | fDrawInternal(text, x, y, color, FTConfig.fastGlowToShadow, matrix, vertexConsumers, light); 30 | ci.cancel(); 31 | } 32 | } 33 | 34 | @Unique 35 | private void fDrawInternal(OrderedText text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, int light) { 36 | color = (color & -67108864) == 0 ? color | -16777216 : color; 37 | Matrix4f matrix4f = new Matrix4f(matrix); 38 | TextRenderer textRenderer = ((TextRenderer)(Object) this); 39 | if (shadow) { 40 | ((TextRendererAccessor) textRenderer).callDrawLayer(text, x, y, color, true, matrix, vertexConsumerProvider, TextRenderer.TextLayerType.NORMAL, 0, light); 41 | matrix4f.translate(new Vector3f(0.0F, 0.0F, 0.03F)); 42 | } 43 | ((TextRendererAccessor) textRenderer).callDrawLayer(text, x, y, color, false, matrix, vertexConsumerProvider, TextRenderer.TextLayerType.NORMAL, 0, light); 44 | } 45 | 46 | 47 | @ModifyVariable(method = "drawWithOutline", at = @At("STORE"), ordinal = 5) 48 | private int getOutlineRenderJ(int j) { 49 | return FTConfig.glowToShadow ? 1 : j; 50 | } 51 | 52 | @ModifyVariable(method = "drawWithOutline", at = @At("STORE"), ordinal = 6) 53 | private int getOutlineRenderK(int k) { 54 | return FTConfig.glowToShadow ? 1 : k; 55 | } 56 | 57 | @Inject(method = "drawWithOutline", at = @At(value = "INVOKE", 58 | target = "Lnet/minecraft/text/OrderedText;accept(Lnet/minecraft/text/CharacterVisitor;)Z", 59 | ordinal = 1), 60 | cancellable = true) 61 | private void optimizeOutline(OrderedText text, float x, float y, int color, int outlineColor, Matrix4f matrix, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) { 62 | if (FTConfig.optimizeGlow) { 63 | Matrix4f matrix4f = new Matrix4f(matrix); 64 | matrix4f.translate(new Vector3f(0.0F, 0.0F, 0.0051F)); 65 | 66 | TextRenderer.Drawer drawer = ((TextRenderer) (Object) this).new Drawer(vertexConsumers, x, y, 67 | TextRendererAccessor.callTweakTransparency(color), false, matrix4f, TextRenderer.TextLayerType.NORMAL, light); 68 | text.accept(drawer); 69 | drawer.drawLayer(0, x); 70 | 71 | ci.cancel(); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/accessors/TextRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin.accessors; 2 | 3 | import net.minecraft.client.font.TextRenderer; 4 | import net.minecraft.client.render.VertexConsumerProvider; 5 | import net.minecraft.text.OrderedText; 6 | import org.joml.Matrix4f; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(TextRenderer.class) 11 | public interface TextRendererAccessor { 12 | @Invoker 13 | static int callTweakTransparency(int argb) { 14 | throw new UnsupportedOperationException(); 15 | } 16 | 17 | @Invoker 18 | float callDrawLayer(OrderedText text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, TextRenderer.TextLayerType layerType, int underlineColor, int light); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ru/feytox/feytweaks/mixin/accessors/WorldRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package ru.feytox.feytweaks.mixin.accessors; 2 | 3 | import net.minecraft.client.render.Frustum; 4 | import net.minecraft.client.render.WorldRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(WorldRenderer.class) 9 | public interface WorldRendererAccessor { 10 | @Accessor 11 | Frustum getFrustum(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/assets/feytweaks/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feytox/FeyTweaks/6f63f62e37cbaaed8e055fade514a856fa208a3e/src/main/resources/assets/feytweaks/icon.png -------------------------------------------------------------------------------- /src/main/resources/assets/feytweaks/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "feytweaks.midnightconfig.title": "FeyTweaks", 3 | 4 | "key.feytweaks.openConfigKey": "Open config menu", 5 | "feytweaks.midnightconfig.toggleMod": "Enable mod: ", 6 | 7 | "feytweaks.midnightconfig.signs": "§l§nSigns", 8 | "feytweaks.midnightconfig.hideTexts": "Hide text in the distance: ", 9 | "feytweaks.midnightconfig.textDistance": "Min. distance to hide §ntext§r: ", 10 | "feytweaks.midnightconfig.signCulling": "Text culling: ", 11 | "feytweaks.midnightconfig.simpleGlow": "Always hide glow effect: ", 12 | "feytweaks.midnightconfig.glowToShadow": "Outline of glow effect -> Text shadow: ", 13 | "feytweaks.midnightconfig.fastGlowToShadow": "Outline of glow effect -> Text shadow + Optimization [Beta]: ", 14 | "feytweaks.midnightconfig.hideGlow": "Hide glow effect in the distance: ", 15 | "feytweaks.midnightconfig.hideGlowDistance": "Min. distance to hide §nglow effect§r: ", 16 | "feytweaks.midnightconfig.optimizeGlow": "Glow optimization [Beta]: ", 17 | 18 | "feytweaks.midnightconfig.beacons": "§l§nBeacons", 19 | "feytweaks.midnightconfig.hideBeam": "Hide beams in the distance: ", 20 | "feytweaks.midnightconfig.beamDistance": "Min. distance to hide beams: ", 21 | "feytweaks.midnightconfig.beaconCulling": "Beam culling: ", 22 | "feytweaks.midnightconfig.optimizeBeam": "Beam optimization: " 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/assets/feytweaks/lang/pt_br.json: -------------------------------------------------------------------------------- 1 | { 2 | "feytweaks.midnightconfig.title": "FeyTweaks", 3 | 4 | "key.feytweaks.openConfigKey": "Abra o menu de configuração", 5 | "feytweaks.midnightconfig.toggleMod": "Ativar o Mod: ", 6 | 7 | "feytweaks.midnightconfig.signs": "§l§nPLacas", 8 | "feytweaks.midnightconfig.hideTexts": "Ocultar texto à distância: ", 9 | "feytweaks.midnightconfig.textDistance": "mín. distância para ocultar §ntexto§r: ", 10 | "feytweaks.midnightconfig.signCulling": "Abate de texto: ", 11 | "feytweaks.midnightconfig.simpleGlow": "Sempre ocultar o efeito de brilho: ", 12 | "feytweaks.midnightconfig.glowToShadow": "Contorno do efeito de brilho -> Sombra de texto: ", 13 | "feytweaks.midnightconfig.fastGlowToShadow": "Contorno do efeito de brilho -> Sombra de texto + Otimização [Beta]: ", 14 | "feytweaks.midnightconfig.hideGlow": "Ocultar efeito de brilho à distância: ", 15 | "feytweaks.midnightconfig.hideGlowDistance": "mín. distância para esconder o §nefeito de brilho§r: ", 16 | "feytweaks.midnightconfig.optimizeGlow": "Otimização de Brilho [Beta]: ", 17 | 18 | "feytweaks.midnightconfig.beacons": "§l§nSinalizador", 19 | "feytweaks.midnightconfig.hideBeam": "Ocultar feixes de luz à distância: ", 20 | "feytweaks.midnightconfig.beamDistance": "mín. distância para esconder feixes de luz: ", 21 | "feytweaks.midnightconfig.beaconCulling": "Abate de Sinalizador: ", 22 | "feytweaks.midnightconfig.optimizeBeam": "Otimização do feixe: " 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/assets/feytweaks/lang/ru_ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "feytweaks.midnightconfig.title": "FeyTweaks", 3 | 4 | "key.feytweaks.openConfigKey": "Открыть меню конфига", 5 | "feytweaks.midnightconfig.toggleMod": "Включить мод: ", 6 | 7 | "feytweaks.midnightconfig.signs": "§l§nТаблички", 8 | "feytweaks.midnightconfig.hideTexts": "Скрывать текст на дистанции: ", 9 | "feytweaks.midnightconfig.textDistance": "Минимальная дистанция для скрытия §nтекста§r: ", 10 | "feytweaks.midnightconfig.signCulling": "Скрытие текста вне поля зрения: ", 11 | "feytweaks.midnightconfig.simpleGlow": "Всегда скрывать эффект свечения: ", 12 | "feytweaks.midnightconfig.glowToShadow": "Обводка светящегося текста -> Тень текста: ", 13 | "feytweaks.midnightconfig.fastGlowToShadow": "Обводка светящегося текста -> Тень текста + Оптимизация [Бета]: ", 14 | "feytweaks.midnightconfig.hideGlowDistance": "Минимальная дистанция для скрытия §nэффекта свечения§r: ", 15 | "feytweaks.midnightconfig.hideGlow": "Cкрывать эффект свечения на дистанции: ", 16 | "feytweaks.midnightconfig.optimizeGlow": "Оптимизация эффекта свечения [Бета]: ", 17 | 18 | "feytweaks.midnightconfig.beacons": "§l§nМаяки", 19 | "feytweaks.midnightconfig.hideBeam": "Скрывать лучи на дистанции: ", 20 | "feytweaks.midnightconfig.beamDistance": "Минимальная дистанция для скрытия: ", 21 | "feytweaks.midnightconfig.optimizeBeam": "Оптимизация лучей: ", 22 | "feytweaks.midnightconfig.beaconCulling": "Скрытие лучей вне поля зрения: " 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/assets/feytweaks/lang/zh_cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "feytweaks.midnightconfig.title": "FeyTweaks", 3 | 4 | "key.feytweaks.openConfigKey": "打开设置菜单", 5 | "feytweaks.midnightconfig.toggleMod": "启用模组:", 6 | 7 | "feytweaks.midnightconfig.signs": "§l§n告示牌", 8 | "feytweaks.midnightconfig.hideTexts": "隐藏远处文本:", 9 | "feytweaks.midnightconfig.textDistance": "隐藏§n文本§r的最小距离:", 10 | "feytweaks.midnightconfig.signCulling": "文本剔除:", 11 | "feytweaks.midnightconfig.simpleGlow": "始终隐藏发光效果:", 12 | "feytweaks.midnightconfig.glowToShadow": "发光效果的轮廓 -> 文本阴影:", 13 | "feytweaks.midnightconfig.fastGlowToShadow": "发光效果的轮廓 -> 文本阴影 + 优化 [Beta]:", 14 | "feytweaks.midnightconfig.hideGlow": "隐藏远处发光效果:", 15 | "feytweaks.midnightconfig.hideGlowDistance": "隐藏§n发光效果§r的最小距离:", 16 | "feytweaks.midnightconfig.optimizeGlow": "荧光优化 [Beta]:", 17 | 18 | "feytweaks.midnightconfig.beacons": "§l§n信标", 19 | "feytweaks.midnightconfig.hideBeam": "隐藏远处光束:", 20 | "feytweaks.midnightconfig.beamDistance": "隐藏光束的最小距离:", 21 | "feytweaks.midnightconfig.beaconCulling": "光束剔除:", 22 | "feytweaks.midnightconfig.optimizeBeam": "光束优化:" 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "feytweaks", 4 | "version": "${version}", 5 | "name": "FeyTweaks", 6 | "description": "Mod for optimizing signs and beacons.", 7 | "authors": [ 8 | "Feytox" 9 | ], 10 | "contact": { 11 | "homepage": "https://modrinth.com/mod/feytweaks", 12 | "sources": "https://github.com/feytox/feytweaks", 13 | "issues": "https://github.com/feytox/feytweaks/issues" 14 | }, 15 | "license": "MIT", 16 | "icon": "assets/feytweaks/icon.png", 17 | "accessWidener" : "feytweaks.accesswidener", 18 | "environment": "client", 19 | "entrypoints": { 20 | "client": [ 21 | "ru.feytox.feytweaks.client.FeytweaksClient" 22 | ], 23 | "main": [ 24 | "ru.feytox.feytweaks.Feytweaks" 25 | ] 26 | }, 27 | "mixins": [ 28 | "feytweaks.mixins.json" 29 | ], 30 | "depends": { 31 | "fabric": "*", 32 | "minecraft": "1.21.x" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/feytweaks.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v1 named 2 | accessible class net/minecraft/client/font/TextRenderer$Drawer -------------------------------------------------------------------------------- /src/main/resources/feytweaks.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "ru.feytox.feytweaks.mixin", 5 | "compatibilityLevel": "JAVA_17", 6 | "mixins": [ 7 | "SignBlockEntityMixin", 8 | "SignTextMixin", 9 | "accessors.TextRendererAccessor", 10 | "accessors.WorldRendererAccessor" 11 | ], 12 | "client": [ 13 | "BeaconBlockEntityRendererMixin", 14 | "SignBlockEntityRendererMixin", 15 | "TextRendererMixin" 16 | ], 17 | "injectors": { 18 | "defaultRequire": 1 19 | } 20 | } 21 | --------------------------------------------------------------------------------