baseline: post wave1+i2b+b2i, vfbuild13=377 errors
This commit is contained in:
commit
e11e749e4b
2248 changed files with 378506 additions and 0 deletions
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
build/
|
||||||
|
.gradle/
|
||||||
|
.idea/
|
||||||
|
dist/
|
||||||
|
*.class
|
||||||
1836
build-logs/vfbuild12.log
Normal file
1836
build-logs/vfbuild12.log
Normal file
File diff suppressed because it is too large
Load diff
1578
build-logs/vfbuild13.log
Normal file
1578
build-logs/vfbuild13.log
Normal file
File diff suppressed because it is too large
Load diff
64
build.gradle
Normal file
64
build.gradle
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
plugins {
|
||||||
|
id 'net.fabricmc.fabric-loom' version '1.17.12'
|
||||||
|
}
|
||||||
|
|
||||||
|
version = project.mod_version
|
||||||
|
group = 'xyz.evoproject'
|
||||||
|
|
||||||
|
base {
|
||||||
|
archivesName = project.archives_base_name
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
url = 'https://maven.fabricmc.net/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
accessWidenerPath = file('src/main/resources/evolution.accesswidener')
|
||||||
|
mods {
|
||||||
|
"evolutiondlc" {
|
||||||
|
sourceSet sourceSets.main
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||||
|
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
implementation "io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}"
|
||||||
|
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
|
compileOnly 'com.google.code.gson:gson:2.14.0'
|
||||||
|
compileOnly 'org.slf4j:slf4j-api:2.0.17'
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(25)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
it.options.release = 25
|
||||||
|
it.options.encoding = 'UTF-8'
|
||||||
|
it.options.compilerArgs += ['-proc:none', '-Xmaxerrs', '100000']
|
||||||
|
}
|
||||||
|
|
||||||
|
def postprocessTask = tasks.register('postprocessClasses', Exec) {
|
||||||
|
dependsOn tasks.named('classes')
|
||||||
|
commandLine 'python3', "$rootDir/tools/postbuild.py",
|
||||||
|
layout.buildDirectory.dir('classes/java/main').get().asFile.absolutePath
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('jar') {
|
||||||
|
dependsOn postprocessTask
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.matching { it.name == 'runClient' }.configureEach {
|
||||||
|
dependsOn postprocessTask
|
||||||
|
}
|
||||||
12
gradle.properties
Normal file
12
gradle.properties
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Gradle
|
||||||
|
org.gradle.jvmargs=-Xmx3G
|
||||||
|
|
||||||
|
# Fabric
|
||||||
|
minecraft_version=26.2
|
||||||
|
loader_version=0.19.5
|
||||||
|
fabric_version=0.159.0+26.2
|
||||||
|
mixinextras_version=0.5.5
|
||||||
|
|
||||||
|
# Mod
|
||||||
|
mod_version=2026.10.1.994
|
||||||
|
archives_base_name=evolutiondlc
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
9
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
9
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
retries=0
|
||||||
|
retryBackOffMs=500
|
||||||
|
validateDistributionUrl=true
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
248
gradlew
vendored
Executable file
248
gradlew
vendored
Executable file
|
|
@ -0,0 +1,248 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# gradlew start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh gradlew
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/<unknown>/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
|
else
|
||||||
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
82
gradlew.bat
vendored
Normal file
82
gradlew.bat
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem gradlew startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||||
|
setlocal EnableExtensions
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
echo. 1>&2
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
|
echo. 1>&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo. 1>&2
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
|
echo. 1>&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute gradlew
|
||||||
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||||
|
|
||||||
|
:exitWithErrorLevel
|
||||||
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||||
|
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||||
BIN
libs/api-0.32.0.jar
Normal file
BIN
libs/api-0.32.0.jar
Normal file
Binary file not shown.
BIN
libs/jcodec-0.2.5.jar
Normal file
BIN
libs/jcodec-0.2.5.jar
Normal file
Binary file not shown.
BIN
libs/luaj-jse-3.0.1.jar
Normal file
BIN
libs/luaj-jse-3.0.1.jar
Normal file
Binary file not shown.
BIN
libs/pytorch-engine-0.32.0.jar
Normal file
BIN
libs/pytorch-engine-0.32.0.jar
Normal file
Binary file not shown.
BIN
libs/viafabricplus-5.0.2.jar
Normal file
BIN
libs/viafabricplus-5.0.2.jar
Normal file
Binary file not shown.
BIN
libs/viafabricplus-api-5.0.2.jar
Normal file
BIN
libs/viafabricplus-api-5.0.2.jar
Normal file
Binary file not shown.
BIN
libs/viaversion-common-5.12.0.jar
Normal file
BIN
libs/viaversion-common-5.12.0.jar
Normal file
Binary file not shown.
BIN
libs/voicechat-fabric-2.6.21+26.2.jar
Normal file
BIN
libs/voicechat-fabric-2.6.21+26.2.jar
Normal file
Binary file not shown.
BIN
libs/whisper-jni-1.7.1.jar
Normal file
BIN
libs/whisper-jni-1.7.1.jar
Normal file
Binary file not shown.
11
settings.gradle
Normal file
11
settings.gradle
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = 'Fabric'
|
||||||
|
url = 'https://maven.fabricmc.net/'
|
||||||
|
}
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = 'evolutiondlc'
|
||||||
26
src/main/java/a/a.java
Normal file
26
src/main/java/a/a.java
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.DeltaTracker;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(GameRenderer.class)
|
||||||
|
public class a {
|
||||||
|
@Inject(method = "render", at = @At("HEAD"))
|
||||||
|
private void deltaTime(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||||
|
float currentTime = (float)GLFW.glfwGetTime();
|
||||||
|
t.deltaTime = currentTime - t.prevTime;
|
||||||
|
t.prevTime = currentTime;
|
||||||
|
if (Minecraft.getInstance().isPaused()) {
|
||||||
|
t.deltaTime = 0.0F;
|
||||||
|
} else {
|
||||||
|
t.deltaTime = (float)Math.min(0.05, t.deltaTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
69
src/main/java/a/b.java
Normal file
69
src/main/java/a/b.java
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.client.multiplayer.MultiPlayerGameMode;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.phys.HitResult;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(Minecraft.class)
|
||||||
|
public class b {
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
public LocalPlayer player;
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
public ClientLevel level;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
public GameRenderer gameRenderer;
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
public MultiPlayerGameMode gameMode;
|
||||||
|
@Shadow
|
||||||
|
private int rightClickDelay;
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
public HitResult hitResult;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private static Logger LOGGER;
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "startAttack",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;swing(Lnet/minecraft/world/InteractionHand;)V")
|
||||||
|
)
|
||||||
|
public void doAttackMix(CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (this.player instanceof y mixin) {
|
||||||
|
mixin.hMI5_0$resetMainHandSwing(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "startUseItem",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;swing(Lnet/minecraft/world/InteractionHand;)V")
|
||||||
|
)
|
||||||
|
private void doItemUse(LocalPlayer instance, InteractionHand hand) {
|
||||||
|
if (instance instanceof y accessor) {
|
||||||
|
if (hand == InteractionHand.MAIN_HAND) {
|
||||||
|
accessor.hMI5_0$resetMainHandSwing(true);
|
||||||
|
} else {
|
||||||
|
accessor.hMI5_0$resetOffHandSwing(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.swing(hand);
|
||||||
|
}
|
||||||
|
}
|
||||||
51
src/main/java/a/c.java
Normal file
51
src/main/java/a/c.java
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
|
@Mixin(ItemStack.class)
|
||||||
|
public class c implements x {
|
||||||
|
@Unique
|
||||||
|
private int transform = -1;
|
||||||
|
@Unique
|
||||||
|
private int swingSpeed = 10;
|
||||||
|
@Unique
|
||||||
|
private int shouldRenderAsBlock = -1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$setTransform(boolean value) {
|
||||||
|
this.transform = value ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$setTransform(int value) {
|
||||||
|
this.transform = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hMI5_0$getTransform() {
|
||||||
|
return this.transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$setSwingSpeed(int value) {
|
||||||
|
this.swingSpeed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hMI5_0$getSwingSpeed() {
|
||||||
|
return this.swingSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$setRenderAsBlock(boolean value) {
|
||||||
|
this.shouldRenderAsBlock = value ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hMI5_0$getRenderAsBlock() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
114
src/main/java/a/d.java
Normal file
114
src/main/java/a/d.java
Normal file
|
|
@ -0,0 +1,114 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.math.Axis;
|
||||||
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
import net.minecraft.client.Camera;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.joml.Quaternionf;
|
||||||
|
import org.joml.Vector3f;
|
||||||
|
import org.joml.Vector3fc;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Camera.class)
|
||||||
|
public abstract class d implements w {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Quaternionf rotation;
|
||||||
|
@Shadow
|
||||||
|
private float xRot;
|
||||||
|
@Shadow
|
||||||
|
private float yRot;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private static Vector3fc FORWARDS;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private static Vector3fc UP;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private static Vector3fc LEFT;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Vector3f forwards;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Vector3f up;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Vector3f left;
|
||||||
|
@Shadow
|
||||||
|
private Vec3 position;
|
||||||
|
@Unique
|
||||||
|
private float pitchM = 0.0F;
|
||||||
|
@Unique
|
||||||
|
private float yawM = 0.0F;
|
||||||
|
@Unique
|
||||||
|
private float rollM = 0.0F;
|
||||||
|
@Unique
|
||||||
|
private float xM = 0.0F;
|
||||||
|
@Unique
|
||||||
|
private float yM = 0.0F;
|
||||||
|
@Unique
|
||||||
|
private float zM = 0.0F;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract void setPosition(Vec3 var1);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$applyRotation() {
|
||||||
|
this.rotation.add(Axis.XP.rotationDegrees(this.pitchM));
|
||||||
|
this.rotation.add(Axis.YP.rotationDegrees(this.yawM));
|
||||||
|
this.rotation.add(Axis.ZP.rotationDegrees(this.rollM));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$setRotationValues(float pitch, float yaw, float roll) {
|
||||||
|
this.pitchM = pitch;
|
||||||
|
this.yawM = yaw;
|
||||||
|
this.rollM = roll;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$setPosValues(float x, float y, float z) {
|
||||||
|
this.xM = x;
|
||||||
|
this.yM = y;
|
||||||
|
this.zM = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "setRotation", at = @At("RETURN"))
|
||||||
|
public void setRotationMixin(float yaw, float pitch, CallbackInfo ci) {
|
||||||
|
if (ve.active()) {
|
||||||
|
if (!FabricLoader.getInstance().isModLoaded("do_a_barrel_roll")) {
|
||||||
|
this.rotation
|
||||||
|
.rotationYXZ(
|
||||||
|
(float) Math.PI - (yaw + this.yawM) * (float) (Math.PI / 180.0),
|
||||||
|
(-pitch + this.pitchM) * (float) (Math.PI / 180.0),
|
||||||
|
this.rollM * (float) (Math.PI / 180.0)
|
||||||
|
);
|
||||||
|
FORWARDS.rotate(this.rotation, this.forwards);
|
||||||
|
UP.rotate(this.rotation, this.up);
|
||||||
|
LEFT.rotate(this.rotation, this.left);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "setPosition(DDD)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void setRotationMixin(double x, double y, double z, CallbackInfo ci) {
|
||||||
|
if (ve.active()) {
|
||||||
|
if (!FabricLoader.getInstance().isModLoaded("do_a_barrel_roll")) {
|
||||||
|
x += this.xM;
|
||||||
|
y += this.yM;
|
||||||
|
z += this.zM;
|
||||||
|
this.setPosition(new Vec3(x, y, z));
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
185
src/main/java/a/e.java
Normal file
185
src/main/java/a/e.java
Normal file
|
|
@ -0,0 +1,185 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
|
import net.fabricmc.api.Environment;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
@Mixin(LivingEntity.class)
|
||||||
|
public abstract class e implements y {
|
||||||
|
private boolean interactOffhand = false;
|
||||||
|
private boolean interactMainHand = false;
|
||||||
|
private boolean blockBreaking = false;
|
||||||
|
@Unique
|
||||||
|
private int offHandSwingTicks;
|
||||||
|
@Unique
|
||||||
|
private boolean offHandSwinging;
|
||||||
|
@Unique
|
||||||
|
public float offHandSwingProgress;
|
||||||
|
@Unique
|
||||||
|
public float lastOffHandSwingProgress;
|
||||||
|
@Unique
|
||||||
|
private int mainHandSwingTicks;
|
||||||
|
@Unique
|
||||||
|
private boolean mainHandSwinging;
|
||||||
|
@Unique
|
||||||
|
public float mainHandSwingProgress;
|
||||||
|
@Unique
|
||||||
|
public float lastMainHandSwingProgress;
|
||||||
|
private int mainSwingCount = 0;
|
||||||
|
@Unique
|
||||||
|
private boolean swingMHand = false;
|
||||||
|
@Unique
|
||||||
|
private boolean swingOHand = false;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract int getCurrentSwingDuration();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract ItemStack getMainHandItem();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract ItemStack getOffhandItem();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hMI5_0$getSwingCount() {
|
||||||
|
return this.mainSwingCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$resetOffHandSwing(boolean interact) {
|
||||||
|
this.offHandSwingTicks = 0;
|
||||||
|
this.offHandSwinging = true;
|
||||||
|
this.swingOHand = !this.swingOHand;
|
||||||
|
this.interactOffhand = interact;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hMI5_0$resetMainHandSwing(boolean interact) {
|
||||||
|
this.mainHandSwingTicks = 0;
|
||||||
|
this.mainHandSwinging = true;
|
||||||
|
this.swingMHand = !this.swingMHand;
|
||||||
|
this.mainSwingCount++;
|
||||||
|
this.interactMainHand = interact;
|
||||||
|
if (Minecraft.getInstance().gameMode.isDestroying()) {
|
||||||
|
this.blockBreaking = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float hMI5_0$getMainHandSwingProgress(float tickDelta) {
|
||||||
|
float f = this.mainHandSwingProgress - this.lastMainHandSwingProgress;
|
||||||
|
if (f < 0.0F) {
|
||||||
|
f++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.lastMainHandSwingProgress + f * tickDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float hMI5_0$getOffHandSwingProgress(float tickDelta) {
|
||||||
|
float f = this.offHandSwingProgress - this.lastOffHandSwingProgress;
|
||||||
|
if (f < 0.0F) {
|
||||||
|
f++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.lastOffHandSwingProgress + f * tickDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getMInteract() {
|
||||||
|
return this.interactMainHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getOInteract() {
|
||||||
|
return this.interactOffhand;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getBlockBreak() {
|
||||||
|
return this.blockBreaking;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getMHandEvent() {
|
||||||
|
return this.swingMHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getOHandEvent() {
|
||||||
|
return this.swingOHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "baseTick", at = @At("HEAD"))
|
||||||
|
private void tick(CallbackInfo ci) {
|
||||||
|
this.lastOffHandSwingProgress = this.offHandSwingProgress;
|
||||||
|
this.lastMainHandSwingProgress = this.mainHandSwingProgress;
|
||||||
|
int i = af.itemSwingSpeed.getOrDefault(this.getMainHandItem().getItem().toString(), 10);
|
||||||
|
if (this.mainHandSwinging) {
|
||||||
|
this.mainHandSwingTicks++;
|
||||||
|
if (this.mainHandSwingTicks >= i) {
|
||||||
|
this.mainHandSwingTicks = 0;
|
||||||
|
this.mainHandSwinging = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.interactMainHand) {
|
||||||
|
this.interactMainHand = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.blockBreaking) {
|
||||||
|
this.blockBreaking = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mainHandSwingTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mainHandSwingProgress = (float)this.mainHandSwingTicks / i;
|
||||||
|
int i2 = af.itemSwingSpeed.getOrDefault(this.getOffhandItem().getItem().toString(), 10);
|
||||||
|
if (this.offHandSwinging) {
|
||||||
|
this.offHandSwingTicks++;
|
||||||
|
if (this.offHandSwingTicks >= i2) {
|
||||||
|
this.offHandSwingTicks = 0;
|
||||||
|
this.offHandSwinging = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.interactOffhand) {
|
||||||
|
this.interactOffhand = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.offHandSwingTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.offHandSwingProgress = (float)this.offHandSwingTicks / i2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "swing(Lnet/minecraft/world/InteractionHand;Z)V", at = @At("HEAD"))
|
||||||
|
private void onSwingHand(InteractionHand hand, boolean fromServerPlayer, CallbackInfo ci) {
|
||||||
|
if (hand == InteractionHand.OFF_HAND) {
|
||||||
|
int duration = af.itemSwingSpeed.getOrDefault(this.getOffhandItem().getItem().toString(), 10);
|
||||||
|
if (!this.offHandSwinging || this.offHandSwingTicks >= duration / 2 || this.offHandSwingTicks < 0) {
|
||||||
|
this.offHandSwingTicks = -1;
|
||||||
|
this.offHandSwinging = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int duration = af.itemSwingSpeed.getOrDefault(this.getMainHandItem().getItem().toString(), 10);
|
||||||
|
if (!this.mainHandSwinging || this.mainHandSwingTicks >= duration / 2 || this.mainHandSwingTicks < 0) {
|
||||||
|
this.mainHandSwingTicks = -1;
|
||||||
|
this.mainHandSwinging = true;
|
||||||
|
if (Minecraft.getInstance().gameMode.isDestroying()) {
|
||||||
|
this.blockBreaking = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
139
src/main/java/a/f.java
Normal file
139
src/main/java/a/f.java
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
|
import net.fabricmc.api.Environment;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Constant;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
@Mixin(LivingEntity.class)
|
||||||
|
public abstract class f implements y {
|
||||||
|
@Shadow
|
||||||
|
private int swingTime;
|
||||||
|
@Shadow
|
||||||
|
public float attackAnim;
|
||||||
|
@Shadow
|
||||||
|
public float oAttackAnim;
|
||||||
|
@Shadow
|
||||||
|
private boolean swinging;
|
||||||
|
@Shadow
|
||||||
|
public InteractionHand swingingArm;
|
||||||
|
@Unique
|
||||||
|
private int offHandSwingTicks;
|
||||||
|
@Unique
|
||||||
|
private boolean offHandSwinging;
|
||||||
|
@Unique
|
||||||
|
public float offHandSwingProgress;
|
||||||
|
@Unique
|
||||||
|
public float lastOffHandSwingProgress;
|
||||||
|
@Unique
|
||||||
|
private int mainHandSwingTicks;
|
||||||
|
@Unique
|
||||||
|
private boolean mainHandSwinging;
|
||||||
|
@Unique
|
||||||
|
public float mainHandSwingProgress;
|
||||||
|
@Unique
|
||||||
|
public float lastMainHandSwingProgress;
|
||||||
|
private boolean swingMHand = false;
|
||||||
|
private boolean swingOHand = false;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract int getCurrentSwingDuration();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract void swing(InteractionHand var1);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float hMI5_0$getMainHandSwingProgress(float tickDelta) {
|
||||||
|
float f = this.mainHandSwingProgress - this.lastMainHandSwingProgress;
|
||||||
|
if (f < 0.0F) {
|
||||||
|
f++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.lastMainHandSwingProgress + f * tickDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float hMI5_0$getOffHandSwingProgress(float tickDelta) {
|
||||||
|
float f = this.offHandSwingProgress - this.lastOffHandSwingProgress;
|
||||||
|
if (f < 0.0F) {
|
||||||
|
f++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.lastOffHandSwingProgress + f * tickDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getMHandEvent() {
|
||||||
|
return this.swingMHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hMI5_0$getOHandEvent() {
|
||||||
|
return this.swingOHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "swing", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onSwingHand(InteractionHand hand, CallbackInfo ci) {
|
||||||
|
if (hand == InteractionHand.OFF_HAND) {
|
||||||
|
int duration = aj.swingSpeed;
|
||||||
|
if (!this.offHandSwinging || this.offHandSwingTicks >= duration / 2) {
|
||||||
|
this.offHandSwingTicks = 0;
|
||||||
|
this.offHandSwinging = true;
|
||||||
|
this.swingOHand = !this.swingOHand;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int duration = aj.swingSpeed;
|
||||||
|
if (!this.mainHandSwinging || this.mainHandSwingTicks >= duration / 2) {
|
||||||
|
this.mainHandSwingTicks = 0;
|
||||||
|
this.mainHandSwinging = true;
|
||||||
|
this.swingMHand = !this.swingMHand;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "updateSwingTime", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onTickHandSwing(CallbackInfo ci) {
|
||||||
|
this.lastOffHandSwingProgress = this.offHandSwingProgress;
|
||||||
|
int offHandDuration = aj.swingSpeed;
|
||||||
|
if (this.offHandSwinging) {
|
||||||
|
this.offHandSwingTicks++;
|
||||||
|
if (this.offHandSwingTicks >= offHandDuration) {
|
||||||
|
this.offHandSwinging = false;
|
||||||
|
this.offHandSwingTicks = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.offHandSwingTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.offHandSwingProgress = (float)this.offHandSwingTicks / offHandDuration;
|
||||||
|
this.lastMainHandSwingProgress = this.mainHandSwingProgress;
|
||||||
|
int mainHandDuration = aj.swingSpeed;
|
||||||
|
if (this.mainHandSwinging) {
|
||||||
|
this.mainHandSwingTicks++;
|
||||||
|
if (this.mainHandSwingTicks >= mainHandDuration) {
|
||||||
|
this.mainHandSwinging = false;
|
||||||
|
this.mainHandSwingTicks = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.mainHandSwingTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mainHandSwingProgress = (float)this.mainHandSwingTicks / mainHandDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyConstant(method = "getCurrentSwingDuration()I", constant = @Constant(intValue = 6))
|
||||||
|
private int modifySwingDuration(int original) {
|
||||||
|
return this == Minecraft.getInstance().player ? aj.swingSpeed : original;
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/main/java/a/g.java
Normal file
24
src/main/java/a/g.java
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.client.renderer.item.properties.numeric.UseDuration;
|
||||||
|
import net.minecraft.world.entity.ItemOwner;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(UseDuration.class)
|
||||||
|
public class g {
|
||||||
|
@Inject(method = "get", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void swapProperty(ItemStack stack, ClientLevel world, ItemOwner context, int seed, CallbackInfoReturnable<Float> cir) {
|
||||||
|
if (Minecraft.getInstance().player != null
|
||||||
|
&& Minecraft.getInstance().player.getUseItem() == stack
|
||||||
|
&& af.useDuration.containsKey(stack.getItem().toString())) {
|
||||||
|
cir.setReturnValue(Float.parseFloat(af.useDuration.get(stack.getItem().toString()).toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/main/java/a/h.java
Normal file
24
src/main/java/a/h.java
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.client.renderer.item.properties.conditional.IsUsingItem;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.item.ItemDisplayContext;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(IsUsingItem.class)
|
||||||
|
public class h {
|
||||||
|
@Inject(method = "get", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void swapProperty(
|
||||||
|
ItemStack stack, ClientLevel world, LivingEntity entity, int seed, ItemDisplayContext displayContext, CallbackInfoReturnable<Boolean> cir
|
||||||
|
) {
|
||||||
|
if (entity != null && entity.getUseItem() == stack && af.usingItem.containsKey(stack.getItem().toString())) {
|
||||||
|
cir.setReturnValue(af.usingItem.get(stack.getItem().toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
87
src/main/java/a/i.java
Normal file
87
src/main/java/a/i.java
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.QuadInstance;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.color.block.BlockTintSource;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.block.BlockStateModelSet;
|
||||||
|
import net.minecraft.client.renderer.block.dispatch.BlockStateModel;
|
||||||
|
import net.minecraft.client.renderer.block.dispatch.BlockStateModelPart;
|
||||||
|
import net.minecraft.client.renderer.rendertype.RenderType;
|
||||||
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
|
import net.minecraft.client.resources.model.geometry.BakedQuad;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.util.ARGB;
|
||||||
|
import net.minecraft.util.LightCoordsUtil;
|
||||||
|
import net.minecraft.util.RandomSource;
|
||||||
|
import net.minecraft.world.level.block.RenderShape;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
|
@Mixin(BlockStateModelSet.class)
|
||||||
|
public abstract class i implements v {
|
||||||
|
@Shadow
|
||||||
|
public abstract BlockStateModel get(BlockState var1);
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
@Override
|
||||||
|
public void renderSingleBlockWithEmission(
|
||||||
|
BlockState blockState, PoseStack poseStack, SubmitNodeCollector queue, int combinedLight, ClientLevel world, AbstractClientPlayer player
|
||||||
|
) {
|
||||||
|
RenderShape renderShape = blockState.getRenderShape();
|
||||||
|
if (renderShape != RenderShape.INVISIBLE) {
|
||||||
|
combinedLight = LightCoordsUtil.lightCoordsWithEmission(combinedLight, blockState.getLightEmission());
|
||||||
|
BlockStateModel blockStateModel = this.get(blockState);
|
||||||
|
BlockTintSource tintSource = Minecraft.getInstance().getBlockColors().getTintSource(blockState, 0);
|
||||||
|
int tint = tintSource != null ? tintSource.colorInWorld(blockState, world, player.blockPosition()) : -1;
|
||||||
|
float r = (tint >> 16 & 0xFF) / 255.0F;
|
||||||
|
float g = (tint >> 8 & 0xFF) / 255.0F;
|
||||||
|
float b = (tint & 0xFF) / 255.0F;
|
||||||
|
List<BlockStateModelPart> parts = new ArrayList<>();
|
||||||
|
blockStateModel.collectParts(RandomSource.create(42L), parts);
|
||||||
|
|
||||||
|
for (BlockStateModelPart blockModelPart : parts) {
|
||||||
|
for (Direction direction : Direction.values()) {
|
||||||
|
for (BakedQuad bakedQuad : blockModelPart.getQuads(direction)) {
|
||||||
|
this.hmi$renderBakedQuad(bakedQuad, poseStack, queue, r, g, b, combinedLight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BakedQuad bakedQuad : blockModelPart.getQuads(null)) {
|
||||||
|
this.hmi$renderBakedQuad(bakedQuad, poseStack, queue, r, g, b, combinedLight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void hmi$renderBakedQuad(BakedQuad bakedQuad, PoseStack poseStack, SubmitNodeCollector queue, float r, float g, float b, int combinedLight) {
|
||||||
|
if (bakedQuad.materialInfo().isTinted()) {
|
||||||
|
r = Math.clamp(r, 0.0F, 1.0F);
|
||||||
|
g = Math.clamp(g, 0.0F, 1.0F);
|
||||||
|
b = Math.clamp(b, 0.0F, 1.0F);
|
||||||
|
} else {
|
||||||
|
r = 1.0F;
|
||||||
|
g = 1.0F;
|
||||||
|
b = 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderType usedLayer = bakedQuad.materialInfo().itemRenderType();
|
||||||
|
int color = ARGB.colorFromFloat(1.0F, r, g, b);
|
||||||
|
queue.submitCustomGeometry(poseStack, usedLayer, (pose, consumer) -> {
|
||||||
|
QuadInstance quadInstance = new QuadInstance();
|
||||||
|
quadInstance.setColor(color);
|
||||||
|
quadInstance.setLightCoords(combinedLight);
|
||||||
|
quadInstance.setOverlayCoords(OverlayTexture.NO_OVERLAY);
|
||||||
|
consumer.putBakedQuad(pose, bakedQuad, quadInstance);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
52
src/main/java/a/j.java
Normal file
52
src/main/java/a/j.java
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
|
||||||
|
import net.minecraft.client.renderer.entity.FishingHookRenderer;
|
||||||
|
import net.minecraft.world.entity.HumanoidArm;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
import org.joml.Vector4f;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(FishingHookRenderer.class)
|
||||||
|
public abstract class j {
|
||||||
|
private EntityRenderDispatcher dispatcher = Minecraft.getInstance().getEntityRenderDispatcher();
|
||||||
|
float DEG_TO_RAD = (float) (Math.PI / 180.0);
|
||||||
|
|
||||||
|
@Inject(method = "getPlayerHandPos", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void getHandPos(Player player, float f, float tickProgress, CallbackInfoReturnable<Vec3> cir) {
|
||||||
|
float m = 960.0F / ((Integer)this.dispatcher.options.fov().get()).intValue();
|
||||||
|
int i = FishingHookRenderer.getHoldingArm(player) == HumanoidArm.RIGHT ? 1 : -1;
|
||||||
|
Matrix4f matrix = FishingHookRenderer.getHoldingArm(player) == HumanoidArm.RIGHT ? t.matricesMain : t.matricesOff;
|
||||||
|
matrix.translate(0.0F, 0.0F, 0.0F);
|
||||||
|
Vector4f tipPos = new Vector4f(0.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
tipPos.mul(matrix);
|
||||||
|
Vec3 worldPos = new Vec3(tipPos.x(), tipPos.y(), tipPos.z());
|
||||||
|
worldPos.scale(m);
|
||||||
|
if (this.dispatcher.options.getCameraType().isFirstPerson() && player == Minecraft.getInstance().player) {
|
||||||
|
Vec3 vec3d = this.dispatcher.camera.getNearPlane(tickProgress).getPointOnPlane(0.7F, 0.0F).scale(m).add(worldPos);
|
||||||
|
cir.setReturnValue(this.dispatcher.camera.position().add(vec3d));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getHandPose(Player player, float f, float tickProgress, CallbackInfoReturnable<Vec3> cir) {
|
||||||
|
float m = 960.0F / ((Integer)this.dispatcher.options.fov().get()).intValue();
|
||||||
|
int i = FishingHookRenderer.getHoldingArm(player) == HumanoidArm.RIGHT ? 1 : -1;
|
||||||
|
Matrix4f matrix = FishingHookRenderer.getHoldingArm(player) == HumanoidArm.RIGHT ? t.matricesMain : t.matricesOff;
|
||||||
|
matrix.translate(0.0F, 0.0F, 0.0F);
|
||||||
|
Vector4f tipPos = new Vector4f(0.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
tipPos.mul(matrix);
|
||||||
|
Vec3 worldPos = new Vec3(tipPos.x(), tipPos.y(), tipPos.z());
|
||||||
|
worldPos.scale(m);
|
||||||
|
if (this.dispatcher.options.getCameraType().isFirstPerson() && player == Minecraft.getInstance().player) {
|
||||||
|
Vec3 vec3d = this.dispatcher.camera.getNearPlane(tickProgress).getPointOnPlane(0.7F, 0.0F).scale(m).add(worldPos);
|
||||||
|
cir.setReturnValue(this.dispatcher.camera.position().add(vec3d));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/main/java/a/k.java
Normal file
27
src/main/java/a/k.java
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Mutable;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(targets = "net/minecraft/client/renderer/ItemInHandRenderer$HandRenderSelection")
|
||||||
|
public abstract class k {
|
||||||
|
@Shadow
|
||||||
|
@Mutable
|
||||||
|
private boolean renderMainHand;
|
||||||
|
@Shadow
|
||||||
|
@Mutable
|
||||||
|
private boolean renderOffHand;
|
||||||
|
|
||||||
|
@Inject(method = "<init>", at = @At("RETURN"))
|
||||||
|
private void makeBothHandsRenderTrue(String string, int i, boolean renderMainHand, boolean renderOffHand, CallbackInfo ci) {
|
||||||
|
if (ve.active()) {
|
||||||
|
this.renderMainHand = true;
|
||||||
|
this.renderOffHand = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
739
src/main/java/a/l.java
Normal file
739
src/main/java/a/l.java
Normal file
|
|
@ -0,0 +1,739 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.math.Axis;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.script.ScriptException;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.ItemInHandRenderer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.blockentity.state.BellRenderState;
|
||||||
|
import net.minecraft.client.renderer.state.level.CameraRenderState;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.component.DataComponents;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.tags.BlockTags;
|
||||||
|
import net.minecraft.tags.ItemTags;
|
||||||
|
import net.minecraft.util.LightCoordsUtil;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.entity.HumanoidArm;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.item.CrossbowItem;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.item.ItemDisplayContext;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.ItemUseAnimation;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.component.CustomData;
|
||||||
|
import net.minecraft.world.item.component.CustomModelData;
|
||||||
|
import net.minecraft.world.item.enchantment.ItemEnchantments;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraft.world.level.block.LanternBlock;
|
||||||
|
import net.minecraft.world.level.block.entity.BellBlockEntity;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.block.state.properties.AttachFace;
|
||||||
|
import net.minecraft.world.level.block.state.properties.BellAttachType;
|
||||||
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
|
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(ItemInHandRenderer.class)
|
||||||
|
public abstract class l {
|
||||||
|
@Unique
|
||||||
|
boolean mainHandSwitchEvent = false;
|
||||||
|
@Unique
|
||||||
|
boolean offHandSwitchEvent = false;
|
||||||
|
@Unique
|
||||||
|
Item prevMainHand = Items.AIR;
|
||||||
|
@Unique
|
||||||
|
Item prevOffHand = Items.AIR;
|
||||||
|
@Unique
|
||||||
|
private final ArrayList<az> particles = new ArrayList<>();
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Minecraft minecraft;
|
||||||
|
@Shadow
|
||||||
|
private ItemStack mainHandItem;
|
||||||
|
@Shadow
|
||||||
|
private ItemStack offHandItem;
|
||||||
|
@Unique
|
||||||
|
private boolean swingMHand = false;
|
||||||
|
@Unique
|
||||||
|
private boolean swingOHand = false;
|
||||||
|
@Unique
|
||||||
|
private float mainHandSwingProgress = 0.0F;
|
||||||
|
@Unique
|
||||||
|
private float offHandSwingProgress = 0.0F;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract void renderPlayerArm(PoseStack var1, SubmitNodeCollector var2, int var3, float var4, float var5, HumanoidArm var6);
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract void submitArmWithItem(
|
||||||
|
AbstractClientPlayer var1,
|
||||||
|
float var2,
|
||||||
|
float var3,
|
||||||
|
InteractionHand var4,
|
||||||
|
float var5,
|
||||||
|
ItemStack var6,
|
||||||
|
float var7,
|
||||||
|
PoseStack var8,
|
||||||
|
SubmitNodeCollector var9,
|
||||||
|
int var10
|
||||||
|
);
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract void renderMap(PoseStack var1, SubmitNodeCollector var2, int var3, ItemStack var4);
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract void renderItem(LivingEntity var1, ItemStack var2, ItemDisplayContext var3, PoseStack var4, SubmitNodeCollector var5, int var6);
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void copyAppearanceComponents(ItemStack source, ItemStack target) {
|
||||||
|
if (source.has(DataComponents.ENCHANTMENTS)) {
|
||||||
|
target.set(DataComponents.ENCHANTMENTS, (ItemEnchantments)source.get(DataComponents.ENCHANTMENTS));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source.has(DataComponents.ITEM_MODEL)) {
|
||||||
|
target.set(DataComponents.ITEM_MODEL, (Identifier)source.get(DataComponents.ITEM_MODEL));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source.has(DataComponents.CUSTOM_MODEL_DATA)) {
|
||||||
|
target.set(DataComponents.CUSTOM_MODEL_DATA, (CustomModelData)source.get(DataComponents.CUSTOM_MODEL_DATA));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source.has(DataComponents.CUSTOM_DATA)) {
|
||||||
|
target.set(DataComponents.CUSTOM_DATA, (CustomData)source.get(DataComponents.CUSTOM_DATA));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void applyArmMatrices(PoseStack matrices, int light, float equipProgress, float swingProgress, HumanoidArm arm) {
|
||||||
|
boolean bl = arm != HumanoidArm.LEFT;
|
||||||
|
float f = bl ? 1.0F : -1.0F;
|
||||||
|
float g = Mth.sqrt(swingProgress);
|
||||||
|
float h = -0.3F * Mth.sin(g * (float) Math.PI);
|
||||||
|
float i = 0.4F * Mth.sin(g * (float) (Math.PI * 2));
|
||||||
|
float j = -0.4F * Mth.sin(swingProgress * (float) Math.PI);
|
||||||
|
matrices.translate(f * (h + 0.64000005F), i + -0.6F + equipProgress * -0.6F, j + -0.71999997F);
|
||||||
|
matrices.mulPose(Axis.YP.rotationDegrees(f * 45.0F));
|
||||||
|
float k = Mth.sin(swingProgress * swingProgress * (float) Math.PI);
|
||||||
|
float l = Mth.sin(g * (float) Math.PI);
|
||||||
|
matrices.mulPose(Axis.YP.rotationDegrees(f * l * 70.0F));
|
||||||
|
matrices.mulPose(Axis.ZP.rotationDegrees(f * k * -20.0F));
|
||||||
|
AbstractClientPlayer abstractClientPlayerEntity = this.minecraft.player;
|
||||||
|
matrices.translate(f * -1.0F, 3.6F, 3.5F);
|
||||||
|
matrices.mulPose(Axis.ZP.rotationDegrees(f * 120.0F));
|
||||||
|
matrices.mulPose(Axis.XP.rotationDegrees(200.0F));
|
||||||
|
matrices.mulPose(Axis.YP.rotationDegrees(f * -135.0F));
|
||||||
|
matrices.translate(f * 5.6F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void itemPose(
|
||||||
|
PoseStack matrices,
|
||||||
|
ItemStack item,
|
||||||
|
boolean bl,
|
||||||
|
float swingProgress,
|
||||||
|
AbstractClientPlayer player,
|
||||||
|
boolean mainHand,
|
||||||
|
InteractionHand hand,
|
||||||
|
float equipProgress,
|
||||||
|
float mainHandSwingProgress,
|
||||||
|
float offHandSwingProgress,
|
||||||
|
boolean mainHandSwitchEvent,
|
||||||
|
boolean offHandSwitchEvent,
|
||||||
|
boolean swingMHand,
|
||||||
|
boolean swingOHand,
|
||||||
|
boolean interact,
|
||||||
|
boolean blockBreaking,
|
||||||
|
List<az> particles
|
||||||
|
) throws ScriptException, NoSuchMethodException {
|
||||||
|
int l = bl ? 1 : -1;
|
||||||
|
matrices.translate(0.5 * l, -0.15, -0.85);
|
||||||
|
matrices.rotateAround(Axis.XP.rotationDegrees(15.0F), 0.5F, 0.5F, 0.5F);
|
||||||
|
matrices.scale(0.9F, 0.9F, 0.9F);
|
||||||
|
am.itemScriptCache
|
||||||
|
.execute(
|
||||||
|
matrices,
|
||||||
|
bl,
|
||||||
|
af.registry,
|
||||||
|
swingProgress,
|
||||||
|
item,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
mainHand,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
mainHandSwingProgress,
|
||||||
|
offHandSwingProgress,
|
||||||
|
mainHandSwitchEvent,
|
||||||
|
offHandSwitchEvent,
|
||||||
|
swingMHand,
|
||||||
|
swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
particles
|
||||||
|
);
|
||||||
|
|
||||||
|
for (aj scriptCache : am.itemAddonsCache) {
|
||||||
|
scriptCache.execute(
|
||||||
|
matrices,
|
||||||
|
bl,
|
||||||
|
af.registry,
|
||||||
|
swingProgress,
|
||||||
|
item,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
mainHand,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
mainHandSwingProgress,
|
||||||
|
offHandSwingProgress,
|
||||||
|
mainHandSwitchEvent,
|
||||||
|
offHandSwitchEvent,
|
||||||
|
swingMHand,
|
||||||
|
swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
particles
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void mainHandPose(
|
||||||
|
PoseStack matrices,
|
||||||
|
ItemStack item,
|
||||||
|
boolean bl,
|
||||||
|
float swingProgress,
|
||||||
|
float equipProgress,
|
||||||
|
AbstractClientPlayer player,
|
||||||
|
boolean mainHand,
|
||||||
|
InteractionHand hand,
|
||||||
|
float mainHandSwingProgress,
|
||||||
|
float offHandSwingProgress,
|
||||||
|
boolean mainHandSwitchEvent,
|
||||||
|
boolean offHandSwitchEvent,
|
||||||
|
boolean swingMHand,
|
||||||
|
boolean swingOHand,
|
||||||
|
boolean interact,
|
||||||
|
boolean blockBreaking,
|
||||||
|
List<az> particles
|
||||||
|
) throws ScriptException, NoSuchMethodException {
|
||||||
|
int l = bl ? 1 : -1;
|
||||||
|
am.handRelativeScriptCache
|
||||||
|
.execute(
|
||||||
|
matrices,
|
||||||
|
bl,
|
||||||
|
af.registry,
|
||||||
|
swingProgress,
|
||||||
|
item,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
mainHand,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
mainHandSwingProgress,
|
||||||
|
offHandSwingProgress,
|
||||||
|
mainHandSwitchEvent,
|
||||||
|
offHandSwitchEvent,
|
||||||
|
swingMHand,
|
||||||
|
swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
particles
|
||||||
|
);
|
||||||
|
|
||||||
|
for (aj scriptCache : am.handRelativeAddonsCache) {
|
||||||
|
scriptCache.execute(
|
||||||
|
matrices,
|
||||||
|
bl,
|
||||||
|
af.registry,
|
||||||
|
swingProgress,
|
||||||
|
item,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
mainHand,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
mainHandSwingProgress,
|
||||||
|
offHandSwingProgress,
|
||||||
|
mainHandSwitchEvent,
|
||||||
|
offHandSwitchEvent,
|
||||||
|
swingMHand,
|
||||||
|
swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
particles
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item.isEmpty()) {
|
||||||
|
matrices.translate(1.5 * l, -0.3, -0.6);
|
||||||
|
matrices.rotateAround(Axis.XP.rotationDegrees(15.0F), 0.5F * l, 0.5F, 0.5F);
|
||||||
|
matrices.rotateAround(Axis.YP.rotationDegrees(35 * l), 0.5F * l, 0.5F, 0.5F);
|
||||||
|
matrices.rotateAround(Axis.ZP.rotationDegrees(-65 * l), 0.5F * l, 0.5F, 0.5F);
|
||||||
|
matrices.scale(0.9F, 0.9F, 0.9F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void scenePoseMain(
|
||||||
|
PoseStack matrices,
|
||||||
|
ItemStack item,
|
||||||
|
boolean bl,
|
||||||
|
float swingProgress,
|
||||||
|
float equipProgress,
|
||||||
|
AbstractClientPlayer player,
|
||||||
|
boolean mainHand,
|
||||||
|
InteractionHand hand,
|
||||||
|
float mainHandSwingProgress,
|
||||||
|
float offHandSwingProgress,
|
||||||
|
boolean mainHandSwitchEvent,
|
||||||
|
boolean offHandSwitchEvent,
|
||||||
|
boolean swingMHand,
|
||||||
|
boolean swingOHand,
|
||||||
|
boolean interact,
|
||||||
|
boolean blockBreaking,
|
||||||
|
List<az> particles
|
||||||
|
) throws ScriptException, NoSuchMethodException {
|
||||||
|
am.handScriptCache
|
||||||
|
.execute(
|
||||||
|
matrices,
|
||||||
|
bl,
|
||||||
|
af.registry,
|
||||||
|
swingProgress,
|
||||||
|
item,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
mainHand,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
mainHandSwingProgress,
|
||||||
|
offHandSwingProgress,
|
||||||
|
mainHandSwitchEvent,
|
||||||
|
offHandSwitchEvent,
|
||||||
|
swingMHand,
|
||||||
|
swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
particles
|
||||||
|
);
|
||||||
|
|
||||||
|
for (aj scriptCache : am.handAddonsCache) {
|
||||||
|
scriptCache.execute(
|
||||||
|
matrices,
|
||||||
|
bl,
|
||||||
|
af.registry,
|
||||||
|
swingProgress,
|
||||||
|
item,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
mainHand,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
mainHandSwingProgress,
|
||||||
|
offHandSwingProgress,
|
||||||
|
mainHandSwitchEvent,
|
||||||
|
offHandSwitchEvent,
|
||||||
|
swingMHand,
|
||||||
|
swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
particles
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item.isEmpty()) {
|
||||||
|
matrices.translate(0.0, -0.35, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "submitHandsWithItems(FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/player/LocalPlayer;I)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/ItemInHandRenderer;submitArmWithItem(Lnet/minecraft/client/player/AbstractClientPlayer;FFLnet/minecraft/world/InteractionHand;FLnet/minecraft/world/item/ItemStack;FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;I)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void renderOverhaul(
|
||||||
|
ItemInHandRenderer instance,
|
||||||
|
AbstractClientPlayer player,
|
||||||
|
float tickProgress,
|
||||||
|
float pitch,
|
||||||
|
InteractionHand hand,
|
||||||
|
float swingProgress,
|
||||||
|
ItemStack item,
|
||||||
|
float equipProgress,
|
||||||
|
PoseStack matrices,
|
||||||
|
SubmitNodeCollector orderedRenderCommandQueue,
|
||||||
|
int light
|
||||||
|
) throws ScriptException, NoSuchMethodException {
|
||||||
|
if (ve.active() && !sz.rendersFirstPerson(item) && !sz.attachesHandItem(player, hand, item)) {
|
||||||
|
if (!player.isScoping()) {
|
||||||
|
((x)item).hMI5_0$setTransform(-1);
|
||||||
|
boolean bl = hand == InteractionHand.MAIN_HAND;
|
||||||
|
boolean interact = false;
|
||||||
|
boolean blockBreaking = false;
|
||||||
|
if (bl
|
||||||
|
&& player.isUsingItem()
|
||||||
|
&& player.getUsedItemHand() != hand
|
||||||
|
&& (
|
||||||
|
player.getOffhandItem().getUseAnimation() == ItemUseAnimation.BOW
|
||||||
|
|| player.getOffhandItem().getUseAnimation() == ItemUseAnimation.BOW
|
||||||
|
|| player.getOffhandItem().getUseAnimation() == ItemUseAnimation.CROSSBOW && !CrossbowItem.isCharged(player.getOffhandItem())
|
||||||
|
)) {
|
||||||
|
item = Items.AIR.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bl
|
||||||
|
&& player.isUsingItem()
|
||||||
|
&& player.getUsedItemHand() != hand
|
||||||
|
&& (
|
||||||
|
player.getMainHandItem().getUseAnimation() == ItemUseAnimation.BOW
|
||||||
|
|| player.getMainHandItem().getUseAnimation() == ItemUseAnimation.CROSSBOW && !CrossbowItem.isCharged(player.getMainHandItem())
|
||||||
|
)) {
|
||||||
|
item = Items.AIR.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bl) {
|
||||||
|
this.mainHandSwitchEvent = item.getItem() != this.prevMainHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bl) {
|
||||||
|
this.offHandSwitchEvent = item.getItem() != this.prevOffHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.pushPose();
|
||||||
|
if (player instanceof y accessor) {
|
||||||
|
float mainHandProgress = accessor.hMI5_0$getMainHandSwingProgress(tickProgress);
|
||||||
|
this.mainHandSwingProgress = mainHandProgress;
|
||||||
|
float offHandProgress = accessor.hMI5_0$getOffHandSwingProgress(tickProgress);
|
||||||
|
this.offHandSwingProgress = offHandProgress;
|
||||||
|
swingProgress = bl ? mainHandProgress : offHandProgress;
|
||||||
|
this.swingMHand = accessor.hMI5_0$getMHandEvent();
|
||||||
|
this.swingOHand = accessor.hMI5_0$getOHandEvent();
|
||||||
|
if (bl) {
|
||||||
|
interact = accessor.hMI5_0$getMInteract();
|
||||||
|
} else {
|
||||||
|
interact = accessor.hMI5_0$getOInteract();
|
||||||
|
}
|
||||||
|
|
||||||
|
blockBreaking = accessor.hMI5_0$getBlockBreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
HumanoidArm arm = bl ? player.getMainArm() : player.getMainArm().getOpposite();
|
||||||
|
boolean bl2 = arm == HumanoidArm.RIGHT;
|
||||||
|
int l = bl2 ? 1 : -1;
|
||||||
|
this.scenePoseMain(
|
||||||
|
matrices,
|
||||||
|
item,
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
equipProgress,
|
||||||
|
player,
|
||||||
|
bl,
|
||||||
|
hand,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
this.particles
|
||||||
|
);
|
||||||
|
matrices.pushPose();
|
||||||
|
this.mainHandPose(
|
||||||
|
matrices,
|
||||||
|
item,
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
equipProgress,
|
||||||
|
player,
|
||||||
|
bl,
|
||||||
|
hand,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
this.particles
|
||||||
|
);
|
||||||
|
int combinedLight = LightCoordsUtil.lightCoordsWithEmission(light, Block.byItem(item.getItem()).defaultBlockState().getLightEmission());
|
||||||
|
if (player.isInvisible()) {
|
||||||
|
this.applyArmMatrices(matrices, combinedLight, 0.0F, 0.0F, arm);
|
||||||
|
} else {
|
||||||
|
this.renderPlayerArm(matrices, orderedRenderCommandQueue, combinedLight, 0.0F, 0.0F, arm);
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.popPose();
|
||||||
|
matrices.pushPose();
|
||||||
|
if (Block.byItem(item.getItem()) != Blocks.AIR
|
||||||
|
&& !Block.byItem(item.getItem()).defaultBlockState().is(BlockTags.INSIDE_STEP_SOUND_BLOCKS)
|
||||||
|
&& !Block.byItem(item.getItem()).defaultBlockState().is(BlockTags.CROPS)
|
||||||
|
&& item.getUseAnimation() != ItemUseAnimation.EAT
|
||||||
|
&& !item.is(Items.REDSTONE)
|
||||||
|
&& !item.is(ItemTags.BANNERS)
|
||||||
|
&& !item.is(ItemTags.SKULLS)
|
||||||
|
&& af.renderAsBlock.getOrDefault(item.getItem().toString(), true)) {
|
||||||
|
swingProgress = 0.0F;
|
||||||
|
BlockState blockState = Block.byItem(item.getItem()).defaultBlockState();
|
||||||
|
this.itemPose(
|
||||||
|
matrices,
|
||||||
|
item,
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
player,
|
||||||
|
bl,
|
||||||
|
hand,
|
||||||
|
equipProgress,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
this.particles
|
||||||
|
);
|
||||||
|
matrices.translate(0.22 * l, 0.25, 0.2);
|
||||||
|
if (item.is(Items.LEVER) || blockState.is(BlockTags.BUTTONS)) {
|
||||||
|
blockState = (BlockState)blockState.setValue(BlockStateProperties.ATTACH_FACE, AttachFace.FLOOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item.getHoverName().toString().toLowerCase().contains("torch")
|
||||||
|
&& !(Block.byItem(item.getItem()) instanceof LanternBlock)
|
||||||
|
&& !blockState.is(BlockTags.ALL_HANGING_SIGNS)) {
|
||||||
|
matrices.translate(-0.25 * l, -0.05, 0.0);
|
||||||
|
} else {
|
||||||
|
matrices.translate(-0.05 * l, 0.0, 0.0);
|
||||||
|
matrices.scale(1.75F, 1.75F, 1.75F);
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.pushPose();
|
||||||
|
matrices.scale(0.3F, 0.3F, 0.3F);
|
||||||
|
matrices.translate(-0.9 * l, -0.45, -0.7);
|
||||||
|
matrices.popPose();
|
||||||
|
if (!bl2) {
|
||||||
|
matrices.translate(-0.3F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.scale(0.3F, 0.3F, 0.3F);
|
||||||
|
matrices.translate(-0.9 * l, -0.45, -0.7);
|
||||||
|
if (item.is(Items.BELL)) {
|
||||||
|
BellBlockEntity bellBlockEntity = new BellBlockEntity(BlockPos.ZERO, Blocks.BELL.defaultBlockState());
|
||||||
|
BellRenderState state = new BellRenderState();
|
||||||
|
state.lightCoords = light;
|
||||||
|
this.minecraft
|
||||||
|
.getBlockEntityRenderDispatcher()
|
||||||
|
.getRenderer(bellBlockEntity)
|
||||||
|
.submit(state, matrices, orderedRenderCommandQueue, new CameraRenderState());
|
||||||
|
((v)this.minecraft.getModelManager().getBlockStateModelSet())
|
||||||
|
.renderSingleBlockWithEmission(
|
||||||
|
(BlockState)Blocks.BELL.defaultBlockState().setValue(BlockStateProperties.BELL_ATTACHMENT, BellAttachType.CEILING),
|
||||||
|
matrices,
|
||||||
|
orderedRenderCommandQueue,
|
||||||
|
light,
|
||||||
|
this.minecraft.level,
|
||||||
|
player
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (blockState.hasProperty(BlockStateProperties.DOUBLE_BLOCK_HALF)) {
|
||||||
|
matrices.pushPose();
|
||||||
|
matrices.translate(0.0F, 1.0F, 0.0F);
|
||||||
|
((v)this.minecraft.getModelManager().getBlockStateModelSet())
|
||||||
|
.renderSingleBlockWithEmission(
|
||||||
|
(BlockState)blockState.setValue(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.UPPER),
|
||||||
|
matrices,
|
||||||
|
orderedRenderCommandQueue,
|
||||||
|
light,
|
||||||
|
this.minecraft.level,
|
||||||
|
player
|
||||||
|
);
|
||||||
|
matrices.popPose();
|
||||||
|
}
|
||||||
|
|
||||||
|
((v)this.minecraft.getModelManager().getBlockStateModelSet())
|
||||||
|
.renderSingleBlockWithEmission(blockState, matrices, orderedRenderCommandQueue, light, this.minecraft.level, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.pushPose();
|
||||||
|
if (!bl2) {
|
||||||
|
matrices.translate(1.0F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
bb.draw(this.particles, matrices, orderedRenderCommandQueue, "ITEM", hand, light, player, tickProgress);
|
||||||
|
matrices.popPose();
|
||||||
|
} else if (item.getUseAnimation() != ItemUseAnimation.BLOCK
|
||||||
|
&& item.getUseAnimation() != ItemUseAnimation.BRUSH
|
||||||
|
&& item.getUseAnimation() != ItemUseAnimation.TRIDENT) {
|
||||||
|
this.itemPose(
|
||||||
|
matrices,
|
||||||
|
item,
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
player,
|
||||||
|
bl,
|
||||||
|
hand,
|
||||||
|
equipProgress,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
this.particles
|
||||||
|
);
|
||||||
|
if (item.has(DataComponents.MAP_ID)) {
|
||||||
|
matrices.pushPose();
|
||||||
|
matrices.translate(-0.05 * l, 0.2, 0.1);
|
||||||
|
matrices.mulPose(Axis.YP.rotationDegrees(-12 * l));
|
||||||
|
this.renderMap(matrices, orderedRenderCommandQueue, light, item);
|
||||||
|
matrices.popPose();
|
||||||
|
} else {
|
||||||
|
ItemStack renderStack = bl ? af.mainHandItem : af.offHandItem;
|
||||||
|
if (renderStack.is(Items.AIR)) {
|
||||||
|
renderStack = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
ae.setItem(item);
|
||||||
|
ai.addData(
|
||||||
|
new ah(
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
bl,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
item
|
||||||
|
),
|
||||||
|
item
|
||||||
|
);
|
||||||
|
this.renderItem(
|
||||||
|
player,
|
||||||
|
renderStack,
|
||||||
|
bl2 ? ItemDisplayContext.THIRD_PERSON_RIGHT_HAND : ItemDisplayContext.THIRD_PERSON_LEFT_HAND,
|
||||||
|
matrices,
|
||||||
|
orderedRenderCommandQueue,
|
||||||
|
light
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bl2) {
|
||||||
|
t.matricesMain.set(matrices.last().pose());
|
||||||
|
} else {
|
||||||
|
t.matricesOff.set(matrices.last().pose());
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.pushPose();
|
||||||
|
bb.draw(this.particles, matrices, orderedRenderCommandQueue, "ITEM", hand, light, player, tickProgress);
|
||||||
|
matrices.popPose();
|
||||||
|
} else {
|
||||||
|
this.itemPose(
|
||||||
|
matrices,
|
||||||
|
item,
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
player,
|
||||||
|
bl,
|
||||||
|
hand,
|
||||||
|
equipProgress,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
this.particles
|
||||||
|
);
|
||||||
|
ItemStack renderStack = new ItemStack(item.getItem(), item.getCount());
|
||||||
|
this.copyAppearanceComponents(item, renderStack);
|
||||||
|
ItemStack renderStack2 = bl ? af.mainHandItem : af.offHandItem;
|
||||||
|
if (!renderStack2.is(Items.AIR)) {
|
||||||
|
renderStack = renderStack2;
|
||||||
|
}
|
||||||
|
|
||||||
|
ae.setItem(item);
|
||||||
|
ai.addData(
|
||||||
|
new ah(
|
||||||
|
bl2,
|
||||||
|
swingProgress,
|
||||||
|
player,
|
||||||
|
hand,
|
||||||
|
bl,
|
||||||
|
t.deltaTime,
|
||||||
|
equipProgress,
|
||||||
|
this.mainHandSwingProgress,
|
||||||
|
this.offHandSwingProgress,
|
||||||
|
this.mainHandSwitchEvent,
|
||||||
|
this.offHandSwitchEvent,
|
||||||
|
this.swingMHand,
|
||||||
|
this.swingOHand,
|
||||||
|
interact,
|
||||||
|
blockBreaking,
|
||||||
|
item
|
||||||
|
),
|
||||||
|
item
|
||||||
|
);
|
||||||
|
this.renderItem(
|
||||||
|
player,
|
||||||
|
renderStack,
|
||||||
|
bl2 ? ItemDisplayContext.THIRD_PERSON_RIGHT_HAND : ItemDisplayContext.THIRD_PERSON_LEFT_HAND,
|
||||||
|
matrices,
|
||||||
|
orderedRenderCommandQueue,
|
||||||
|
light
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.popPose();
|
||||||
|
matrices.popPose();
|
||||||
|
if (bl) {
|
||||||
|
this.prevMainHand = item.getItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bl) {
|
||||||
|
this.prevOffHand = item.getItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.pushPose();
|
||||||
|
bb.draw(this.particles, matrices, orderedRenderCommandQueue, "SCREEN", hand, light, player, tickProgress);
|
||||||
|
matrices.popPose();
|
||||||
|
t.tickProgress = tickProgress;
|
||||||
|
af.offHandItem = Items.AIR.getDefaultInstance();
|
||||||
|
af.mainHandItem = Items.AIR.getDefaultInstance();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.submitArmWithItem(player, tickProgress, pitch, hand, swingProgress, item, equipProgress, matrices, orderedRenderCommandQueue, light);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/main/java/a/m.java
Normal file
32
src/main/java/a/m.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.DeltaTracker;
|
||||||
|
import net.minecraft.client.gui.Font;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.Hud;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Hud.class)
|
||||||
|
public abstract class m {
|
||||||
|
@Shadow
|
||||||
|
public abstract Font getFont();
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderState", at = @At("HEAD"))
|
||||||
|
private void debugText(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
if (!af.debugTextRenderer.get().isEmpty()) {
|
||||||
|
int y = 10;
|
||||||
|
|
||||||
|
for (String s : af.debugTextRenderer.get()) {
|
||||||
|
context.centeredText(this.getFont(), s, 10, y, 255);
|
||||||
|
y += 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
af.debugTextRenderer.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/main/java/a/n.java
Normal file
17
src/main/java/a/n.java
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.feature.FeatureRenderDispatcher;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(FeatureRenderDispatcher.class)
|
||||||
|
public class n {
|
||||||
|
@Inject(method = "renderAllFeatures", at = @At("TAIL"))
|
||||||
|
private void tester(CallbackInfo ci) {
|
||||||
|
ae.clear();
|
||||||
|
ai.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
72
src/main/java/a/o.java
Normal file
72
src/main/java/a/o.java
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.QuadInstance;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack.Pose;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.feature.ItemFeatureRenderer;
|
||||||
|
import net.minecraft.client.renderer.feature.ItemFeatureRenderer.Submit;
|
||||||
|
import net.minecraft.client.renderer.rendertype.RenderType;
|
||||||
|
import net.minecraft.client.resources.model.geometry.BakedQuad;
|
||||||
|
import net.minecraft.client.resources.model.geometry.BakedQuad.MaterialInfo;
|
||||||
|
import net.minecraft.world.item.ItemDisplayContext;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ItemFeatureRenderer.class)
|
||||||
|
public abstract class o {
|
||||||
|
@Unique
|
||||||
|
private static int hmi$getTint(int[] tints, int index) {
|
||||||
|
return index >= 0 && index < tints.length ? tints[index] : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "prepareMainSubmit", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void hmi$prepareMainSubmit(Submit submit, CallbackInfo ci) {
|
||||||
|
if (ve.active()) {
|
||||||
|
Minecraft minecraft = Minecraft.getInstance();
|
||||||
|
AbstractClientPlayer player = minecraft.player;
|
||||||
|
ItemDisplayContext displayContext = submit.displayContext();
|
||||||
|
boolean handContext = (displayContext == ItemDisplayContext.THIRD_PERSON_LEFT_HAND || displayContext == ItemDisplayContext.THIRD_PERSON_RIGHT_HAND)
|
||||||
|
&& player != null
|
||||||
|
&& minecraft.getEntityRenderDispatcher().options.getCameraType().isFirstPerson();
|
||||||
|
if (handContext) {
|
||||||
|
ah context = ai.get();
|
||||||
|
ItemStack renderedItem = ae.getRenderedItem();
|
||||||
|
am.itemModelCache.executeModel(context, renderedItem, player, af.modelPartAnimator);
|
||||||
|
|
||||||
|
for (al cache : am.itemModelAddonsCache) {
|
||||||
|
cache.executeModel(context, renderedItem, player, af.modelPartAnimator);
|
||||||
|
}
|
||||||
|
|
||||||
|
Pose basePose = submit.pose();
|
||||||
|
QuadInstance quadInstance = new QuadInstance();
|
||||||
|
quadInstance.setLightCoords(submit.lightCoords());
|
||||||
|
quadInstance.setOverlayCoords(submit.overlayCoords());
|
||||||
|
PoseStack posed = new PoseStack();
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
for (BakedQuad quad : submit.quads()) {
|
||||||
|
MaterialInfo material = quad.materialInfo();
|
||||||
|
RenderType renderType = material.itemRenderType();
|
||||||
|
quadInstance.setColor(material.isTinted() ? hmi$getTint(submit.tintLayers(), material.tintIndex()) : -1);
|
||||||
|
posed.pushPose();
|
||||||
|
posed.last().set(basePose);
|
||||||
|
af.modelPartAnimator.applyPoses(index, posed);
|
||||||
|
Pose pose = posed.last();
|
||||||
|
((b.l)this).evo$getVertexBuilder(renderType).putBakedQuad(pose, quad, quadInstance);
|
||||||
|
posed.popPose();
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
af.modelPartAnimator.clear();
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
src/main/java/a/p.java
Normal file
34
src/main/java/a/p.java
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
package a;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.luaj.vm2.LuaValue;
|
||||||
|
import org.luaj.vm2.Varargs;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(targets = "org/luaj/vm2/lib/jse/JavaMethod", remap = false)
|
||||||
|
public class p {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Method method;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private static Map methods;
|
||||||
|
|
||||||
|
@Inject(method = "invokeMethod", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void isSafe(Object par1, Varargs par2, CallbackInfoReturnable<LuaValue> cir) {
|
||||||
|
if (!this.method.isAnnotationPresent(ab.class) && !this.method.getName().equals("getOrDefault") && !this.method.getName().equals("put")) {
|
||||||
|
cir.setReturnValue(LuaValue.NIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
System.out.println("HMI Lua safety layer loaded!");
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/main/java/b/a.java
Normal file
12
src/main/java/b/a.java
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(BufferBuilder.class)
|
||||||
|
public interface a {
|
||||||
|
@Accessor("vertices")
|
||||||
|
int evo$getVertices();
|
||||||
|
}
|
||||||
18
src/main/java/b/aa.java
Normal file
18
src/main/java/b/aa.java
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
|
||||||
|
@Mixin(Gui.class)
|
||||||
|
public abstract class aa {
|
||||||
|
@ModifyVariable(method = "setScreen(Lnet/minecraft/client/gui/screens/Screen;)V", at = @At("HEAD"), argsOnly = true)
|
||||||
|
private Screen evo$modifySetScreenArg(Screen original) {
|
||||||
|
eu event = new eu(original);
|
||||||
|
defpackage.j.call(event);
|
||||||
|
return event.getScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
28
src/main/java/b/ab.java
Normal file
28
src/main/java/b/ab.java
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
|
import net.minecraft.world.inventory.Slot;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(AbstractContainerScreen.class)
|
||||||
|
public abstract class ab {
|
||||||
|
@Shadow
|
||||||
|
protected int imageWidth;
|
||||||
|
@Shadow
|
||||||
|
protected int imageHeight;
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
protected Slot hoveredSlot;
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderState", at = @At("RETURN"))
|
||||||
|
public void render(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
defpackage.j.call(new fq(context, this.hoveredSlot, this.imageWidth, this.imageHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
66
src/main/java/b/ac.java
Normal file
66
src/main/java/b/ac.java
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Options;
|
||||||
|
import net.minecraft.client.player.ClientInput;
|
||||||
|
import net.minecraft.client.player.KeyboardInput;
|
||||||
|
import net.minecraft.world.entity.player.Input;
|
||||||
|
import net.minecraft.world.phys.Vec2;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(KeyboardInput.class)
|
||||||
|
public abstract class ac extends ClientInput {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Options options;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private float abobaGetMovementMultiplier(boolean positive, boolean negative) {
|
||||||
|
if (positive == negative) {
|
||||||
|
return 0.0F;
|
||||||
|
} else {
|
||||||
|
return positive ? 1.0F : -1.0F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "tick",
|
||||||
|
at = @At(
|
||||||
|
value = "FIELD",
|
||||||
|
target = "Lnet/minecraft/client/player/KeyboardInput;keyPresses:Lnet/minecraft/world/entity/player/Input;",
|
||||||
|
ordinal = 0,
|
||||||
|
shift = Shift.AFTER
|
||||||
|
),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
public void injectInputEvent(CallbackInfo ci) {
|
||||||
|
fh event = new fh(
|
||||||
|
this.keyPresses,
|
||||||
|
this.abobaGetMovementMultiplier(this.keyPresses.forward(), this.keyPresses.backward()),
|
||||||
|
this.abobaGetMovementMultiplier(this.keyPresses.left(), this.keyPresses.right())
|
||||||
|
);
|
||||||
|
defpackage.j.call(event);
|
||||||
|
if (!event.isCancelled()) {
|
||||||
|
float forward = event.getForward();
|
||||||
|
float strafe = event.getStrafe();
|
||||||
|
this.moveVector = new Vec2(strafe, forward).normalized();
|
||||||
|
this.keyPresses = new Input(
|
||||||
|
forward > 0.0F,
|
||||||
|
forward < 0.0F,
|
||||||
|
strafe > 0.0F,
|
||||||
|
strafe < 0.0F,
|
||||||
|
this.options.keyJump.isDown(),
|
||||||
|
this.options.keyShift.isDown(),
|
||||||
|
this.options.keySprint.isDown() || td.INSTANCE.holdsSprint()
|
||||||
|
);
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
src/main/java/b/ad.java
Normal file
20
src/main/java/b/ad.java
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.KeyboardHandler;
|
||||||
|
import net.minecraft.client.input.KeyEvent;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(KeyboardHandler.class)
|
||||||
|
public class ad {
|
||||||
|
@Inject(method = "keyPress", at = @At("HEAD"))
|
||||||
|
public void triggerKeyEvent(long window, int action, KeyEvent keyInput, CallbackInfo ci) {
|
||||||
|
int key = keyInput.key();
|
||||||
|
if (key != -1) {
|
||||||
|
defpackage.j.call(new er(action, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/java/b/ae.java
Normal file
22
src/main/java/b/ae.java
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import net.minecraft.client.renderer.LightmapRenderStateExtractor;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(LightmapRenderStateExtractor.class)
|
||||||
|
public class ae {
|
||||||
|
@ModifyExpressionValue(method = "extract", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/OptionInstance;get()Ljava/lang/Object;"))
|
||||||
|
private Object injectFullBright(Object original) {
|
||||||
|
if (original instanceof Double) {
|
||||||
|
wq tweaks = wq.INSTANCE;
|
||||||
|
if (tweaks.isEnabled() && tweaks.modeSetting.isEnable(0)) {
|
||||||
|
return Math.max((Double)original, tweaks.brightSetting.getCurrent() * 10.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
51
src/main/java/b/af.java
Normal file
51
src/main/java/b/af.java
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.LoadingOverlay;
|
||||||
|
import net.minecraft.client.gui.screens.Overlay;
|
||||||
|
import net.minecraft.server.packs.resources.ReloadInstance;
|
||||||
|
import net.minecraft.util.Util;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(LoadingOverlay.class)
|
||||||
|
public abstract class af extends Overlay {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Minecraft minecraft;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private ReloadInstance reload;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private boolean fadeIn;
|
||||||
|
@Shadow
|
||||||
|
private long fadeOutStart;
|
||||||
|
@Shadow
|
||||||
|
private long fadeInStart;
|
||||||
|
@Unique
|
||||||
|
private final acc evolution$splash = new acc();
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evolution$extractSplash(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTick, CallbackInfo ci) {
|
||||||
|
if (acc.available()) {
|
||||||
|
ci.cancel();
|
||||||
|
if (this.fadeIn && this.fadeInStart == -1L) {
|
||||||
|
this.fadeInStart = Util.getMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean finished = this.evolution$splash
|
||||||
|
.extract(graphics, this.minecraft, this.reload.getActualProgress(), this.fadeIn, this.fadeInStart, this.fadeOutStart, mouseX, mouseY, partialTick);
|
||||||
|
if (finished) {
|
||||||
|
this.minecraft.gui.setOverlay(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/java/b/ag.java
Normal file
21
src/main/java/b/ag.java
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.phys.HitResult;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(LocalPlayer.class)
|
||||||
|
public abstract class ag {
|
||||||
|
@Inject(method = "raycastHitResult(FLnet/minecraft/world/entity/Entity;)Lnet/minecraft/world/phys/HitResult;", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$frameAccurateRaycast(float partialTicks, Entity cameraEntity, CallbackInfoReturnable<HitResult> callback) {
|
||||||
|
HitResult hitResult = tf.INSTANCE.raycast((LocalPlayer)this, cameraEntity, partialTicks);
|
||||||
|
if (hitResult != null) {
|
||||||
|
callback.setReturnValue(hitResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/main/java/b/ah.java
Normal file
29
src/main/java/b/ah.java
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(Minecraft.class)
|
||||||
|
public abstract class ah {
|
||||||
|
@Inject(method = "startAttack", at = @At("HEAD"))
|
||||||
|
private void evo$meleePrimaryAttack(CallbackInfoReturnable<Boolean> callback) {
|
||||||
|
if (sz.handlesAnyHand()) {
|
||||||
|
ahl.getInstance().onAttack(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "startUseItem", at = @At("RETURN"))
|
||||||
|
private void evo$meleeSecondaryAttack(CallbackInfo callback) {
|
||||||
|
if (!sz.usesHand(Minecraft.getInstance().player, InteractionHand.OFF_HAND)) {
|
||||||
|
if (sz.handlesAnyHand()) {
|
||||||
|
ahl.getInstance().onAttack(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/main/java/b/ai.java
Normal file
44
src/main/java/b/ai.java
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.platform.Window;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.main.GameConfig;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
|
import net.minecraft.world.phys.HitResult;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Minecraft.class)
|
||||||
|
public abstract class ai {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Window window;
|
||||||
|
@Shadow
|
||||||
|
public HitResult hitResult;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract Window getWindow();
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "<init>",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft$1;<init>(Lnet/minecraft/client/Minecraft;Lnet/minecraft/client/main/GameConfig;)V")
|
||||||
|
)
|
||||||
|
public void init(GameConfig args, CallbackInfo ci) {
|
||||||
|
defpackage.bz.getInstance().init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "pick(F)V", at = @At("TAIL"))
|
||||||
|
private void dropTargetDuringShowcase(float tickDelta, CallbackInfo ci) {
|
||||||
|
if (sv.INSTANCE.isFlying()) {
|
||||||
|
this.hitResult = BlockHitResult.miss(Vec3.ZERO, Direction.UP, BlockPos.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
src/main/java/b/aj.java
Normal file
71
src/main/java/b/aj.java
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.MouseHandler;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.input.MouseButtonInfo;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(MouseHandler.class)
|
||||||
|
public class aj {
|
||||||
|
@Inject(method = "onButton", at = @At("HEAD"))
|
||||||
|
private void onMouseButton(long window, MouseButtonInfo mouseInput, int action, CallbackInfo ci) {
|
||||||
|
int button = mouseInput.button();
|
||||||
|
if (button != -1 && window == aqg.mc.getWindow().handle()) {
|
||||||
|
defpackage.j.call(new er(action, button));
|
||||||
|
defpackage.j.call(new es(button, action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "onScroll",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;getInventory()Lnet/minecraft/world/entity/player/Inventory;"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
public void onMouseScrollHook(long window, double horizontal, double vertical, CallbackInfo ci) {
|
||||||
|
if (wr.INSTANCE != null && wr.INSTANCE.handleScroll(vertical)) {
|
||||||
|
ci.cancel();
|
||||||
|
} else {
|
||||||
|
eq event = new eq(horizontal, vertical);
|
||||||
|
defpackage.j.call(event);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(method = "handleAccumulatedMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;isMouseGrabbed()Z"))
|
||||||
|
public boolean onIsCursorLocked(MouseHandler instance) {
|
||||||
|
return instance.isMouseGrabbed() || this.isAnim();
|
||||||
|
}
|
||||||
|
|
||||||
|
@WrapWithCondition(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;turn(DD)V"), require = 1, allow = 1)
|
||||||
|
private boolean modifyMouseRotationInput(LocalPlayer instance, double cursorDeltaX, double cursorDeltaY) {
|
||||||
|
if (afu.getInstance().consumeLook(cursorDeltaX, cursorDeltaY)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
et event = new et((float)cursorDeltaX, (float)cursorDeltaY);
|
||||||
|
defpackage.j.call(event);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.turn(event.getCursorDeltaX(), event.getCursorDeltaY());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private boolean isAnim() {
|
||||||
|
Screen screen = Minecraft.getInstance().gui.screen();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/main/java/b/ak.java
Normal file
15
src/main/java/b/ak.java
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import net.minecraft.client.Options;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(Options.class)
|
||||||
|
public class ak {
|
||||||
|
@ModifyReturnValue(method = "getEffectiveRenderDistance()I", at = @At("RETURN"))
|
||||||
|
private int extendRenderDistance(int original) {
|
||||||
|
return sr.INSTANCE.isHolding() ? Math.max(original, sr.INSTANCE.radius()) : original;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/b/al.java
Normal file
25
src/main/java/b/al.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.world.scores.PlayerTeam;
|
||||||
|
import net.minecraft.world.scores.Scoreboard;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Scoreboard.class)
|
||||||
|
public abstract class al {
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
public abstract PlayerTeam getPlayersTeam(String var1);
|
||||||
|
|
||||||
|
@Inject(method = "removePlayerFromTeam(Ljava/lang/String;Lnet/minecraft/world/scores/PlayerTeam;)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void remove(String scoreHolderName, PlayerTeam team, CallbackInfo ci) {
|
||||||
|
if (this.getPlayersTeam(scoreHolderName) != team) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
39
src/main/java/b/am.java
Normal file
39
src/main/java/b/am.java
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(Minecraft.class)
|
||||||
|
public abstract class am {
|
||||||
|
@Unique
|
||||||
|
private static boolean evo$cosmeticBlocksInteraction() {
|
||||||
|
return tc.blocksInteraction() || sy.blocksInteraction() || tb.blocksInteraction();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "startAttack()Z", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$blockWatchAttack(CallbackInfoReturnable<Boolean> callback) {
|
||||||
|
if (evo$cosmeticBlocksInteraction()) {
|
||||||
|
callback.setReturnValue(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "continueAttack(Z)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$blockWatchMining(boolean hitting, CallbackInfo callback) {
|
||||||
|
if (evo$cosmeticBlocksInteraction()) {
|
||||||
|
callback.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "startUseItem()V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$blockWatchUse(CallbackInfo callback) {
|
||||||
|
if (evo$cosmeticBlocksInteraction()) {
|
||||||
|
callback.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/b/an.java
Normal file
25
src/main/java/b/an.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Pseudo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Pseudo
|
||||||
|
@Mixin(targets = "net.caffeinemc.mods.sodium.client.model.light.data.LightDataAccess", remap = false)
|
||||||
|
public class an {
|
||||||
|
@Inject(method = "compute(III)I", at = @At("RETURN"), cancellable = true, require = 0)
|
||||||
|
private void evo$injectDynamicLight(int x, int y, int z, CallbackInfoReturnable<Integer> cir) {
|
||||||
|
if (uq.INSTANCE.isEnabled()) {
|
||||||
|
int dyn = uq.getBlockLight(x, y, z);
|
||||||
|
if (dyn > 0) {
|
||||||
|
int packed = cir.getReturnValueI();
|
||||||
|
if ((packed & 15) < dyn) {
|
||||||
|
cir.setReturnValue(packed & -16 | dyn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
src/main/java/b/ao.java
Normal file
34
src/main/java/b/ao.java
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import java.util.Map;
|
||||||
|
import net.minecraft.client.sounds.SoundManager;
|
||||||
|
import net.minecraft.client.sounds.WeighedSoundEvents;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.server.packs.resources.Resource;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(SoundManager.class)
|
||||||
|
public class ao {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Map<Identifier, WeighedSoundEvents> registry;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Map<Identifier, Resource> soundCache;
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "apply(Lnet/minecraft/client/sounds/SoundManager$Preparations;Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/util/profiling/ProfilerFiller;)V",
|
||||||
|
at = @At("TAIL"),
|
||||||
|
require = 1
|
||||||
|
)
|
||||||
|
private void installEvolutionCustomSounds(CallbackInfo ci) {
|
||||||
|
mk.install(this.registry, this.soundCache);
|
||||||
|
tl.INSTANCE.refreshSoundOptions();
|
||||||
|
}
|
||||||
|
}
|
||||||
83
src/main/java/b/ap.java
Normal file
83
src/main/java/b/ap.java
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.Font;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.components.LogoRenderer;
|
||||||
|
import net.minecraft.client.gui.components.SplashRenderer;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.TitleScreen;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(TitleScreen.class)
|
||||||
|
public abstract class ap extends Screen {
|
||||||
|
protected ap(Component title) {
|
||||||
|
super(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "init()V", at = @At("RETURN"))
|
||||||
|
private void evolution$installMenuEntries(CallbackInfo ci) {
|
||||||
|
aci.ensureRegistered();
|
||||||
|
acj.installInto(this, widget -> this.addRenderableWidget(widget));
|
||||||
|
xk toast = new xk((TitleScreen)this, this.font);
|
||||||
|
acj.exclude(toast);
|
||||||
|
this.addRenderableWidget(toast);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"))
|
||||||
|
private void evolution$takeOverMenu(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
aco layout = aco.INSTANCE;
|
||||||
|
layout.update(this, this.width, this.height);
|
||||||
|
layout.requestCursor(context, mouseX, mouseY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("RETURN"))
|
||||||
|
private void evolution$releaseMenu(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
aco.INSTANCE.reveal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "removed()V", at = @At("HEAD"))
|
||||||
|
private void evolution$forgetMenu(CallbackInfo ci) {
|
||||||
|
aco.INSTANCE.forget(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/gui/components/LogoRenderer;extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IF)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evolution$skipLogo(LogoRenderer instance, GuiGraphicsExtractor context, int width, float alpha) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/gui/components/SplashRenderer;extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;ILnet/minecraft/client/gui/Font;F)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evolution$skipSplash(SplashRenderer instance, GuiGraphicsExtractor context, int width, Font font, float alpha) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphicsExtractor;text(Lnet/minecraft/client/gui/Font;Ljava/lang/String;III)V")
|
||||||
|
)
|
||||||
|
private void evolution$skipVersionLabel(GuiGraphicsExtractor context, Font font, String version, int x, int y, int color) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/TitleScreen;realmsNotificationsEnabled()Z")
|
||||||
|
)
|
||||||
|
private boolean evolution$skipRealmsNotifications(TitleScreen instance) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/main/java/b/aq.java
Normal file
27
src/main/java/b/aq.java
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.util.LightCoordsUtil;
|
||||||
|
import net.minecraft.world.level.BlockAndLightGetter;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(LightCoordsUtil.class)
|
||||||
|
public class aq {
|
||||||
|
@Inject(method = "getLightCoords(Lnet/minecraft/world/level/BlockAndLightGetter;Lnet/minecraft/core/BlockPos;)I", at = @At("RETURN"), cancellable = true)
|
||||||
|
private static void evo$injectDynamicLight(BlockAndLightGetter world, BlockPos pos, CallbackInfoReturnable<Integer> cir) {
|
||||||
|
if (uq.INSTANCE.isEnabled()) {
|
||||||
|
int dyn = uq.getBlockLight(pos.getX(), pos.getY(), pos.getZ());
|
||||||
|
if (dyn > 0) {
|
||||||
|
int lm = cir.getReturnValueI();
|
||||||
|
int block = lm >> 4;
|
||||||
|
if (block < dyn) {
|
||||||
|
cir.setReturnValue(lm & -241 | dyn << 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
26
src/main/java/b/ar.java
Normal file
26
src/main/java/b/ar.java
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
|
||||||
|
import net.minecraft.client.renderer.blockentity.state.BlockEntityRenderState;
|
||||||
|
import net.minecraft.client.renderer.state.level.CameraRenderState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(BlockEntityRenderDispatcher.class)
|
||||||
|
public abstract class ar {
|
||||||
|
@Inject(
|
||||||
|
method = "submit(Lnet/minecraft/client/renderer/blockentity/state/BlockEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V",
|
||||||
|
at = @At("HEAD")
|
||||||
|
)
|
||||||
|
private void evo$animatePlacingBlockEntity(
|
||||||
|
BlockEntityRenderState renderState, PoseStack poseStack, SubmitNodeCollector collector, CameraRenderState camera, CallbackInfo ci
|
||||||
|
) {
|
||||||
|
aut.applyBlockEntity(renderState.blockPos, poseStack, Minecraft.getInstance().getDeltaTracker().getGameTimeDeltaPartialTick(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
40
src/main/java/b/as.java
Normal file
40
src/main/java/b/as.java
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.InteractionResult;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.BlockItem;
|
||||||
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(BlockItem.class)
|
||||||
|
public abstract class as {
|
||||||
|
@Inject(
|
||||||
|
method = "place(Lnet/minecraft/world/item/context/BlockPlaceContext;)Lnet/minecraft/world/InteractionResult;",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/world/item/BlockItem;updateBlockStateFromTag(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/level/block/state/BlockState;)Lnet/minecraft/world/level/block/state/BlockState;"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$startPlaceAnimation(
|
||||||
|
BlockPlaceContext context,
|
||||||
|
CallbackInfoReturnable<InteractionResult> cir,
|
||||||
|
@Local Level level,
|
||||||
|
@Local BlockPos pos,
|
||||||
|
@Local Player player,
|
||||||
|
@Local(ordinal = 0) BlockState placementState,
|
||||||
|
@Local(ordinal = 1) BlockState placedState
|
||||||
|
) {
|
||||||
|
if (level instanceof ClientLevel clientLevel && placedState.is(placementState.getBlock())) {
|
||||||
|
vy.INSTANCE.onBlockPlaced(clientLevel, pos, placedState, player, context.getHand());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
23
src/main/java/b/at.java
Normal file
23
src/main/java/b/at.java
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.LevelRenderer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.state.level.LevelRenderState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(LevelRenderer.class)
|
||||||
|
public abstract class at {
|
||||||
|
@Inject(
|
||||||
|
method = "submitEntities(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/client/renderer/SubmitNodeCollector;)V",
|
||||||
|
at = @At("TAIL")
|
||||||
|
)
|
||||||
|
private void evo$submitPlacingBlocks(PoseStack poseStack, LevelRenderState levelRenderState, SubmitNodeCollector collector, CallbackInfo ci) {
|
||||||
|
aut.submit(poseStack, collector, Minecraft.getInstance().getDeltaTracker().getGameTimeDeltaPartialTick(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
28
src/main/java/b/au.java
Normal file
28
src/main/java/b/au.java
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.block.BlockAndTintGetter;
|
||||||
|
import net.minecraft.client.renderer.block.ModelBlockRenderer;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(ModelBlockRenderer.class)
|
||||||
|
public abstract class au {
|
||||||
|
@Inject(
|
||||||
|
method = "shouldRenderFace(Lnet/minecraft/client/renderer/block/BlockAndTintGetter;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/Direction;Lnet/minecraft/core/BlockPos;)Z",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private void evo$revealFacesNextToPlacingBlock(
|
||||||
|
BlockAndTintGetter level, BlockState state, Direction direction, BlockPos neighborPos, CallbackInfoReturnable<Boolean> cir
|
||||||
|
) {
|
||||||
|
if (aut.isHidden(neighborPos)) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/main/java/b/av.java
Normal file
29
src/main/java/b/av.java
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import net.minecraft.client.renderer.chunk.SectionCompiler;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.block.RenderShape;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(SectionCompiler.class)
|
||||||
|
public abstract class av {
|
||||||
|
@ModifyExpressionValue(
|
||||||
|
method = "compile(Lnet/minecraft/core/SectionPos;Lnet/minecraft/client/renderer/chunk/RenderSectionRegion;Lcom/mojang/blaze3d/vertex/VertexSorting;Lnet/minecraft/client/renderer/SectionBufferBuilderPack;)Lnet/minecraft/client/renderer/chunk/SectionCompiler$Results;",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getRenderShape()Lnet/minecraft/world/level/block/RenderShape;")
|
||||||
|
)
|
||||||
|
private RenderShape evo$hidePlacingBlock(RenderShape original, @Local(ordinal = 2) BlockPos pos) {
|
||||||
|
return original == RenderShape.MODEL && aut.isHidden(pos) ? RenderShape.INVISIBLE : original;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyExpressionValue(
|
||||||
|
method = "compile(Lnet/minecraft/core/SectionPos;Lnet/minecraft/client/renderer/chunk/RenderSectionRegion;Lcom/mojang/blaze3d/vertex/VertexSorting;Lnet/minecraft/client/renderer/SectionBufferBuilderPack;)Lnet/minecraft/client/renderer/chunk/SectionCompiler$Results;",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;isSolidRender()Z")
|
||||||
|
)
|
||||||
|
private boolean evo$unblockPlacingBlock(boolean original, @Local(ordinal = 2) BlockPos pos) {
|
||||||
|
return original && !aut.isHidden(pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/java/b/aw.java
Normal file
22
src/main/java/b/aw.java
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.block.dispatch.BlockStateModel;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Pseudo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Pseudo
|
||||||
|
@Mixin(targets = "net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderer", remap = false)
|
||||||
|
public abstract class aw {
|
||||||
|
@Inject(method = "renderModel", at = @At("HEAD"), cancellable = true, require = 0, remap = false)
|
||||||
|
private void evo$hidePlacingBlock(BlockStateModel model, BlockState state, BlockPos pos, BlockPos origin, CallbackInfo ci) {
|
||||||
|
if (aut.isHidden(pos)) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
src/main/java/b/ax.java
Normal file
38
src/main/java/b/ax.java
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Pseudo;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Pseudo
|
||||||
|
@Mixin(targets = "net.caffeinemc.mods.sodium.client.render.model.AbstractBlockRenderContext", remap = false)
|
||||||
|
public abstract class ax {
|
||||||
|
@Shadow(remap = false)
|
||||||
|
@Final
|
||||||
|
private MutableBlockPos cachedPositionObject;
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "shouldDrawSide(Lnet/minecraft/core/Direction;)Z",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/block/BlockAndTintGetter;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;",
|
||||||
|
shift = Shift.BEFORE
|
||||||
|
),
|
||||||
|
cancellable = true,
|
||||||
|
require = 0,
|
||||||
|
remap = false
|
||||||
|
)
|
||||||
|
private void evo$revealFacesNextToPlacingBlock(Direction direction, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (aut.isHidden(this.cachedPositionObject)) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/main/java/b/ay.java
Normal file
30
src/main/java/b/ay.java
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Camera;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Camera.class)
|
||||||
|
public abstract class ay {
|
||||||
|
@Shadow
|
||||||
|
public abstract float yRot();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract float xRot();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract void setRotation(float var1, float var2);
|
||||||
|
|
||||||
|
@Inject(method = "alignWithEntity", at = @At("TAIL"))
|
||||||
|
private void evo$lightningShake(float tickDelta, CallbackInfo ci) {
|
||||||
|
float yawOffset = up.INSTANCE.cameraShakeYaw();
|
||||||
|
float pitchOffset = up.INSTANCE.cameraShakePitch();
|
||||||
|
if (yawOffset != 0.0F || pitchOffset != 0.0F) {
|
||||||
|
this.setRotation(this.yRot() + yawOffset, this.xRot() + pitchOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
151
src/main/java/b/az.java
Normal file
151
src/main/java/b/az.java
Normal file
|
|
@ -0,0 +1,151 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
|
@Mixin(LivingEntityRenderState.class)
|
||||||
|
public class az implements aud {
|
||||||
|
@Unique
|
||||||
|
private int evo$entityId;
|
||||||
|
@Unique
|
||||||
|
private String evo$name = "";
|
||||||
|
@Unique
|
||||||
|
private float evo$health;
|
||||||
|
@Unique
|
||||||
|
private float evo$maxHealth = 1.0F;
|
||||||
|
@Unique
|
||||||
|
private Identifier evo$texture;
|
||||||
|
@Unique
|
||||||
|
private byte evo$targetKind;
|
||||||
|
@Unique
|
||||||
|
private int evo$cachedColor;
|
||||||
|
@Unique
|
||||||
|
private long evo$colorFrameId;
|
||||||
|
@Unique
|
||||||
|
private long evo$visualFrameId;
|
||||||
|
@Unique
|
||||||
|
private boolean evo$renderable;
|
||||||
|
@Unique
|
||||||
|
private float evo$distanceAlpha = 1.0F;
|
||||||
|
@Unique
|
||||||
|
private static final int evo$NO_CHAIN_ENTRY = -1;
|
||||||
|
@Unique
|
||||||
|
private long evo$reuseChainFrame = Long.MIN_VALUE;
|
||||||
|
@Unique
|
||||||
|
private int evo$reuseChainHead = -1;
|
||||||
|
@Unique
|
||||||
|
private int evo$reuseChainTail = -1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long evo$getReuseChainFrame() {
|
||||||
|
return this.evo$reuseChainFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int evo$getReuseChainHead() {
|
||||||
|
return this.evo$reuseChainHead;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int evo$getReuseChainTail() {
|
||||||
|
return this.evo$reuseChainTail;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setReuseChain(long frameId, int head, int tail) {
|
||||||
|
this.evo$reuseChainFrame = frameId;
|
||||||
|
this.evo$reuseChainHead = head;
|
||||||
|
this.evo$reuseChainTail = tail;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setReuseChainTail(int tail) {
|
||||||
|
this.evo$reuseChainTail = tail;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long evo$getVisualFrameId() {
|
||||||
|
return this.evo$visualFrameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean evo$isRenderable() {
|
||||||
|
return this.evo$renderable;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float evo$getDistanceAlpha() {
|
||||||
|
return this.evo$distanceAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setVisual(long frameId, boolean renderable, float distanceAlpha) {
|
||||||
|
this.evo$visualFrameId = frameId;
|
||||||
|
this.evo$renderable = renderable;
|
||||||
|
this.evo$distanceAlpha = distanceAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setChamsData(int entityId, String name, float health, float maxHealth, Identifier texture, byte targetKind) {
|
||||||
|
this.evo$entityId = entityId;
|
||||||
|
this.evo$name = name == null ? "" : name;
|
||||||
|
this.evo$health = Math.max(0.0F, health);
|
||||||
|
this.evo$maxHealth = maxHealth > 0.0F ? maxHealth : 1.0F;
|
||||||
|
this.evo$texture = texture;
|
||||||
|
this.evo$targetKind = targetKind;
|
||||||
|
this.evo$colorFrameId = -1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int evo$getEntityId() {
|
||||||
|
return this.evo$entityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String evo$getName() {
|
||||||
|
return this.evo$name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float evo$getHealth() {
|
||||||
|
return this.evo$health;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float evo$getMaxHealth() {
|
||||||
|
return this.evo$maxHealth;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Identifier evo$getTexture() {
|
||||||
|
return this.evo$texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public byte evo$getTargetKind() {
|
||||||
|
return this.evo$targetKind;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int evo$getCachedColor() {
|
||||||
|
return this.evo$cachedColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setCachedColor(int color) {
|
||||||
|
this.evo$cachedColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long evo$getColorFrameId() {
|
||||||
|
return this.evo$colorFrameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setColorFrameId(long frameId) {
|
||||||
|
this.evo$colorFrameId = frameId;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/main/java/b/b.java
Normal file
13
src/main/java/b/b.java
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.components.Button;
|
||||||
|
import net.minecraft.client.gui.components.Button.OnPress;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(Button.class)
|
||||||
|
public interface b {
|
||||||
|
@Accessor("onPress")
|
||||||
|
OnPress evolution$getOnPress();
|
||||||
|
}
|
||||||
119
src/main/java/b/ba.java
Normal file
119
src/main/java/b/ba.java
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.model.EntityModel;
|
||||||
|
import net.minecraft.client.model.Model;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
|
||||||
|
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
|
||||||
|
import net.minecraft.client.renderer.feature.ModelFeatureRenderer.CrumblingOverlay;
|
||||||
|
import net.minecraft.client.renderer.rendertype.RenderType;
|
||||||
|
import net.minecraft.client.renderer.state.level.CameraRenderState;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(LivingEntityRenderer.class)
|
||||||
|
public abstract class ba<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends EntityRenderer<T, S> {
|
||||||
|
@Shadow
|
||||||
|
public abstract Identifier getTextureLocation(S var1);
|
||||||
|
|
||||||
|
protected ba(Context ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "submit(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private void evo$hideDisintegratedBody(S state, PoseStack matrices, SubmitNodeCollector queue, CameraRenderState cameraState, CallbackInfo ci) {
|
||||||
|
if (up.INSTANCE.shouldHideEntity(((aud)state).evo$getEntityId())) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "submit(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/entity/LivingEntityRenderer;scale(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;)V",
|
||||||
|
shift = Shift.AFTER
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$squashPattedEntity(S state, PoseStack matrices, SubmitNodeCollector queue, CameraRenderState cameraState, CallbackInfo ci) {
|
||||||
|
float squash = aim.getInstance().squash(((aud)state).evo$getEntityId());
|
||||||
|
if (squash != 1.0F) {
|
||||||
|
matrices.scale(1.0F, squash, 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)V",
|
||||||
|
at = @At("TAIL")
|
||||||
|
)
|
||||||
|
private void evo$captureChamsData(T entity, S state, float tickDelta, CallbackInfo ci) {
|
||||||
|
Identifier texture = this.getTextureLocation(state);
|
||||||
|
byte targetKind = (byte)tw.INSTANCE.computeTargetKind(entity).ordinal();
|
||||||
|
aud access = (aud)state;
|
||||||
|
access.evo$setChamsData(entity.getId(), entity.getName().getString(), entity.getHealth(), entity.getMaxHealth(), texture, targetKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(
|
||||||
|
method = "submit(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
argsOnly = true
|
||||||
|
)
|
||||||
|
private SubmitNodeCollector evo$wrapCommandQueue(SubmitNodeCollector originalQueue, S state) {
|
||||||
|
if (!ty.isLevelRender()) {
|
||||||
|
return originalQueue;
|
||||||
|
} else {
|
||||||
|
return (!tw.INSTANCE.glowActive() || !tw.INSTANCE.isRenderable(state)) && !tw.INSTANCE.shouldApplyHitcolor(state)
|
||||||
|
? originalQueue
|
||||||
|
: auc.wrap(originalQueue, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "submit(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/SubmitNodeCollector;submitModel(Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/rendertype/RenderType;IIILnet/minecraft/client/renderer/texture/TextureAtlasSprite;ILnet/minecraft/client/renderer/feature/ModelFeatureRenderer$CrumblingOverlay;)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$submitModelWithTint(
|
||||||
|
SubmitNodeCollector queue,
|
||||||
|
Model model,
|
||||||
|
Object modelState,
|
||||||
|
PoseStack matrices,
|
||||||
|
RenderType layer,
|
||||||
|
int light,
|
||||||
|
int overlay,
|
||||||
|
int color,
|
||||||
|
TextureAtlasSprite sprite,
|
||||||
|
int outlineColor,
|
||||||
|
CrumblingOverlay crumblingOverlayCommand
|
||||||
|
) {
|
||||||
|
if (modelState instanceof LivingEntityRenderState livingState) {
|
||||||
|
int entityId = ((aud)livingState).evo$getEntityId();
|
||||||
|
if (afa.shouldHideVanilla(entityId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
color = up.INSTANCE.charredBodyTint(entityId, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
queue.submitModel(model, modelState, matrices, layer, light, overlay, color, sprite, outlineColor, crumblingOverlayCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
36
src/main/java/b/bb.java
Normal file
36
src/main/java/b/bb.java
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.feature.ModelFeatureRenderer;
|
||||||
|
import net.minecraft.client.renderer.feature.ModelFeatureRenderer.Submit;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ModelFeatureRenderer.class)
|
||||||
|
public abstract class bb {
|
||||||
|
@Inject(
|
||||||
|
method = "prepareModel(Lnet/minecraft/client/renderer/feature/ModelFeatureRenderer$Submit;)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/model/Model;renderToBuffer(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;III)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$beforeModelGeometry(Submit<?> submit, CallbackInfo ci) {
|
||||||
|
atz.beginModelRender(submit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "prepareModel(Lnet/minecraft/client/renderer/feature/ModelFeatureRenderer$Submit;)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/model/Model;renderToBuffer(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;III)V",
|
||||||
|
shift = Shift.AFTER
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$afterModelGeometry(Submit<?> submit, CallbackInfo ci) {
|
||||||
|
atz.endModelRender();
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/java/b/bc.java
Normal file
22
src/main/java/b/bc.java
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.model.Model;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
|
@Mixin(Model.class)
|
||||||
|
public abstract class bc implements aub {
|
||||||
|
@Unique
|
||||||
|
private aua evo$modelTree;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public aua evo$getModelTree() {
|
||||||
|
return this.evo$modelTree;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$setModelTree(aua tree) {
|
||||||
|
this.evo$modelTree = tree;
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/java/b/bd.java
Normal file
21
src/main/java/b/bd.java
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.client.renderer.feature.FeatureFrameContext;
|
||||||
|
import net.minecraft.client.renderer.feature.ModelFeatureRenderer;
|
||||||
|
import net.minecraft.client.renderer.feature.RenderTypeFeatureRenderer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(RenderTypeFeatureRenderer.class)
|
||||||
|
public abstract class bd {
|
||||||
|
@Inject(method = "prepareGroup(Lnet/minecraft/client/renderer/feature/FeatureFrameContext;Ljava/util/List;Z)V", at = @At("HEAD"))
|
||||||
|
private void evo$captureStagedBuffer(FeatureFrameContext context, List<?> submits, boolean strictlyOrdered, CallbackInfo ci) {
|
||||||
|
if (this instanceof ModelFeatureRenderer) {
|
||||||
|
atz.captureFrameContext(context.stagedVertexBuffer(), context.lightmap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
26
src/main/java/b/be.java
Normal file
26
src/main/java/b/be.java
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.TitleScreen;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Screen.class)
|
||||||
|
public class be {
|
||||||
|
@Inject(method = "extractPanorama(Lnet/minecraft/client/gui/GuiGraphicsExtractor;F)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evolution$menuVideoBackground(GuiGraphicsExtractor context, float delta, CallbackInfo ci) {
|
||||||
|
Screen self = (Screen)this;
|
||||||
|
if (Minecraft.getInstance().level == null && !(self instanceof api)) {
|
||||||
|
if (!(self instanceof TitleScreen)) {
|
||||||
|
aqr.renderExtracted(context, self.width, self.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/java/b/bf.java
Normal file
16
src/main/java/b/bf.java
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.platform.Window;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Window.class)
|
||||||
|
public class bf {
|
||||||
|
@Inject(method = "onResize", at = @At("TAIL"))
|
||||||
|
private void onWindowSizeChanged(long window, int width, int height, CallbackInfo ci) {
|
||||||
|
defpackage.j.call(new fa());
|
||||||
|
}
|
||||||
|
}
|
||||||
91
src/main/java/b/bg.java
Normal file
91
src/main/java/b/bg.java
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import net.minecraft.client.gui.Font;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.components.ChatComponent;
|
||||||
|
import net.minecraft.client.gui.components.ChatComponent.DisplayMode;
|
||||||
|
import net.minecraft.client.multiplayer.chat.GuiMessage;
|
||||||
|
import net.minecraft.client.multiplayer.chat.GuiMessage.Line;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import org.joml.Matrix3x2fStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ChatComponent.class)
|
||||||
|
public abstract class bg {
|
||||||
|
@Unique
|
||||||
|
private static final float OFFSET_EPSILON = 0.01F;
|
||||||
|
@Shadow
|
||||||
|
private int chatScrollbarPos;
|
||||||
|
@Unique
|
||||||
|
private long evo$lastMessageAt;
|
||||||
|
@Unique
|
||||||
|
private boolean evo$slid;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private int getLineHeight() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(
|
||||||
|
method = "addMessage(Lnet/minecraft/network/chat/Component;Lnet/minecraft/network/chat/MessageSignature;Lnet/minecraft/client/multiplayer/chat/GuiMessageSource;Lnet/minecraft/client/multiplayer/chat/GuiMessageTag;)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
argsOnly = true
|
||||||
|
)
|
||||||
|
private Component evo$decorateCrosshairCode(Component message) {
|
||||||
|
return wu.decorate(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "addMessageToDisplayQueue", at = @At("TAIL"))
|
||||||
|
private void evo$markMessageAdded(GuiMessage message, CallbackInfo ci) {
|
||||||
|
this.evo$lastMessageAt = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/gui/Font;IIILnet/minecraft/client/gui/components/ChatComponent$DisplayMode;Z)V",
|
||||||
|
at = @At("HEAD")
|
||||||
|
)
|
||||||
|
private void evo$pushSlide(
|
||||||
|
GuiGraphicsExtractor context, Font font, int guiTicks, int mouseX, int mouseY, DisplayMode displayMode, boolean insertionMode, CallbackInfo ci
|
||||||
|
) {
|
||||||
|
float offset = this.evo$slideOffset();
|
||||||
|
if (!(offset < 0.01F)) {
|
||||||
|
Matrix3x2fStack pose = context.pose();
|
||||||
|
pose.pushMatrix();
|
||||||
|
pose.translate(0.0F, offset);
|
||||||
|
this.evo$slid = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/gui/Font;IIILnet/minecraft/client/gui/components/ChatComponent$DisplayMode;Z)V",
|
||||||
|
at = @At("RETURN")
|
||||||
|
)
|
||||||
|
private void evo$popSlide(
|
||||||
|
GuiGraphicsExtractor context, Font font, int guiTicks, int mouseX, int mouseY, DisplayMode displayMode, boolean insertionMode, CallbackInfo ci
|
||||||
|
) {
|
||||||
|
if (this.evo$slid) {
|
||||||
|
context.pose().popMatrix();
|
||||||
|
this.evo$slid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(method = "forEachLine", at = @At("STORE"), ordinal = 0)
|
||||||
|
private float evo$fadeMessage(float alpha, @Local Line line) {
|
||||||
|
return tq.INSTANCE.fadeChatMessages() && !tq.INSTANCE.chatAnimationFinished(this.evo$lastMessageAt)
|
||||||
|
? alpha * tq.INSTANCE.chatMessageAlpha(((aqe)line.parent()).evo$addedAt())
|
||||||
|
: alpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private float evo$slideOffset() {
|
||||||
|
return this.chatScrollbarPos == 0 && tq.INSTANCE.animateChatMessages() ? tq.INSTANCE.chatSlideOffset(this.evo$lastMessageAt, this.getLineHeight()) : 0.0F;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/b/bh.java
Normal file
25
src/main/java/b/bh.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.multiplayer.chat.GuiMessage;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(GuiMessage.class)
|
||||||
|
public abstract class bh implements aqe {
|
||||||
|
@Unique
|
||||||
|
private long evo$addedAt;
|
||||||
|
|
||||||
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
|
private void evo$captureAddedTime(CallbackInfo ci) {
|
||||||
|
this.evo$addedAt = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long evo$addedAt() {
|
||||||
|
return this.evo$addedAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/main/java/b/bi.java
Normal file
43
src/main/java/b/bi.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.Hud;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Hud.class)
|
||||||
|
public abstract class bi {
|
||||||
|
private static final String FOOD_ACTION = "food bar indication";
|
||||||
|
private static final String HEALTH_ACTION = "food heal preview";
|
||||||
|
|
||||||
|
@Inject(method = "extractFood(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/world/entity/player/Player;II)V", at = @At("RETURN"))
|
||||||
|
private void drawFoodIndication(GuiGraphicsExtractor context, Player player, int top, int right, CallbackInfo ci) {
|
||||||
|
if (uy.INSTANCE.isEnabled()) {
|
||||||
|
id.run(Cif.RENDER, "food bar indication", () -> uy.INSTANCE.renderFoodOverlay(context, player, top, right));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractHearts(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/world/entity/player/Player;IIIIFIIIZ)V", at = @At("RETURN"))
|
||||||
|
private void drawHealPreview(
|
||||||
|
GuiGraphicsExtractor context,
|
||||||
|
Player player,
|
||||||
|
int left,
|
||||||
|
int top,
|
||||||
|
int lineHeight,
|
||||||
|
int regenIndex,
|
||||||
|
float maxHealth,
|
||||||
|
int currentHealth,
|
||||||
|
int displayHealth,
|
||||||
|
int absorption,
|
||||||
|
boolean blink,
|
||||||
|
CallbackInfo ci
|
||||||
|
) {
|
||||||
|
if (uy.INSTANCE.isEnabled()) {
|
||||||
|
id.run(Cif.RENDER, "food heal preview", () -> uy.INSTANCE.renderHealthPreview(context, player, left, top, lineHeight, maxHealth, currentHealth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/java/b/bj.java
Normal file
21
src/main/java/b/bj.java
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.renderer.ScreenEffectRenderer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ScreenEffectRenderer.class)
|
||||||
|
public class bj {
|
||||||
|
@Inject(method = "submitFire", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void removeFireOverlay(PoseStack matrices, SubmitNodeCollector collector, TextureAtlasSprite sprite, CallbackInfo ci) {
|
||||||
|
if (vv.INSTANCE.isRemoveFire()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
118
src/main/java/b/bk.java
Normal file
118
src/main/java/b/bk.java
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.DeltaTracker;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.Hud;
|
||||||
|
import net.minecraft.world.level.GameType;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Hud.class)
|
||||||
|
public abstract class bk {
|
||||||
|
private static final float CROSSHAIR_HIDDEN_SCALE = 0.01F;
|
||||||
|
private static final float CROSSHAIR_FULL_SCALE = 1.0F;
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractCrosshair(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private void removeVanillaCrosshair(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
if (ue.INSTANCE.isEnabled()) {
|
||||||
|
ci.cancel();
|
||||||
|
} else {
|
||||||
|
float anim = ue.INSTANCE.updateAppear();
|
||||||
|
if (anim <= 0.01F) {
|
||||||
|
ci.cancel();
|
||||||
|
} else {
|
||||||
|
if (anim < 1.0F) {
|
||||||
|
context.pose().pushMatrix();
|
||||||
|
float centerX = context.guiWidth() / 2.0F;
|
||||||
|
float centerY = context.guiHeight() / 2.0F;
|
||||||
|
context.pose().translate(centerX, centerY);
|
||||||
|
context.pose().scale(anim, anim);
|
||||||
|
context.pose().translate(-centerX, -centerY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractCrosshair(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V", at = @At("RETURN"))
|
||||||
|
private void onRenderCrosshairReturn(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
float anim = ue.INSTANCE.appearAnimation.value();
|
||||||
|
if (anim > 0.01F && anim < 1.0F && !ue.INSTANCE.isEnabled()) {
|
||||||
|
context.pose().popMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractHotbarAndDecorations", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void renderMainHud(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
if (aqg.mc.gameMode.getPlayerMode() != GameType.SPECTATOR) {
|
||||||
|
vm interfaceModule = vm.INSTANCE;
|
||||||
|
if (interfaceModule.isEnabled() && interfaceModule.isEnableHotBar()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractTabList", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void inject(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
vm interfaceModule = vm.INSTANCE;
|
||||||
|
if (interfaceModule.isEnabled() && interfaceModule.isEnableTab()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractOverlayMessage", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void injectRenderOverlayMessage(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
if (aqg.mc.gameMode.getPlayerMode() != GameType.SPECTATOR) {
|
||||||
|
vm interfaceModule = vm.INSTANCE;
|
||||||
|
if (interfaceModule.isEnabled() && interfaceModule.isEnableHotBar()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractScoreboardSidebar", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void injectRenderScoreboardSidebar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
if (vv.INSTANCE.isRemoveScoreboard()) {
|
||||||
|
ci.cancel();
|
||||||
|
} else {
|
||||||
|
vm interfaceModule = vm.INSTANCE;
|
||||||
|
if (interfaceModule.isEnabled() && interfaceModule.isEnableScoreBar()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractBossOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void injectExtractBossOverlay(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
if (vv.INSTANCE.isRemoveBossBar()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractEffects", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void injectRenderStatusEffectOverlay(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||||
|
vm interfaceModule = vm.INSTANCE;
|
||||||
|
if (interfaceModule.isEnabled() && interfaceModule.isEnablePotions()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(method = "extractPlayerHealth", at = @At("STORE"), ordinal = 3)
|
||||||
|
private int modifyM(int original, GuiGraphicsExtractor context) {
|
||||||
|
if (aqg.mc.gameMode.getPlayerMode() != GameType.SPECTATOR) {
|
||||||
|
vm interfaceModule = vm.INSTANCE;
|
||||||
|
if (interfaceModule.isEnabled() && interfaceModule.isEnableHotBar()) {
|
||||||
|
return context.guiWidth() / 128;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
52
src/main/java/b/bl.java
Normal file
52
src/main/java/b/bl.java
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Screen.class)
|
||||||
|
public abstract class bl {
|
||||||
|
@Inject(method = "extractBackground", at = @At("RETURN"))
|
||||||
|
private void evo$scaleContainerBackground(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
if (this instanceof aqd screen) {
|
||||||
|
screen.evo$pushGuiScale(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractRenderStateWithTooltipAndSubtitles",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/gui/screens/Screen;extractBackground(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V",
|
||||||
|
shift = Shift.AFTER
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$unscaleContainerBackground(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
if (this instanceof aqd screen) {
|
||||||
|
screen.evo$popGuiScale(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractRenderStateWithTooltipAndSubtitles",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V")
|
||||||
|
)
|
||||||
|
private void evo$scaleContainerContents(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
if (this instanceof aqd screen) {
|
||||||
|
screen.evo$pushGuiScale(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderStateWithTooltipAndSubtitles", at = @At("RETURN"))
|
||||||
|
private void evo$unscaleContainerContents(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
if (this instanceof aqd screen) {
|
||||||
|
screen.evo$popGuiScale(context);
|
||||||
|
screen.evo$finishClosing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
115
src/main/java/b/bm.java
Normal file
115
src/main/java/b/bm.java
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.InventoryScreen;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import org.joml.Matrix3x2fStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(AbstractContainerScreen.class)
|
||||||
|
public abstract class bm extends Screen implements aqd {
|
||||||
|
@Unique
|
||||||
|
private static final float SCALE_EPSILON = 0.001F;
|
||||||
|
@Unique
|
||||||
|
private long evo$openedAt = System.currentTimeMillis();
|
||||||
|
@Unique
|
||||||
|
private long evo$closedAt;
|
||||||
|
@Unique
|
||||||
|
private float evo$closeStartScale = 1.0F;
|
||||||
|
@Unique
|
||||||
|
private boolean evo$closing;
|
||||||
|
@Unique
|
||||||
|
private boolean evo$forceClose;
|
||||||
|
@Unique
|
||||||
|
private boolean evo$scaled;
|
||||||
|
|
||||||
|
protected bm(Component title) {
|
||||||
|
super(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "init", at = @At("HEAD"))
|
||||||
|
private void evo$resetAnimation(CallbackInfo ci) {
|
||||||
|
this.evo$openedAt = System.currentTimeMillis();
|
||||||
|
this.evo$closedAt = 0L;
|
||||||
|
this.evo$closeStartScale = 1.0F;
|
||||||
|
this.evo$closing = false;
|
||||||
|
this.evo$forceClose = false;
|
||||||
|
this.evo$scaled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "onClose", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$animateClose(CallbackInfo ci) {
|
||||||
|
if (!this.evo$forceClose && this.evo$shouldAnimate()) {
|
||||||
|
this.evo$startClosing();
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$pushGuiScale(GuiGraphicsExtractor context) {
|
||||||
|
if (!this.evo$scaled && this.evo$animating()) {
|
||||||
|
float scale = this.evo$currentScale();
|
||||||
|
if (!(Math.abs(scale - 1.0F) < 0.001F)) {
|
||||||
|
Matrix3x2fStack pose = context.pose();
|
||||||
|
pose.pushMatrix();
|
||||||
|
pose.translate(this.width / 2.0F, this.height / 2.0F);
|
||||||
|
pose.scale(scale, scale);
|
||||||
|
pose.translate(-this.width / 2.0F, -this.height / 2.0F);
|
||||||
|
this.evo$scaled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$popGuiScale(GuiGraphicsExtractor context) {
|
||||||
|
if (this.evo$scaled) {
|
||||||
|
context.pose().popMatrix();
|
||||||
|
this.evo$scaled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evo$finishClosing() {
|
||||||
|
if (this.evo$closing && tq.INSTANCE.closeFinished(this.evo$closedAt)) {
|
||||||
|
this.evo$forceClose = true;
|
||||||
|
this.onClose();
|
||||||
|
this.evo$forceClose = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private boolean evo$isInventory() {
|
||||||
|
return this instanceof InventoryScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private boolean evo$shouldAnimate() {
|
||||||
|
return this.evo$isInventory() ? tq.INSTANCE.animateInventory() : tq.INSTANCE.animateStorages();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private boolean evo$animating() {
|
||||||
|
return this.evo$closing || this.evo$shouldAnimate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private float evo$currentScale() {
|
||||||
|
return this.evo$closing ? tq.INSTANCE.closeScale(this.evo$closedAt, this.evo$closeStartScale) : tq.INSTANCE.openScale(this.evo$openedAt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void evo$startClosing() {
|
||||||
|
if (!this.evo$closing) {
|
||||||
|
this.evo$closeStartScale = this.evo$currentScale();
|
||||||
|
this.evo$closedAt = System.currentTimeMillis();
|
||||||
|
this.evo$closing = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
102
src/main/java/b/bn.java
Normal file
102
src/main/java/b/bn.java
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||||
|
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.ChatScreen;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.network.chat.Style;
|
||||||
|
import org.joml.Matrix3x2fStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(ChatScreen.class)
|
||||||
|
public class bn extends Screen implements aqg {
|
||||||
|
@Unique
|
||||||
|
private static final float OFFSET_EPSILON = 0.01F;
|
||||||
|
@Unique
|
||||||
|
private long evo$openedAt;
|
||||||
|
@Unique
|
||||||
|
private boolean evo$opened;
|
||||||
|
@Unique
|
||||||
|
private float evo$inputOffset;
|
||||||
|
|
||||||
|
protected bn(Component title) {
|
||||||
|
super(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "handleComponentClicked(Lnet/minecraft/network/chat/Style;Z)Z", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$applySharedCrosshair(Style style, boolean insert, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (style != null && wu.handle(style.getClickEvent())) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "handleChatInput(Ljava/lang/String;Z)V", at = @At("HEAD"), cancellable = false)
|
||||||
|
private void onSendMessage(String text, boolean addToHistory, CallbackInfo ci) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "removed", at = @At("HEAD"))
|
||||||
|
private void evo$resetInputAnimation(CallbackInfo ci) {
|
||||||
|
this.evo$opened = false;
|
||||||
|
this.evo$inputOffset = 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractRenderState", at = @At("HEAD"))
|
||||||
|
private void evo$updateInputAnimation(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
|
if (!tq.INSTANCE.animateChatInput()) {
|
||||||
|
this.evo$opened = false;
|
||||||
|
this.evo$inputOffset = 0.0F;
|
||||||
|
} else {
|
||||||
|
if (!this.evo$opened) {
|
||||||
|
this.evo$opened = true;
|
||||||
|
this.evo$openedAt = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.evo$inputOffset = tq.INSTANCE.chatInputOffset(this.evo$openedAt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@WrapOperation(method = "extractRenderState", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphicsExtractor;fill(IIIII)V"))
|
||||||
|
private void evo$slideInputBackground(GuiGraphicsExtractor context, int left, int top, int right, int bottom, int color, Operation<Void> original) {
|
||||||
|
if (Math.abs(this.evo$inputOffset) < 0.01F) {
|
||||||
|
original.call(new Object[]{context, left, top, right, bottom, color});
|
||||||
|
} else {
|
||||||
|
Matrix3x2fStack pose = context.pose();
|
||||||
|
pose.pushMatrix();
|
||||||
|
pose.translate(0.0F, this.evo$inputOffset);
|
||||||
|
|
||||||
|
try {
|
||||||
|
original.call(new Object[]{context, left, top, right, bottom, color});
|
||||||
|
} finally {
|
||||||
|
pose.popMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@WrapOperation(
|
||||||
|
method = "extractRenderState",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V")
|
||||||
|
)
|
||||||
|
private void evo$slideInputWidgets(ChatScreen instance, GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, Operation<Void> original) {
|
||||||
|
if (Math.abs(this.evo$inputOffset) < 0.01F) {
|
||||||
|
original.call(new Object[]{instance, context, mouseX, mouseY, delta});
|
||||||
|
} else {
|
||||||
|
Matrix3x2fStack pose = context.pose();
|
||||||
|
pose.pushMatrix();
|
||||||
|
pose.translate(0.0F, this.evo$inputOffset);
|
||||||
|
|
||||||
|
try {
|
||||||
|
original.call(new Object[]{instance, context, mouseX, mouseY, delta});
|
||||||
|
} finally {
|
||||||
|
pose.popMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/main/java/b/bo.java
Normal file
19
src/main/java/b/bo.java
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(Screen.class)
|
||||||
|
public abstract class bo {
|
||||||
|
@ModifyReturnValue(method = "getTooltipFromItem(Lnet/minecraft/client/Minecraft;Lnet/minecraft/world/item/ItemStack;)Ljava/util/List;", at = @At("RETURN"))
|
||||||
|
private static List<Component> appendFoodValues(List<Component> lines, Minecraft client, ItemStack stack) {
|
||||||
|
return uy.INSTANCE.appendFoodTooltip(lines, stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
83
src/main/java/b/bp.java
Normal file
83
src/main/java/b/bp.java
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
|
import net.minecraft.client.input.MouseButtonEvent;
|
||||||
|
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||||
|
import net.minecraft.world.inventory.Slot;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Mutable;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(AbstractContainerScreen.class)
|
||||||
|
public abstract class bp {
|
||||||
|
@Unique
|
||||||
|
@Mutable
|
||||||
|
private boolean isAuc;
|
||||||
|
@Unique
|
||||||
|
@Mutable
|
||||||
|
private Slot lowSumSlotId = null;
|
||||||
|
@Unique
|
||||||
|
@Mutable
|
||||||
|
private Slot lowAllSumSlotId = null;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
protected AbstractContainerMenu menu;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract AbstractContainerMenu getMenu();
|
||||||
|
|
||||||
|
@Inject(method = "tick()V", at = @At("HEAD"))
|
||||||
|
private void tickScreen(CallbackInfo ci) {
|
||||||
|
hm.INSTANCE.tick();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "removed()V", at = @At("HEAD"))
|
||||||
|
private void onScreenRemoved(CallbackInfo ci) {
|
||||||
|
th.INSTANCE.endDrag();
|
||||||
|
hm.INSTANCE.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractSlot", at = @At("HEAD"))
|
||||||
|
private void onDrawSlotInject(GuiGraphicsExtractor context, Slot slot, int x, int y, CallbackInfo ci) {
|
||||||
|
tk.INSTANCE.renderSlotHighlight(context, slot, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "mouseClicked(Lnet/minecraft/client/input/MouseButtonEvent;Z)Z", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onSortButtonClicked(MouseButtonEvent event, boolean doubled, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
AbstractContainerScreen<?> screen = (AbstractContainerScreen<?>)this;
|
||||||
|
if (xr.click(screen, event.x(), event.y(), event.button(), event.hasShiftDown())) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
} else {
|
||||||
|
if (th.INSTANCE.onDragStart(screen, event.x(), event.y(), event.button(), event.hasShiftDown())) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "mouseScrolled(DDDD)Z", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onItemScrollerScrolled(double mouseX, double mouseY, double horizontal, double vertical, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (th.INSTANCE.onScroll((AbstractContainerScreen<?>)this, mouseX, mouseY, vertical)) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "mouseDragged(Lnet/minecraft/client/input/MouseButtonEvent;DD)Z", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onItemScrollerDragged(MouseButtonEvent event, double deltaX, double deltaY, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (th.INSTANCE.onDrag((AbstractContainerScreen<?>)this, event.x(), event.y())) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "mouseReleased(Lnet/minecraft/client/input/MouseButtonEvent;)Z", at = @At("HEAD"))
|
||||||
|
private void onItemScrollerReleased(MouseButtonEvent event, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
th.INSTANCE.endDrag();
|
||||||
|
}
|
||||||
|
}
|
||||||
47
src/main/java/b/bq.java
Normal file
47
src/main/java/b/bq.java
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import org.joml.Matrix3x2fStack;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
|
||||||
|
@Mixin(GuiGraphicsExtractor.class)
|
||||||
|
public abstract class bq {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private Matrix3x2fStack pose;
|
||||||
|
|
||||||
|
@ModifyVariable(method = {"entity", "skin", "book"}, at = @At("HEAD"), argsOnly = true, ordinal = 0)
|
||||||
|
private float evo$scalePictureInPictureSize(float scale) {
|
||||||
|
float scaleX = this.pose.m00();
|
||||||
|
return scaleX > 0.0F ? scale * scaleX : scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(method = {"entity", "skin", "book", "bannerPattern"}, at = @At("HEAD"), argsOnly = true, ordinal = 0)
|
||||||
|
private int evo$scalePictureInPictureX0(int x0) {
|
||||||
|
float scaleX = this.pose.m00();
|
||||||
|
return scaleX > 0.0F ? (int)Math.floor(scaleX * x0 + this.pose.m20()) : x0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(method = {"entity", "skin", "book", "bannerPattern"}, at = @At("HEAD"), argsOnly = true, ordinal = 1)
|
||||||
|
private int evo$scalePictureInPictureY0(int y0) {
|
||||||
|
float scaleY = this.pose.m11();
|
||||||
|
return scaleY > 0.0F ? (int)Math.floor(scaleY * y0 + this.pose.m21()) : y0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(method = {"entity", "skin", "book", "bannerPattern"}, at = @At("HEAD"), argsOnly = true, ordinal = 2)
|
||||||
|
private int evo$scalePictureInPictureX1(int x1) {
|
||||||
|
float scaleX = this.pose.m00();
|
||||||
|
return scaleX > 0.0F ? (int)Math.ceil(scaleX * x1 + this.pose.m20()) : x1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyVariable(method = {"entity", "skin", "book", "bannerPattern"}, at = @At("HEAD"), argsOnly = true, ordinal = 3)
|
||||||
|
private int evo$scalePictureInPictureY1(int y1) {
|
||||||
|
float scaleY = this.pose.m11();
|
||||||
|
return scaleY > 0.0F ? (int)Math.ceil(scaleY * y1 + this.pose.m21()) : y1;
|
||||||
|
}
|
||||||
|
}
|
||||||
62
src/main/java/b/br.java
Normal file
62
src/main/java/b/br.java
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
|
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||||
|
import net.minecraft.world.inventory.Slot;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(AbstractContainerScreen.class)
|
||||||
|
public abstract class br {
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
protected AbstractContainerMenu menu;
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
protected int imageWidth;
|
||||||
|
@Shadow
|
||||||
|
protected int leftPos;
|
||||||
|
@Shadow
|
||||||
|
protected int topPos;
|
||||||
|
@Shadow
|
||||||
|
protected boolean isQuickCrafting;
|
||||||
|
|
||||||
|
@Inject(method = "extractSlots(Lnet/minecraft/client/gui/GuiGraphicsExtractor;II)V", at = @At("HEAD"))
|
||||||
|
private void evo$updateSwaps(GuiGraphicsExtractor context, int mouseX, int mouseY, CallbackInfo ci) {
|
||||||
|
xt.INSTANCE.update((AbstractContainerScreen<?>)this, mouseX, mouseY, this.leftPos, this.topPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractSlots(Lnet/minecraft/client/gui/GuiGraphicsExtractor;II)V", at = @At("TAIL"))
|
||||||
|
private void evo$renderSwaps(GuiGraphicsExtractor context, int mouseX, int mouseY, CallbackInfo ci) {
|
||||||
|
xt.INSTANCE.render(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "extractSlot(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/world/inventory/Slot;II)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private void evo$hideArrivingSlot(GuiGraphicsExtractor context, Slot slot, int mouseX, int mouseY, CallbackInfo ci) {
|
||||||
|
if (!this.isQuickCrafting && xt.INSTANCE.extractPendingSlot(context, slot, this.imageWidth)) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "extractCarriedItem(Lnet/minecraft/client/gui/GuiGraphicsExtractor;II)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$hideArrivingCarried(GuiGraphicsExtractor context, int mouseX, int mouseY, CallbackInfo ci) {
|
||||||
|
if (!this.isQuickCrafting && xt.INSTANCE.extractPendingCarried(context, this.menu.getCarried(), mouseX, mouseY)) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "removed()V", at = @At("HEAD"))
|
||||||
|
private void evo$clearSwaps(CallbackInfo ci) {
|
||||||
|
xt.INSTANCE.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/main/java/b/bs.java
Normal file
57
src/main/java/b/bs.java
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
||||||
|
import net.minecraft.world.entity.projectile.Projectile;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(FireworkRocketEntity.class)
|
||||||
|
public abstract class bs extends Projectile {
|
||||||
|
@Unique
|
||||||
|
private Vec3 rotation;
|
||||||
|
@Shadow
|
||||||
|
private LivingEntity attachedToEntity;
|
||||||
|
|
||||||
|
public bs(EntityType<? extends Projectile> entityType, Level world) {
|
||||||
|
super(entityType, world);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyExpressionValue(
|
||||||
|
method = "tick",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;getLookAngle()Lnet/minecraft/world/phys/Vec3;")
|
||||||
|
)
|
||||||
|
public Vec3 tick(Vec3 original) {
|
||||||
|
this.rotation = original;
|
||||||
|
return this.rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/phys/Vec3;add(DDD)Lnet/minecraft/world/phys/Vec3;", ordinal = 0))
|
||||||
|
public Vec3 tick(Vec3 instance, double x, double y, double z) {
|
||||||
|
return instance.add(
|
||||||
|
this.rotation.x * 0.1 + (this.rotation.x * 1.5 - instance.x) * 0.5,
|
||||||
|
this.rotation.y * 0.1 + (this.rotation.y * 1.5 - instance.y) * 0.5,
|
||||||
|
this.rotation.z * 0.1 + (this.rotation.z * 1.5 - instance.z) * 0.5
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private Vec3 calculateRotationVector(float pitch, float yaw) {
|
||||||
|
float f = pitch * (float) (Math.PI / 180.0);
|
||||||
|
float g = -yaw * (float) (Math.PI / 180.0);
|
||||||
|
float h = Mth.cos(g);
|
||||||
|
float i = Mth.sin(g);
|
||||||
|
float j = Mth.cos(f);
|
||||||
|
float k = Mth.sin(f);
|
||||||
|
return new Vec3(i * j, -k, h * j);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
src/main/java/b/bt.java
Normal file
35
src/main/java/b/bt.java
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.tags.DamageTypeTags;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(LivingEntity.class)
|
||||||
|
public class bt implements aqg {
|
||||||
|
@Redirect(method = "jumpFromGround", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;getYRot()F"))
|
||||||
|
public float replaceMovePacketPitch(LivingEntity instance) {
|
||||||
|
return this != mc.player ? instance.getYRot() : defpackage.bz.getInstance().getRotationManager().getCurrentRotation().getYaw();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "jumpFromGround", at = @At("HEAD"))
|
||||||
|
private void trackJumpResetJump(CallbackInfo ci) {
|
||||||
|
if (this == mc.player) {
|
||||||
|
apl.INSTANCE.onJump(mc.player.tickCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "handleDamageEvent(Lnet/minecraft/world/damagesource/DamageSource;)V", at = @At("HEAD"))
|
||||||
|
private void trackJumpResetDamage(DamageSource damageSource, CallbackInfo ci) {
|
||||||
|
if (this == mc.player) {
|
||||||
|
if (damageSource.getEntity() != null && !damageSource.is(DamageTypeTags.NO_KNOCKBACK)) {
|
||||||
|
apl.INSTANCE.onHurt(mc.player.tickCount, mc.player.onGround());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/main/java/b/bu.java
Normal file
57
src/main/java/b/bu.java
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Mutable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(Player.class)
|
||||||
|
public class bu {
|
||||||
|
@Mutable
|
||||||
|
float savedYaw;
|
||||||
|
@Mutable
|
||||||
|
float savedPitch;
|
||||||
|
|
||||||
|
@Inject(method = "aiStep", at = @At("HEAD"))
|
||||||
|
private void tickMovement(CallbackInfo ci) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "travel", at = @At("HEAD"))
|
||||||
|
public void fixElytra(CallbackInfo ci) {
|
||||||
|
if (this instanceof LocalPlayer player) {
|
||||||
|
apz currentRotation = defpackage.bz.getInstance().getRotationManager().getCurrentRotation();
|
||||||
|
this.savedYaw = aqg.mc.player.getYRot();
|
||||||
|
this.savedPitch = aqg.mc.player.getXRot();
|
||||||
|
player.setYRot(currentRotation.getYaw());
|
||||||
|
player.setXRot(currentRotation.getPitch());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "travel", at = @At("RETURN"))
|
||||||
|
public void fixElytraEnd(CallbackInfo ci) {
|
||||||
|
if (this instanceof LocalPlayer player) {
|
||||||
|
player.setYRot(this.savedYaw);
|
||||||
|
player.setXRot(this.savedPitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "getDisplayName()Lnet/minecraft/network/chat/Component;", at = @At("RETURN"), cancellable = true)
|
||||||
|
public void modifyDisplayNameForTotems(CallbackInfoReturnable<Component> cir) {
|
||||||
|
if (wh.INSTANCE.isEnabled()) {
|
||||||
|
Player player = (Player)this;
|
||||||
|
int pops = wh.INSTANCE.getPops(player.getGameProfile().name());
|
||||||
|
if (pops > 0) {
|
||||||
|
cir.setReturnValue(
|
||||||
|
Component.empty().append((Component)cir.getReturnValue()).append(Component.literal(" -" + pops).withStyle(ChatFormatting.YELLOW))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/main/java/b/bv.java
Normal file
32
src/main/java/b/bv.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.MouseHandler;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
|
||||||
|
@Mixin(MouseHandler.class)
|
||||||
|
public class bv {
|
||||||
|
@ModifyArg(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;turn(DD)V"), index = 0)
|
||||||
|
private double applyRelativeSensitivityYaw(double yaw) {
|
||||||
|
float tickDelta = Minecraft.getInstance().getDeltaTracker().getGameTimeDeltaPartialTick(false);
|
||||||
|
double divisor = wr.INSTANCE.getZoomDivisor(tickDelta);
|
||||||
|
return divisor <= 1.0 ? yaw : yaw / Mth.lerp(wr.INSTANCE.relativeSensitivity.getCurrent() / 100.0, 1.0, divisor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyArg(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;turn(DD)V"), index = 1)
|
||||||
|
private double applyRelativeSensitivityPitch(double pitch) {
|
||||||
|
float tickDelta = Minecraft.getInstance().getDeltaTracker().getGameTimeDeltaPartialTick(false);
|
||||||
|
double divisor = wr.INSTANCE.getZoomDivisor(tickDelta);
|
||||||
|
return divisor <= 1.0 ? pitch : pitch / Mth.lerp(wr.INSTANCE.relativeSensitivity.getCurrent() / 100.0, 1.0, divisor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyExpressionValue(method = "turnPlayer", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Options;smoothCamera:Z"))
|
||||||
|
private boolean smoothCameraIfZoom(boolean original) {
|
||||||
|
return wr.INSTANCE.isZooming && wr.INSTANCE.cinematicCamera.isEnabled() ? true : original;
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/main/java/b/bw.java
Normal file
45
src/main/java/b/bw.java
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.network.Connection;
|
||||||
|
import net.minecraft.network.PacketListener;
|
||||||
|
import net.minecraft.network.protocol.Packet;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Connection.class)
|
||||||
|
public class bw implements aqg {
|
||||||
|
@Unique
|
||||||
|
private static boolean stackOverflowFix;
|
||||||
|
|
||||||
|
@Inject(method = "genericsFtw(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/PacketListener;)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static <T extends PacketListener> void triggerReceivePacketEvent(Packet<T> packet, PacketListener listener, CallbackInfo ci) {
|
||||||
|
fy event = new fy(fx.RECEIVE, packet);
|
||||||
|
defpackage.j.call(event);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void triggerSendPacketEvent(Packet<?> packet, CallbackInfo ci) {
|
||||||
|
if (!stackOverflowFix) {
|
||||||
|
fy event = new fy(fx.SENT, packet);
|
||||||
|
defpackage.j.call(event);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
Packet<?> newPacket = event.getPacket();
|
||||||
|
if (newPacket != packet) {
|
||||||
|
ci.cancel();
|
||||||
|
stackOverflowFix = true;
|
||||||
|
mc.getConnection().send(newPacket);
|
||||||
|
stackOverflowFix = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/main/java/b/bx.java
Normal file
59
src/main/java/b/bx.java
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
|
import net.minecraft.client.multiplayer.ClientPacketListener;
|
||||||
|
import net.minecraft.network.protocol.game.ClientboundEntityEventPacket;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.sounds.SoundSource;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ClientPacketListener.class)
|
||||||
|
public class bx {
|
||||||
|
@Inject(method = "sendChat(Ljava/lang/String;)V", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void sendChatMessageHook(@NotNull String message, CallbackInfo ci) {
|
||||||
|
if (message.startsWith(defpackage.bz.getInstance().getCommandManager().getPrefix())) {
|
||||||
|
try {
|
||||||
|
defpackage.bz.getInstance()
|
||||||
|
.getCommandManager()
|
||||||
|
.getDispatcher()
|
||||||
|
.execute(message.substring(defpackage.defpackage.bz.getInstance().getCommandManager().getPrefix().length()), bz.getInstance().getCommandManager().getSource());
|
||||||
|
} catch (CommandSyntaxException var4) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "handleEntityEvent(Lnet/minecraft/network/protocol/game/ClientboundEntityEventPacket;)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/multiplayer/ClientLevel;playLocalSound(DDDLnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundSource;FFZ)V"
|
||||||
|
),
|
||||||
|
require = 1
|
||||||
|
)
|
||||||
|
private void totemPopSoundHook(
|
||||||
|
ClientLevel level,
|
||||||
|
double x,
|
||||||
|
double y,
|
||||||
|
double z,
|
||||||
|
SoundEvent soundEvent,
|
||||||
|
SoundSource soundSource,
|
||||||
|
float volume,
|
||||||
|
float pitch,
|
||||||
|
boolean useDistanceDelay,
|
||||||
|
ClientboundEntityEventPacket packet
|
||||||
|
) {
|
||||||
|
if (soundEvent != SoundEvents.TOTEM_USE || !tl.INSTANCE.handleTotemPop(packet.getEntity(level))) {
|
||||||
|
level.playLocalSound(x, y, z, soundEvent, soundSource, volume, pitch, useDistanceDelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/main/java/b/by.java
Normal file
33
src/main/java/b/by.java
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import net.minecraft.client.Camera;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||||
|
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||||
|
|
||||||
|
@Mixin(Camera.class)
|
||||||
|
public abstract class by {
|
||||||
|
@ModifyReturnValue(method = "calculateFov", at = @At("RETURN"))
|
||||||
|
private float evo$modifyWorldFov(float fov, @Local(argsOnly = true) float tickDelta) {
|
||||||
|
fp event = new fp();
|
||||||
|
defpackage.j.call(event);
|
||||||
|
float base = event.isCancelled() ? event.getFov() : fov;
|
||||||
|
return (float)(base / wr.INSTANCE.getZoomDivisor(tickDelta));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyReturnValue(method = "calculateHudFov", at = @At("RETURN"))
|
||||||
|
private float evo$keepHandFov(float fov, @Local(argsOnly = true) float tickDelta) {
|
||||||
|
return !wr.INSTANCE.affectHandFov.isEnabled() ? fov : (float)(fov / wr.INSTANCE.getZoomDivisor(tickDelta));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyArgs(method = "setupPerspective", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Projection;setupPerspective(FFFFF)V"))
|
||||||
|
private void evo$applyAspectRatio(Args args) {
|
||||||
|
float width = (Float)args.get(3);
|
||||||
|
float height = (Float)args.get(4);
|
||||||
|
args.set(3, tp.INSTANCE.stretchWidth(width, height));
|
||||||
|
}
|
||||||
|
}
|
||||||
71
src/main/java/b/bz.java
Normal file
71
src/main/java/b/bz.java
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.math.Axis;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.model.player.PlayerModel;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.entity.layers.PlayerItemInHandLayer;
|
||||||
|
import net.minecraft.client.renderer.entity.player.AvatarRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.state.AvatarRenderState;
|
||||||
|
import net.minecraft.client.renderer.item.ItemStackRenderState;
|
||||||
|
import net.minecraft.world.entity.HumanoidArm;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(PlayerItemInHandLayer.class)
|
||||||
|
public abstract class bz {
|
||||||
|
@Unique
|
||||||
|
private static final float HAND_PITCH_DEGREES = -90.0F;
|
||||||
|
@Unique
|
||||||
|
private static final float HAND_YAW_DEGREES = 180.0F;
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "submitArmWithItem(Lnet/minecraft/client/renderer/entity/state/AvatarRenderState;Lnet/minecraft/client/renderer/item/ItemStackRenderState;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/entity/HumanoidArm;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;I)V",
|
||||||
|
at = @At("HEAD")
|
||||||
|
)
|
||||||
|
private void evo$renderCameraGear(
|
||||||
|
AvatarRenderState state,
|
||||||
|
ItemStackRenderState itemState,
|
||||||
|
ItemStack item,
|
||||||
|
HumanoidArm arm,
|
||||||
|
PoseStack matrices,
|
||||||
|
SubmitNodeCollector queue,
|
||||||
|
int light,
|
||||||
|
CallbackInfo callback
|
||||||
|
) {
|
||||||
|
if (tb.INSTANCE.isEnabled() && item.isEmpty()) {
|
||||||
|
Minecraft client = Minecraft.getInstance();
|
||||||
|
AbstractClientPlayer holder = resolve(client, state);
|
||||||
|
if (holder != null && arm == holder.getMainArm()) {
|
||||||
|
afn held = afo.heldBy(holder.getScoreboardName());
|
||||||
|
if (held != null && held.gear() != aff.NONE) {
|
||||||
|
AvatarRenderer<?> renderer = client.getEntityRenderDispatcher().getPlayerRenderer(holder);
|
||||||
|
if (renderer != null) {
|
||||||
|
matrices.pushPose();
|
||||||
|
((PlayerModel)renderer.getModel()).translateToHand(state, arm, matrices);
|
||||||
|
matrices.mulPose(Axis.XP.rotationDegrees(-90.0F));
|
||||||
|
matrices.mulPose(Axis.YP.rotationDegrees(180.0F));
|
||||||
|
afm.getInstance().submitThirdPerson(held.gear(), held.photoId(), tb.INSTANCE.aspect(), matrices, queue, light);
|
||||||
|
matrices.popPose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static AbstractClientPlayer resolve(Minecraft client, AvatarRenderState state) {
|
||||||
|
if (client.level == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return client.level.getEntity(state.id) instanceof AbstractClientPlayer player ? player : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/java/b/c.java
Normal file
21
src/main/java/b/c.java
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.renderer.state.gui.GuiRenderState;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
|
||||||
|
@Mixin(GuiGraphicsExtractor.class)
|
||||||
|
public interface c {
|
||||||
|
@Accessor("guiRenderState")
|
||||||
|
GuiRenderState getState();
|
||||||
|
|
||||||
|
@Invoker("itemBar")
|
||||||
|
void callDrawItemBar(ItemStack var1, int var2, int var3);
|
||||||
|
|
||||||
|
@Invoker("itemCooldown")
|
||||||
|
void callDrawCooldownProgress(ItemStack var1, int var2, int var3);
|
||||||
|
}
|
||||||
126
src/main/java/b/ca.java
Normal file
126
src/main/java/b/ca.java
Normal file
|
|
@ -0,0 +1,126 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.math.Axis;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import net.minecraft.client.renderer.ItemInHandRenderer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.entity.HumanoidArm;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(value = ItemInHandRenderer.class, priority = 900)
|
||||||
|
public abstract class ca {
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_BOB_VERTICAL = -0.2F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_BOB_DEPTH = -0.4F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_LIFT = 0.04F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_TILT_DROP = -0.6F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_DEPTH = -0.72F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_TILT_DEGREES = -85.0F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_SWING_DEGREES = 20.0F;
|
||||||
|
@Unique
|
||||||
|
private static final float MAP_HAND_YAW = 90.0F;
|
||||||
|
@Unique
|
||||||
|
private static final float HALF = 0.5F;
|
||||||
|
|
||||||
|
@Invoker("applyItemArmTransform")
|
||||||
|
abstract void evo$applyItemArmTransform(PoseStack var1, HumanoidArm var2, float var3);
|
||||||
|
|
||||||
|
@Invoker("applyItemArmAttackTransform")
|
||||||
|
abstract void evo$applyItemArmAttackTransform(PoseStack var1, HumanoidArm var2, float var3);
|
||||||
|
|
||||||
|
@Invoker("calculateMapTilt")
|
||||||
|
abstract float evo$calculateMapTilt(float var1);
|
||||||
|
|
||||||
|
@Invoker("renderMapHand")
|
||||||
|
abstract void evo$renderMapHand(PoseStack var1, SubmitNodeCollector var2, int var3, HumanoidArm var4);
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "submitHandsWithItems(FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/player/LocalPlayer;I)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private void evo$handleCameraGear(float tickProgress, PoseStack matrices, SubmitNodeCollector queue, LocalPlayer player, int light, CallbackInfo callback) {
|
||||||
|
if (afy.getInstance().isArmed()) {
|
||||||
|
callback.cancel();
|
||||||
|
} else if (tb.INSTANCE.isEnabled() && player.getMainHandItem().isEmpty()) {
|
||||||
|
afi slots = afi.getInstance();
|
||||||
|
if (slots.heldGear() == aff.PHOTO) {
|
||||||
|
this.submitHeldPhoto(matrices, queue, player, light, tickProgress, slots.photoId());
|
||||||
|
callback.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private void submitHeldPhoto(PoseStack matrices, SubmitNodeCollector queue, LocalPlayer player, int light, float tickProgress, String photoId) {
|
||||||
|
float swingProgress = player.getAttackAnim(tickProgress);
|
||||||
|
float pitch = player.getViewXRot(tickProgress);
|
||||||
|
float sweep = Mth.sqrt(swingProgress);
|
||||||
|
float bobVertical = -0.2F * Mth.sin(swingProgress * (float) Math.PI);
|
||||||
|
float bobDepth = -0.4F * Mth.sin(sweep * (float) Math.PI);
|
||||||
|
matrices.pushPose();
|
||||||
|
matrices.translate(0.0F, -bobVertical * 0.5F, bobDepth);
|
||||||
|
float tilt = this.evo$calculateMapTilt(pitch);
|
||||||
|
matrices.translate(0.0F, 0.04F + tilt * -0.6F, -0.72F);
|
||||||
|
matrices.mulPose(Axis.XP.rotationDegrees(tilt * -85.0F));
|
||||||
|
if (!player.isInvisible()) {
|
||||||
|
matrices.pushPose();
|
||||||
|
matrices.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||||
|
this.evo$renderMapHand(matrices, queue, light, HumanoidArm.RIGHT);
|
||||||
|
this.evo$renderMapHand(matrices, queue, light, HumanoidArm.LEFT);
|
||||||
|
matrices.popPose();
|
||||||
|
}
|
||||||
|
|
||||||
|
matrices.mulPose(Axis.XP.rotationDegrees(Mth.sin(sweep * (float) Math.PI) * 20.0F));
|
||||||
|
afm.getInstance().submitHeldCard(matrices, queue, light, photoId, tb.INSTANCE.aspect());
|
||||||
|
matrices.popPose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "submitArmWithItem(Lnet/minecraft/client/player/AbstractClientPlayer;FFLnet/minecraft/world/InteractionHand;FLnet/minecraft/world/item/ItemStack;FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;I)V",
|
||||||
|
at = @At("HEAD")
|
||||||
|
)
|
||||||
|
private void evo$renderCameraGear(
|
||||||
|
AbstractClientPlayer player,
|
||||||
|
float tickProgress,
|
||||||
|
float pitch,
|
||||||
|
InteractionHand hand,
|
||||||
|
float swingProgress,
|
||||||
|
ItemStack item,
|
||||||
|
float equipProgress,
|
||||||
|
PoseStack matrices,
|
||||||
|
SubmitNodeCollector queue,
|
||||||
|
int light,
|
||||||
|
CallbackInfo callback
|
||||||
|
) {
|
||||||
|
if (tb.INSTANCE.isEnabled() && hand == InteractionHand.MAIN_HAND && item.isEmpty()) {
|
||||||
|
afi slots = afi.getInstance();
|
||||||
|
aff gear = slots.heldGear();
|
||||||
|
if (gear == aff.CAMERA || gear == aff.TRIPOD) {
|
||||||
|
HumanoidArm arm = player.getMainArm();
|
||||||
|
matrices.pushPose();
|
||||||
|
this.evo$applyItemArmTransform(matrices, arm, equipProgress);
|
||||||
|
this.evo$applyItemArmAttackTransform(matrices, arm, swingProgress);
|
||||||
|
afm.getInstance().submit(gear, slots.photoId(), tb.INSTANCE.aspect(), matrices, queue, light);
|
||||||
|
matrices.popPose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/main/java/b/cb.java
Normal file
43
src/main/java/b/cb.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.model.player.PlayerModel;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.entity.layers.CapeLayer;
|
||||||
|
import net.minecraft.client.renderer.entity.layers.RenderLayer;
|
||||||
|
import net.minecraft.client.renderer.entity.state.AvatarRenderState;
|
||||||
|
import net.minecraft.core.component.DataComponents;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.world.entity.EquipmentSlot;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(CapeLayer.class)
|
||||||
|
public abstract class cb {
|
||||||
|
@Inject(method = "submit", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void evo$waveyCape(
|
||||||
|
PoseStack matrices, SubmitNodeCollector queue, int light, AvatarRenderState state, float limbAngle, float limbDistance, CallbackInfo ci
|
||||||
|
) {
|
||||||
|
Minecraft client = Minecraft.getInstance();
|
||||||
|
if (client.level != null) {
|
||||||
|
if (client.level.getEntity(state.id) instanceof AbstractClientPlayer player) {
|
||||||
|
if (adm.shouldRender(player) && !player.getItemBySlot(EquipmentSlot.CHEST).has(DataComponents.GLIDER)) {
|
||||||
|
RenderLayer<AvatarRenderState, PlayerModel> self = (RenderLayer<AvatarRenderState, PlayerModel>)this;
|
||||||
|
Identifier capeTexture = adm.resolve(player);
|
||||||
|
if (adm.isShaderCape(capeTexture)) {
|
||||||
|
ags.getInstance().enqueue(matrices, player, (PlayerModel)self.getParentModel());
|
||||||
|
} else {
|
||||||
|
agt.getInstance().render(matrices, queue, light, state, player, (PlayerModel)self.getParentModel());
|
||||||
|
}
|
||||||
|
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/main/java/b/cc.java
Normal file
9
src/main/java/b/cc.java
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.multiplayer.ClientLevel.ClientLevelData;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|
||||||
|
@Mixin(ClientLevelData.class)
|
||||||
|
public class cc {
|
||||||
|
}
|
||||||
32
src/main/java/b/cd.java
Normal file
32
src/main/java/b/cd.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.state.EntityRenderState;
|
||||||
|
import net.minecraft.client.renderer.state.level.CameraRenderState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(EntityRenderer.class)
|
||||||
|
public class cd {
|
||||||
|
@Inject(
|
||||||
|
method = "submitNameDisplay(Lnet/minecraft/client/renderer/entity/state/EntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;I)V",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private void evo$hidePattedNameTag(
|
||||||
|
EntityRenderState state, PoseStack matrices, SubmitNodeCollector queue, CameraRenderState cameraState, int verticalOffset, CallbackInfo ci
|
||||||
|
) {
|
||||||
|
if (ta.INSTANCE.isEnabled() && ta.INSTANCE.hidesNameTag()) {
|
||||||
|
if (state instanceof aud access) {
|
||||||
|
if (aim.getInstance().isPatted(access.evo$getEntityId())) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/main/java/b/ce.java
Normal file
57
src/main/java/b/ce.java
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.model.Model;
|
||||||
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.entity.layers.EquipmentLayerRenderer;
|
||||||
|
import net.minecraft.client.resources.model.EquipmentClientInfo.LayerType;
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.resources.ResourceKey;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.equipment.EquipmentAsset;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(EquipmentLayerRenderer.class)
|
||||||
|
public abstract class ce {
|
||||||
|
@Unique
|
||||||
|
private int evo$durabilityTint = 0;
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "renderLayers(Lnet/minecraft/client/resources/model/EquipmentClientInfo$LayerType;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lnet/minecraft/world/item/ItemStack;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;ILnet/minecraft/resources/Identifier;II)V",
|
||||||
|
at = @At("HEAD")
|
||||||
|
)
|
||||||
|
private void evo$captureDurabilityTint(
|
||||||
|
LayerType layerType,
|
||||||
|
ResourceKey<EquipmentAsset> asset,
|
||||||
|
Model<?> model,
|
||||||
|
Object renderState,
|
||||||
|
ItemStack stack,
|
||||||
|
PoseStack matrices,
|
||||||
|
SubmitNodeCollector queue,
|
||||||
|
int light,
|
||||||
|
Identifier texture,
|
||||||
|
int outlineColor,
|
||||||
|
int order,
|
||||||
|
CallbackInfo ci
|
||||||
|
) {
|
||||||
|
this.evo$durabilityTint = to.INSTANCE.tintFor(stack, renderState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyArg(
|
||||||
|
method = "renderLayers(Lnet/minecraft/client/resources/model/EquipmentClientInfo$LayerType;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lnet/minecraft/world/item/ItemStack;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;ILnet/minecraft/resources/Identifier;II)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/OrderedSubmitNodeCollector;submitModel(Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/rendertype/RenderType;IIILnet/minecraft/client/renderer/texture/TextureAtlasSprite;ILnet/minecraft/client/renderer/feature/ModelFeatureRenderer$CrumblingOverlay;)V"
|
||||||
|
),
|
||||||
|
index = 6
|
||||||
|
)
|
||||||
|
private int evo$tintArmorLayer(int color) {
|
||||||
|
return to.applyTint(color, this.evo$durabilityTint);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/main/java/b/cf.java
Normal file
9
src/main/java/b/cf.java
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.entity.layers.RenderLayer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|
||||||
|
@Mixin(RenderLayer.class)
|
||||||
|
public abstract class cf {
|
||||||
|
}
|
||||||
44
src/main/java/b/cg.java
Normal file
44
src/main/java/b/cg.java
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.rendertype.RenderType;
|
||||||
|
import net.minecraft.client.renderer.rendertype.RenderTypes;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(RenderTypes.class)
|
||||||
|
public abstract class cg {
|
||||||
|
@Inject(method = "glint()Lnet/minecraft/client/renderer/rendertype/RenderType;", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void evo$glint(CallbackInfoReturnable<RenderType> callback) {
|
||||||
|
RenderType custom = uz.item();
|
||||||
|
if (custom != null) {
|
||||||
|
callback.setReturnValue(custom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "glintTranslucent()Lnet/minecraft/client/renderer/rendertype/RenderType;", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void evo$glintTranslucent(CallbackInfoReturnable<RenderType> callback) {
|
||||||
|
RenderType custom = uz.itemTranslucent();
|
||||||
|
if (custom != null) {
|
||||||
|
callback.setReturnValue(custom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "entityGlint()Lnet/minecraft/client/renderer/rendertype/RenderType;", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void evo$entityGlint(CallbackInfoReturnable<RenderType> callback) {
|
||||||
|
RenderType custom = uz.entity();
|
||||||
|
if (custom != null) {
|
||||||
|
callback.setReturnValue(custom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "armorEntityGlint()Lnet/minecraft/client/renderer/rendertype/RenderType;", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void evo$armorEntityGlint(CallbackInfoReturnable<RenderType> callback) {
|
||||||
|
RenderType custom = uz.armor();
|
||||||
|
if (custom != null) {
|
||||||
|
callback.setReturnValue(custom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
41
src/main/java/b/ch.java
Normal file
41
src/main/java/b/ch.java
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import net.minecraft.client.DeltaTracker;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Gui.class)
|
||||||
|
public abstract class ch {
|
||||||
|
@Inject(
|
||||||
|
method = "extractRenderState",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/gui/Hud;extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V",
|
||||||
|
shift = Shift.AFTER
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$renderScreenHook(
|
||||||
|
DeltaTracker tickCounter,
|
||||||
|
boolean shouldRenderLevel,
|
||||||
|
boolean resourcesLoaded,
|
||||||
|
CallbackInfo ci,
|
||||||
|
@Local(ordinal = 0) int mouseX,
|
||||||
|
@Local(ordinal = 1) int mouseY,
|
||||||
|
@Local GuiGraphicsExtractor graphics
|
||||||
|
) {
|
||||||
|
atb.beginGui();
|
||||||
|
|
||||||
|
try {
|
||||||
|
defpackage.j.call(new fv(asq.of(graphics, mouseX, mouseY, tickCounter.getGameTimeDeltaPartialTick(false))));
|
||||||
|
} finally {
|
||||||
|
atb.endGui();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
37
src/main/java/b/ci.java
Normal file
37
src/main/java/b/ci.java
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
|
import net.minecraft.client.renderer.state.level.CameraRenderState;
|
||||||
|
import org.joml.Matrix4fc;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(GameRenderer.class)
|
||||||
|
public abstract class ci {
|
||||||
|
@Inject(
|
||||||
|
method = "renderItemInHand",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/ItemInHandRenderer;submitHandsWithItems(FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/player/LocalPlayer;I)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$beginHandShader(CameraRenderState cameraRenderState, float tickDelta, Matrix4fc matrix4f, CallbackInfo ci) {
|
||||||
|
asy.beginRedirect();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "renderItemInHand",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
shift = Shift.AFTER,
|
||||||
|
target = "Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher;renderAllFeatures(Lnet/minecraft/client/renderer/SubmitNodeStorage;)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void evo$endHandShader(CameraRenderState cameraRenderState, float tickDelta, Matrix4fc matrix4f, CallbackInfo ci) {
|
||||||
|
asy.endRedirect();
|
||||||
|
}
|
||||||
|
}
|
||||||
31
src/main/java/b/cj.java
Normal file
31
src/main/java/b/cj.java
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
package b;
|
||||||
|
|
||||||
|
import defpackage.*;
|
||||||
|
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||||
|
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||||
|
import net.minecraft.client.DeltaTracker;
|
||||||
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
|
import net.minecraft.client.gui.Hud;
|
||||||
|
import net.minecraft.client.renderer.state.gui.GuiRenderState;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(Hud.class)
|
||||||
|
public abstract class cj {
|
||||||
|
@WrapOperation(
|
||||||
|
method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/gui/Hud;extractChat(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void captureChatBelowEvolutionHud(Hud instance, GuiGraphicsExtractor extractor, DeltaTracker tickCounter, Operation<Void> original) {
|
||||||
|
GuiRenderState previous = aqw.beginCapture(extractor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
original.call(new Object[]{instance, extractor, tickCounter});
|
||||||
|
} finally {
|
||||||
|
aqw.endCapture(extractor, previous);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue